Class VCardResultParser
java.lang.Object
com.google.zxing.client.result.ResultParser
com.google.zxing.client.result.VCardResultParser
Parses contact information formatted according to the VCard (2.1) format. This is not a complete
implementation but should parse information as commonly encoded in 2D barcodes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Patternprivate static final Patternprivate static final Patternprivate static final Patternprivate static final Patternprivate static final Patternprivate static final Patternprivate static final Patternprivate static final Patternprivate static final PatternFields inherited from class ResultParser
EMPTY_STR_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringdecodeQuotedPrintable(CharSequence value, String charset) private static voidformatNames(Iterable<List<String>> names) Formats name fields of the form "Public;John;Q.;Reverend;III" into a form like "Reverend John Q.private static booleanisLikeVCardDate(CharSequence value) matchSingleVCardPrefixedField(CharSequence prefix, String rawText, boolean trim, boolean parseFieldDivider) matchVCardPrefixedField(CharSequence prefix, String rawText, boolean trim, boolean parseFieldDivider) private static voidmaybeAppendComponent(String[] components, int i, StringBuilder newName) private static voidmaybeAppendFragment(ByteArrayOutputStream fragmentBuffer, String charset, StringBuilder result) Attempts to parse the rawResult's contents as a particular type of information (email, URL, etc.) and return aParsedResultencapsulating the result of parsing.private static StringtoPrimaryValue(List<String> list) private static String[]toPrimaryValues(Collection<List<String>> lists) private static String[]toTypes(Collection<List<String>> lists) Methods inherited from class ResultParser
getMassagedText, isStringOfDigits, isSubstringOfDigits, matchPrefixedField, matchSinglePrefixedField, maybeAppend, maybeAppend, maybeWrap, parseHexDigit, parseNameValuePairs, parseResult, unescapeBackslash, urlDecode
-
Field Details
-
BEGIN_VCARD
-
VCARD_LIKE_DATE
-
CR_LF_SPACE_TAB
-
NEWLINE_ESCAPE
-
VCARD_ESCAPES
-
EQUALS
-
SEMICOLON
-
UNESCAPED_SEMICOLONS
-
COMMA
-
SEMICOLON_OR_COMMA
-
-
Constructor Details
-
VCardResultParser
public VCardResultParser()
-
-
Method Details
-
parse
Description copied from class:ResultParserAttempts to parse the rawResult's contents as a particular type of information (email, URL, etc.) and return aParsedResultencapsulating the result of parsing.- Specified by:
parsein classResultParser- Parameters:
result- the rawResultto parse- Returns:
ParsedResultencapsulating the parsing result
-
matchVCardPrefixedField
static List<List<String>> matchVCardPrefixedField(CharSequence prefix, String rawText, boolean trim, boolean parseFieldDivider) -
decodeQuotedPrintable
-
maybeAppendFragment
private static void maybeAppendFragment(ByteArrayOutputStream fragmentBuffer, String charset, StringBuilder result) -
matchSingleVCardPrefixedField
static List<String> matchSingleVCardPrefixedField(CharSequence prefix, String rawText, boolean trim, boolean parseFieldDivider) -
toPrimaryValue
-
toPrimaryValues
-
toTypes
-
isLikeVCardDate
-
formatNames
-
maybeAppendComponent
-