public abstract class Parser extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ByteBuffer |
buffer |
protected Client |
client |
long |
number |
protected static long |
numerator |
protected int |
options |
static int |
PARSE_DATE_AS_INT
Parse Meta.FieldType.Date fields as
Integer. |
static int |
PARSE_TIME_AS_INT
Parse Meta.FieldType.Time fields as
Integer. |
long |
stamp |
| Modifier | Constructor and Description |
|---|---|
protected |
Parser(Client client) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
buffer()
Get access to raw ASTS buffer.
|
abstract boolean |
empty()
Indicates if the buffer has actually no significant data to parse.
|
int |
execute(Binder binder)
Calls execute(Binder, int) with
options==0. |
int |
execute(Binder binder,
int options)
Starts processing ASTS response buffer.
|
String |
filter()
Request parameters, encoded to ASTS string.
|
Parser |
isolate()
Isolates raw API buffer.
|
int |
length()
Length of the raw ASTS buffer.
|
protected abstract int |
parse(Binder binder) |
protected int |
process(Meta.Message source,
String filter,
Filler filler) |
protected void |
recycle() |
public static int PARSE_DATE_AS_INT
public static int PARSE_TIME_AS_INT
protected Client client
protected ByteBuffer buffer
protected int options
protected static long numerator
public long stamp
public long number
protected Parser(Client client)
public ByteBuffer buffer()
public Parser isolate()
this).Client.Options.isDirectBuffers(),
Client.Options.setDirectBuffers(boolean)public int length()
buffer().public abstract boolean empty()
true if it is safe to skip parsing this buffer.protected abstract int parse(Binder binder) throws ClientException, BufferUnderflowException
public final int execute(Binder binder, int options) throws ClientException, BufferUnderflowException
binder - Binder instance which is responsible to return
an appropriate Filler for parsing Meta.Message.options - combination of PARSE_XXX options to control parser
behavior.ClientException - if the parser could not obtains scale
information.BufferUnderflowException - in case of incorrect ASTS buffer.public final int execute(Binder binder) throws ClientException, BufferUnderflowException
options==0.binder - Binder instance which is responsible to return
an appropriate Filler for parsing Meta.Message.ClientException - if the parser could not obtains scale
information.BufferUnderflowException - in case of incorrect ASTS buffer.execute(Binder, int)public final String filter()
When the same Meta.Message is loaded / opened
(Client.load(String, Map) / Client.open(String, Map, boolean)) with different set
of params, the filter() can be used to distinguish parsing
of one response from another.
Filler.initTableUpdate(Meta.Message) and
Filler.doneTableUpdate(Meta.Message).protected int process(Meta.Message source, String filter, Filler filler) throws BufferUnderflowException, ClientException
protected void recycle()