IParser Interface Reference

Public Member Functions

ParserResult ParseString (string str)
 
ParserResult ParseRawData (byte[] rawData)
 
void SetOptions (Dictionary< string, object > optionMap)
 

Detailed Description

Interface for Parser

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.
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 string was correctly parsed, that is, IllegalArgumentException hasn't been thrown.
void SetOptions ( Dictionary< 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.