public class ArrayParser extends AbstractElementParser
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 (
This parser does not attempt to parse an array as a poor-man's
tuple: {a: [10]}) or when later encountered in parsing
().
[ 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 and Description |
|---|
ArrayParser(JsonStructureParser structParser,
ArrayListener arrayListener,
ElementParser elementParser) |
| Modifier and Type | Method and Description |
|---|---|
ElementParser |
elementParser() |
<T extends ArrayListener> |
listener() |
void |
parse(TokenIterator tokenizer)
Parses
[ ^ ((value)(, (value)* )? ] |
errorFactory, structParserpublic ArrayParser(JsonStructureParser structParser, ArrayListener arrayListener, ElementParser elementParser)
public ElementParser elementParser()
public <T extends ArrayListener> T listener()
public void parse(TokenIterator tokenizer)
[ ^ ((value)(, (value)* )? ]Copyright © 2021 The Apache Software Foundation. All rights reserved.