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
public abstract class ResultParser extends java.lang.ObjectAbstract 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.
-
-
Constructor Summary
Constructors Constructor Description ResultParser()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static java.lang.StringgetMassagedText(Result result)protected static booleanisStringOfDigits(java.lang.CharSequence value, int length)protected static booleanisSubstringOfDigits(java.lang.CharSequence value, int offset, int length)protected static voidmaybeAppend(java.lang.String[] value, java.lang.StringBuilder result)protected static voidmaybeAppend(java.lang.String value, java.lang.StringBuilder result)protected static java.lang.String[]maybeWrap(java.lang.String value)abstract ParsedResultparse(Result theResult)Attempts 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 java.lang.StringunescapeBackslash(java.lang.String escaped)
-
-
-
Method Detail
-
parse
public abstract ParsedResult parse(Result theResult)
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
protected static java.lang.String getMassagedText(Result result)
-
parseResult
public static ParsedResult parseResult(Result theResult)
-
maybeAppend
protected static void maybeAppend(java.lang.String value, java.lang.StringBuilder result)
-
maybeAppend
protected static void maybeAppend(java.lang.String[] value, java.lang.StringBuilder result)
-
maybeWrap
protected static java.lang.String[] maybeWrap(java.lang.String value)
-
unescapeBackslash
protected static java.lang.String unescapeBackslash(java.lang.String escaped)
-
parseHexDigit
protected static int parseHexDigit(char c)
-
isStringOfDigits
protected static boolean isStringOfDigits(java.lang.CharSequence value, int length)
-
isSubstringOfDigits
protected static boolean isSubstringOfDigits(java.lang.CharSequence value, int offset, int length)
-
-