public class NonBlockingJsonParser extends NonBlockingJsonParserBase implements ByteArrayFeeder
JsonParser.Feature, JsonParser.NumberType
Constructor and Description |
---|
NonBlockingJsonParser(IOContext ctxt,
int parserFeatures,
ByteQuadsCanonicalizer sym) |
Modifier and Type | Method and Description |
---|---|
void |
endOfInput()
Method that should be called after last chunk of data to parse has been fed
(with
feedInput in sub-class); can be called regardless of what NonBlockingInputFeeder.needMoreInput()
returns. |
void |
feedInput(byte[] buf,
int start,
int end)
Method that can be called to feed more data, if (and only if)
NonBlockingInputFeeder.needMoreInput() returns true. |
ByteArrayFeeder |
getNonBlockingInputFeeder()
Method that will either return a feeder instance (if parser uses
non-blocking, aka asynchronous access); or
null for
parsers that use blocking I/O. |
boolean |
needMoreInput()
Method called to check whether it is ok to feed more data: parser returns true
if it has no more content to parse (and it is ok to feed more); otherwise false
(and no data should yet be fed).
|
JsonToken |
nextToken()
Main iteration method, which will advance stream enough
to determine type of the next token, if any.
|
int |
releaseBuffered(java.io.OutputStream out)
Method that can be called to push back any content that
has been read but not consumed by the parser.
|
canParseAsync, getBinaryValue, getCodec, getCurrentLocation, getEmbeddedObject, getInputSource, getText, getText, getTextCharacters, getTextLength, getTextOffset, getTokenLocation, getValueAsString, getValueAsString, hasTextCharacters, readBinaryValue, setCodec
_getByteArrayBuilder, close, disable, enable, getBigIntegerValue, getCurrentName, getCurrentValue, getDecimalValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumberType, getNumberValue, getParsingContext, getTokenCharacterOffset, getTokenColumnNr, getTokenLineNr, isClosed, isNaN, overrideCurrentName, overrideStdFeatures, setCurrentValue, setFeatureMask, version
clearCurrentToken, currentToken, currentTokenId, getCurrentToken, getCurrentTokenId, getLastClearedToken, getValueAsBoolean, getValueAsDouble, getValueAsInt, getValueAsInt, getValueAsLong, getValueAsLong, hasCurrentToken, hasToken, hasTokenId, isExpectedStartArrayToken, isExpectedStartObjectToken, nextValue, skipChildren
canReadObjectId, canReadTypeId, canUseSchema, configure, currentName, finishToken, getBinaryValue, getBooleanValue, getByteValue, getFeatureMask, getFormatFeatures, getObjectId, getSchema, getShortValue, getTypeId, getValueAsBoolean, getValueAsDouble, isEnabled, nextBooleanValue, nextFieldName, nextFieldName, nextIntValue, nextLongValue, nextTextValue, overrideFormatFeatures, readBinaryValue, readValueAs, readValueAs, readValueAsTree, readValuesAs, readValuesAs, releaseBuffered, requiresCustomCodec, setRequestPayloadOnError, setRequestPayloadOnError, setRequestPayloadOnError, setSchema
public NonBlockingJsonParser(IOContext ctxt, int parserFeatures, ByteQuadsCanonicalizer sym)
public ByteArrayFeeder getNonBlockingInputFeeder()
JsonParser
null
for
parsers that use blocking I/O.getNonBlockingInputFeeder
in class JsonParser
public final boolean needMoreInput()
NonBlockingInputFeeder
needMoreInput
in interface NonBlockingInputFeeder
public void feedInput(byte[] buf, int start, int end) throws java.io.IOException
ByteArrayFeeder
NonBlockingInputFeeder.needMoreInput()
returns true.feedInput
in interface ByteArrayFeeder
buf
- Byte array that contains data to feed: caller must ensure data remains
stable until it is fully processed (which is true when NonBlockingInputFeeder.needMoreInput()
returns true)start
- Offset within array where input data to process startsend
- Offset after last byte contained in the input arrayjava.io.IOException
- if the state is such that this method should not be called
(has not yet consumed existing input data, or has been marked as closed)public void endOfInput()
NonBlockingInputFeeder
feedInput
in sub-class); can be called regardless of what NonBlockingInputFeeder.needMoreInput()
returns. After calling this method, no more data can be fed; and parser assumes
no more data will be available.endOfInput
in interface NonBlockingInputFeeder
public int releaseBuffered(java.io.OutputStream out) throws java.io.IOException
JsonParser
releaseBuffered
in class NonBlockingJsonParserBase
OutputStream
;
otherwise number of bytes released (0 if there was nothing to release)java.io.IOException
- if write to stream threw exceptionpublic JsonToken nextToken() throws java.io.IOException
JsonParser
nextToken
in class ParserMinimalBase
java.io.IOException
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"