Package com.google.zxing.client.result
Class URIResultParser
java.lang.Object
com.google.zxing.client.result.ResultParser
com.google.zxing.client.result.URIResultParser
Tries to parse results that are a URI of some kind.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Pattern
private static final Pattern
private static final Pattern
private static final Pattern
Fields inherited from class com.google.zxing.client.result.ResultParser
EMPTY_STR_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static boolean
(package private) static boolean
Attempts to parse the rawResult
's contents as a particular type of information (email, URL, etc.) and return aParsedResult
encapsulating the result of parsing.Methods inherited from class com.google.zxing.client.result.ResultParser
getMassagedText, isStringOfDigits, isSubstringOfDigits, matchPrefixedField, matchSinglePrefixedField, maybeAppend, maybeAppend, maybeWrap, parseHexDigit, parseNameValuePairs, parseResult, unescapeBackslash, urlDecode
-
Field Details
-
ALLOWED_URI_CHARS_PATTERN
-
USER_IN_HOST
-
URL_WITH_PROTOCOL_PATTERN
-
URL_WITHOUT_PROTOCOL_PATTERN
-
-
Constructor Details
-
URIResultParser
public URIResultParser()
-
-
Method Details
-
parse
Description copied from class:ResultParser
Attempts to parse the rawResult
's contents as a particular type of information (email, URL, etc.) and return aParsedResult
encapsulating the result of parsing.- Specified by:
parse
in classResultParser
- Parameters:
result
- the rawResult
to parse- Returns:
ParsedResult
encapsulating the parsing result
-
isPossiblyMaliciousURI
- Returns:
- true if the URI contains suspicious patterns that may suggest it intends to mislead the user about its true nature. At the moment this looks for the presence of user/password syntax in the host/authority portion of a URI which may be used in attempts to make the URI's host appear to be other than it is. Example: http://yourbank.com@phisher.com This URI connects to phisher.com but may appear to connect to yourbank.com at first glance.
-
isBasicallyValidURI
-