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, WifiResultParser
public abstract class ResultParser
- extends java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResultParser
public ResultParser()
parse
public abstract ParsedResult parse(Result theResult)
- Attempts to parse the raw
Result
's contents as a particular type
of information (email, URL, etc.) and return a ParsedResult
encapsulating
the result of parsing.
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)
isSubstringOfAlphaNumeric
protected static boolean isSubstringOfAlphaNumeric(java.lang.CharSequence value,
int offset,
int length)