Parser Class Reference

Inherits NativeHandle.

Public Member Functions

ParserResult parseString (String str)
 
ParserResult parseRawData (byte[] rawData)
 
void setOptions (Map< String, Object > optionMap)
 

Detailed Description

Defines the interface for a data string parser.

Parsers are capable of parsing one particular data format, which is passed to them during construction.

The parser is created through BarcodePicker.createParserForFormat(). Note that you need to have a valid license to use the parser feature.

For documentation on the available formats, go to the official parser library documentation.

Since
5.6

Member Function Documentation

ParserResult parseString ( String  str)

Parses the data string and returns the contained fields in the result object.

In case parsing of the data failed, an IllegalArgumentException is thrown.

Parameters
strThe string to parse. Must not be null.
Returns
The result object. Before accessing the fields of the result, you must ensure that the string was correctly parsed, that is, IllegalArgumentException hasn't been thrown.
Since
5.6
ParserResult parseRawData ( byte[]  rawData)

Parses the data and returns the contained fields in the result object.

Use this overload in case you have data that cannot be safely represented using unicode code points.

In case parsing of the data failed, an IllegalArgumentException is thrown.

Parameters
rawDataThe string to parse. Must not be null.
Returns
The result object. Before accessing the fields of the result, you must ensure that the rawData was correctly parsed, that is, IllegalArgumentException hasn't been thrown.
Since
5.6
void setOptions ( Map< String, Object >  optionMap)

Apply the option map to the parser, allowing the user to fine-tune the behavior of the parser.

Available options depend on the data format and are specified in the respective documentation.

In case the options could not be applied, an IllegalArgumentException is thrown.

Parameters
optionMapThe options dictionary. Must not be null.
Since
5.6

The documentation for this class was generated from the following file:
  • Parser.java