public class JsonParserSequence extends JsonParserDelegate
JsonParsers to create a single logical sequence of
tokens, as a single JsonParser.
Fairly simple use of JsonParserDelegate: only need
to override nextToken() to handle transition
JsonParser.Feature, JsonParser.NumberType| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the parser so that no further iteration or data access
can be made; will also close the underlying input source
if parser either owns the input source, or feature
JsonParser.Feature.AUTO_CLOSE_SOURCE is enabled. |
int |
containedParsersCount()
Method that is most useful for debugging or testing;
returns actual number of underlying parsers sequence
was constructed with (nor just ones remaining active)
|
static JsonParserSequence |
createFlattened(boolean checkForExistingToken,
JsonParser first,
JsonParser second)
Method that will construct a sequence (possibly a sequence) that
contains all given sub-parsers.
|
static JsonParserSequence |
createFlattened(JsonParser first,
JsonParser second)
Deprecated.
|
JsonToken |
nextToken()
Main iteration method, which will advance stream enough
to determine type of the next token, if any.
|
JsonParser |
skipChildren()
Need to override, re-implement similar to how method defined in
ParserMinimalBase, to keep
state correct here. |
assignCurrentValue, canReadObjectId, canReadTypeId, canUseSchema, clearCurrentToken, currentLocation, currentName, currentToken, currentTokenId, currentTokenLocation, currentValue, delegate, disable, enable, finishToken, getBigIntegerValue, getBinaryValue, getBooleanValue, getByteValue, getCodec, getCurrentLocation, getCurrentName, getCurrentToken, getCurrentTokenId, getCurrentValue, getDecimalValue, getDoubleValue, getEmbeddedObject, getFeatureMask, getFloatValue, getInputSource, getIntValue, getLastClearedToken, getLongValue, getNumberType, getNumberValue, getNumberValueExact, getObjectId, getParsingContext, getReadCapabilities, getSchema, getShortValue, getText, getText, getTextCharacters, getTextLength, getTextOffset, getTokenLocation, getTypeId, getValueAsBoolean, getValueAsBoolean, getValueAsDouble, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, getValueAsString, getValueAsString, hasCurrentToken, hasTextCharacters, hasToken, hasTokenId, isClosed, isEnabled, isExpectedNumberIntToken, isExpectedStartArrayToken, isExpectedStartObjectToken, isNaN, nextValue, overrideCurrentName, overrideFormatFeatures, overrideStdFeatures, readBinaryValue, requiresCustomCodec, setCodec, setCurrentValue, setFeatureMask, setSchema, versioncanParseAsync, configure, getBinaryValue, getFormatFeatures, getNonBlockingInputFeeder, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, releaseBuffered, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnErrorpublic static JsonParserSequence createFlattened(boolean checkForExistingToken, JsonParser first, JsonParser second)
checkForExistingToken - Flag passed to be assigned as
_checkForExistingToken for resulting sequencefirst - First parser to traversesecond - Second parser to traverse@Deprecated public static JsonParserSequence createFlattened(JsonParser first, JsonParser second)
public void close()
throws java.io.IOException
JsonParserJsonParser.Feature.AUTO_CLOSE_SOURCE is enabled.
Whether parser owns the input source depends on factory
method that was used to construct instance (so check
JsonFactory for details,
but the general
idea is that if caller passes in closable resource (such
as InputStream or Reader) parser does NOT
own the source; but if it passes a reference (such as
File or URL and creates
stream or reader it does own them.close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class JsonParserDelegatejava.io.IOException - if there is either an underlying I/O problempublic JsonToken nextToken() throws java.io.IOException
JsonParsernextToken in class JsonParserDelegatejava.io.IOException - for low-level read issues, or
JsonParseException for decoding problemspublic JsonParser skipChildren() throws java.io.IOException
ParserMinimalBase, to keep
state correct here.skipChildren in class JsonParserDelegatejava.io.IOException - for low-level read issues, or
JsonParseException for decoding problemspublic int containedParsersCount()
Copyright © 2010 - 2023 Adobe. All Rights Reserved