Package com.google.zxing.client.result
Class ResultParser
java.lang.Object
com.google.zxing.client.result.ResultParser
- Direct Known Subclasses:
AddressBookAUResultParser,AddressBookDoCoMoResultParser,BizcardResultParser,BookmarkDoCoMoResultParser,EmailAddressResultParser,EmailDoCoMoResultParser,ExpandedProductResultParser,GeoResultParser,ISBNResultParser,ProductResultParser,SMSMMSResultParser,SMSTOMMSTOResultParser,SMTPResultParser,TelResultParser,URIResultParser,URLTOResultParser,VCardResultParser,VEventResultParser,VINResultParser,WifiResultParser
Abstract class representing the result of decoding a barcode, as more than
a String -- as some type of structured data. This might be a subclass which represents
a URL, or an e-mail address. parseResult(Result) will turn a raw
decoded string into the most appropriate type of structured representation.
Thanks to Jeff Griffin for proposing rewrite of these classes that relies less on exception-based mechanisms during parsing.
- Author:
- Sean Owen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringgetMassagedText(Result result) protected static booleanisStringOfDigits(CharSequence value, int length) protected static booleanisSubstringOfDigits(CharSequence value, int offset, int length) protected static voidmaybeAppend(String[] value, StringBuilder result) protected static voidmaybeAppend(String value, StringBuilder result) protected static String[]abstract ParsedResultAttempts to parse the rawResult's contents as a particular type of information (email, URL, etc.) and return aParsedResultencapsulating the result of parsing.protected static intparseHexDigit(char c) static ParsedResultparseResult(Result theResult) protected static StringunescapeBackslash(String escaped)
-
Constructor Details
-
ResultParser
public ResultParser()
-
-
Method Details
-
parse
Attempts to parse the rawResult's contents as a particular type of information (email, URL, etc.) and return aParsedResultencapsulating the result of parsing.- Parameters:
theResult- the rawResultto parse- Returns:
ParsedResultencapsulating the parsing result
-
getMassagedText
-
parseResult
-
maybeAppend
-
maybeAppend
-
maybeWrap
-
unescapeBackslash
-
parseHexDigit
protected static int parseHexDigit(char c) -
isStringOfDigits
-
isSubstringOfDigits
-