Class ArrayParser
java.lang.Object
org.apache.drill.exec.store.easy.json.parser.AbstractElementParser
org.apache.drill.exec.store.easy.json.parser.ArrayParser
- All Implemented Interfaces:
ElementParser
Parses a JSON array, which consists of a list of elements,
represented by a
ValueListener
. There is a single listener
for all the elements, which are presumed to be of the same type.
The element is created when first encountered, either as part of field
creation ({a: [10]}
) or when later encountered in parsing
(<code{a: []} {a: [10]}).
This parser does not attempt to parse an array as a poor-man's
tuple: [ 101, "fred", 23.45 ]
. The listener could handle this
case. But, if we need to handle such a case, it would be better to
create a new parser for that case, with an element listener per
element as is done for objects.
-
Constructor Summary
ConstructorDescriptionArrayParser
(JsonStructureParser structParser, ArrayListener arrayListener, ElementParser elementParser) -
Method Summary
Modifier and TypeMethodDescription<T extends ArrayListener>
Tlistener()
void
parse
(TokenIterator tokenizer) Parses[ ^ ((value)(, (value)* )? ]
Methods inherited from class org.apache.drill.exec.store.easy.json.parser.AbstractElementParser
errorFactory, structParser
-
Constructor Details
-
ArrayParser
public ArrayParser(JsonStructureParser structParser, ArrayListener arrayListener, ElementParser elementParser)
-
-
Method Details
-
elementParser
-
listener
-
parse
Parses[ ^ ((value)(, (value)* )? ]
-