Top Description Fields Constructors Methods
tools.jackson.dataformat.yaml

public Class YAMLParser

extends ParserBase
Class Inheritance
Imports
java.io.*, java.math.BigInteger, java.util.Optional, tools.jackson.core.*, tools.jackson.core.base.ParserBase, tools.jackson.core.io.IOContext, .NumberInput, tools.jackson.core.json.DupDetector, tools.jackson.core.util.BufferRecycler, .JacksonFeatureSet, .SimpleStreamReadContext, org.snakeyaml.engine.v2.api.LoadSettings, org.snakeyaml.engine.v2.common.Anchor, org.snakeyaml.engine.v2.events.AliasEvent, .CollectionStartEvent, .Event, .MappingStartEvent, .NodeEvent, .ScalarEvent, org.snakeyaml.engine.v2.exceptions.Mark, org.snakeyaml.engine.v2.nodes.Tag, org.snakeyaml.engine.v2.parser.ParserImpl, org.snakeyaml.engine.v2.resolver.JsonScalarResolver, .ScalarResolver, org.snakeyaml.engine.v2.scanner.StreamReader

JsonParser implementation used to expose YAML documents in form that allows other Jackson functionality to process YAML content, such as binding POJOs to and from it, and building tree representations.

Field Summary

Modifier and TypeField and Description
protected final boolean
protected String
_cleanedTextValue

For some tokens (specifically, numbers), we'll have cleaned up version, mostly free of underscores

protected Optional<Anchor>
_currentAnchor

Anchor for the value that parser currently points to: in case of structured types, value whose first token current token is.

protected boolean
_currentIsAlias

Flag that is set when current token was derived from an Alias (reference to another value's anchor)

protected String
_currentName

Let's also have a local copy of the current property name

protected final int
protected Event
_lastEvent

Keep track of the last event read, to get access to Location info

protected Event
_lastTagEvent

To keep track of tags ("type ids"), need to either get tags for all events, or, keep tag of relevant event that might have it: this is different from _lastEvent in some cases.

protected final Reader
_reader

Need to keep track of underlying Reader to be able to auto-close it (if required to)

protected SimpleStreamReadContext
_streamReadContext

Information about parser context, context in which the next token is to be parsed (root, array, object).

protected String
_textValue

We need to keep track of text values.

protected final ParserImpl
protected final ScalarResolver
Inherited from tools.jackson.core.base.ParserBase:
_binaryValue_byteArrayBuilder_currInputProcessed_currInputRow_currInputRowStart_expLength_fractLength_inputEnd_inputPtr_intLength_numberBigDecimal_numberBigInt_numberDouble_numberFloat_numberInt_numberIsNaN_numberLong_numberNegative_numberString_numTypesValid_textBuffer_tokenInputCol_tokenInputRow_tokenInputTotal

Constructor Summary

AccessConstructor and Description
public
YAMLParser(ObjectReadContext readCtxt, IOContext ioCtxt, BufferRecycler br, int streamReadFeatures, int formatFeatures, LoadSettings loadSettings, Reader reader)

protected
YAMLParser(ObjectReadContext readCtxt, IOContext ioCtxt, BufferRecycler br, int streamReadFeatures, int formatFeatures, Reader reader, ParserImpl yamlParser)

Method Summary

Modifier and TypeMethod and Description
private String
_cleanUnderscores(String str, int i, final int len)

private JsonToken
private JsonToken
_cleanYamlInt(String str)

Helper method used to clean up YAML integer value so it can be parsed using standard JDK classes.

protected void
_closeInput()

Implements abstract tools.jackson.core.base.ParserMinimalBase._closeInput.

Abstract method for sub-classes to implement; to be called by close() implementation here.

private BigInteger
_decodeBigInt(String numStr, int base)

private JsonToken
_decodeFromBigInteger(BigInteger unsignedValue, boolean negative)

private JsonToken
_decodeFromLong(long unsignedValue, boolean negative, boolean checkIfInt)

private int
_decodeInt(String numStr, int base)

private long
_decodeLong(String numStr, int base)

protected JsonToken
_decodeNumberIntBinary(final String value, int i, final int origLen, boolean negative)

protected JsonToken
_decodeNumberIntHex(final String value, int i, final int origLen, boolean negative)

protected JsonToken
_decodeNumberIntOctal(final String value, int i, final int origLen, boolean negative)

protected JsonToken
_decodeNumberScalar(String value, final int len)

protected JsonToken
private static ParserImpl
protected TokenStreamLocation
protected Boolean
_matchYAMLBoolean(String value, int len)

protected int
protected void
_parseNumericValue(int expType)

Implements abstract tools.jackson.core.base.ParserBase._parseNumericValue.

Method that will parse actual numeric value out of a syntactically valid number value.

private <T> T
_reportInvalidNumber(String numStr, int base, Exception e)

protected void
_reportMismatchedEndMarker(int actCh, char expCh)

public void
assignCurrentValue(Object v)

Overrides tools.jackson.core.base.ParserBase.assignCurrentValue.

Helper method, usually equivalent to: getParsingContext().assignCurrentValue(v);

public boolean
canReadObjectId()

Overrides tools.jackson.core.JsonParser.canReadObjectId.

Introspection method that may be called to see if the underlying data format supports some kind of Object Ids natively (many do not; for example, JSON doesn't).

public boolean
canReadTypeId()

Overrides tools.jackson.core.JsonParser.canReadTypeId.

Introspection method that may be called to see if the underlying data format supports some kind of Type Ids natively (many do not; for example, JSON doesn't).

public TokenStreamLocation
currentLocation()

Implements abstract tools.jackson.core.JsonParser.currentLocation.

Method that returns location of the last processed character; usually for error reporting purposes.

public String
currentName()

Implements abstract tools.jackson.core.JsonParser.currentName.

Method that can be called to get the name associated with the current token: for JsonToken#PROPERTY_NAMEs it will be the same as what getString() returns; for Object property values it will be the preceding property name; and for others (array element, root-level values) null.

public TokenStreamLocation
currentTokenLocation()

Implements abstract tools.jackson.core.JsonParser.currentTokenLocation.

Method that return the starting location of the current token; that is, position of the first character from input that starts the current token.

public Object
currentValue()

Overrides tools.jackson.core.base.ParserBase.currentValue.

Helper method, usually equivalent to: getParsingContext().currentValue();

Note that "current value" is NOT populated (or used) by Streaming parser; it is only used by higher-level data-binding functionality.

public Object
getEmbeddedObject()

Overrides tools.jackson.core.base.ParserMinimalBase.getEmbeddedObject.

Accessor that can be called if (and only if) the current token is JsonToken#VALUE_EMBEDDED_OBJECT.

public Object
getNumberValueDeferred()

Overrides tools.jackson.core.base.ParserBase.getNumberValueDeferred.

Method similar to getNumberValue but that returns either same Number value as getNumberValue() (if already decoded), or String representation of as-of-yet undecoded number.

public String
getObjectId()

Overrides tools.jackson.core.JsonParser.getObjectId.

Method that can be called to check whether current token (one that was just read) has an associated Object id, and if so, return it.

public String
getString()

Implements abstract tools.jackson.core.JsonParser.getString.

Method for accessing textual representation of the current token; if no current token (before first call to nextToken, or after encountering end-of-input), returns null.

public int
getString(Writer writer)

Overrides tools.jackson.core.base.ParserMinimalBase.getString.

Method to read the textual representation of the current token in chunks and pass it to the given Writer.

public char[]
getStringCharacters()

Implements abstract tools.jackson.core.JsonParser.getStringCharacters.

Method similar to getString(), but that will return underlying (unmodifiable) character array that contains textual value, instead of constructing a String object to contain this information.

public int
getStringLength()

Implements abstract tools.jackson.core.JsonParser.getStringLength.

Accessor used with getStringCharacters, to know length of String stored in returned buffer.

public int
getStringOffset()

Implements abstract tools.jackson.core.JsonParser.getStringOffset.

Accessor used with getStringCharacters, to know offset of the first text content character within buffer.

public String
getTypeId()

Overrides tools.jackson.core.JsonParser.getTypeId.

Method that can be called to check whether current token (one that was just read) has an associated type id, and if so, return it.

public boolean
hasStringCharacters()

Overrides tools.jackson.core.base.ParserBase.hasStringCharacters.

Method that can be used to determine whether calling of getStringCharacters would be the most efficient way to access String value for the event parser currently points to (compared to getString()).

public boolean
isCurrentAlias()

Method that can be used to check whether current token was created from YAML Alias token (reference to an anchor).

public boolean
isEnabled(YAMLReadFeature f)

Method for checking whether specified YAMLReadFeature is enabled.

protected Event
public JsonToken
nextToken()

Implements abstract tools.jackson.core.JsonParser.nextToken.

Main iteration method, which will advance stream enough to determine type of the next token, if any.

public int
readBinaryValue(Base64Variant b64variant, OutputStream out)

Overrides tools.jackson.core.JsonParser.readBinaryValue.

Similar to readBinaryValue(OutputStream) but allows explicitly specifying base64 variant to use.

public JacksonFeatureSet<StreamReadCapability>
streamReadCapabilities()

Overrides tools.jackson.core.base.ParserMinimalBase.streamReadCapabilities.

Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly).

public TokenStreamContext
streamReadContext()

Implements abstract tools.jackson.core.JsonParser.streamReadContext.

Method that can be used to access current parsing context reader is in. There are 3 different types: root, array and object contexts, with slightly different available information.

public Reader
streamReadInputSource()

Implements abstract tools.jackson.core.JsonParser.streamReadInputSource.

Method that can be used to get access to object that is used to access input being parsed; this is usually either InputStream or Reader, depending on what parser was constructed with.

public Version
version()

Implements abstract tools.jackson.core.JsonParser.version.

Implements tools.jackson.core.Versioned.version.

Accessor for getting version of the core package, given a parser instance.

Inherited from tools.jackson.core.base.ParserBase:
_contentReference_contentReferenceRedacted_convertBigDecimalToBigInteger_decodeBase64Escape_decodeBase64Escape_decodeEscaped_eofAsNextChar_getBigDecimal_getBigInteger_getByteArrayBuilder_getNumberDouble_getNumberFloat_growNameDecodeBuffer_handleBase64MissingPadding_handleEOF_releaseBuffers_reportInvalidBase64Char_reportInvalidBase64CharcloseconvertNumberToBigDecimalconvertNumberToBigIntegerconvertNumberToDoubleconvertNumberToFloatconvertNumberToIntconvertNumberToLonggetBigIntegerValuegetBinaryValuegetDecimalValuegetDoubleValuegetFloatValuegetIntValuegetLongValuegetNumberTypegetNumberValuegetNumberValueExactgetTokenCharacterOffsetgetTokenColumnNrgetTokenLineNrgrowArrayByisNaNresetresetAsNaNresetFloatresetInt

Field Detail

_cfgEmptyStringsToNullback to summary
protected final boolean _cfgEmptyStringsToNull
_cleanedTextValueback to summary
protected String _cleanedTextValue

For some tokens (specifically, numbers), we'll have cleaned up version, mostly free of underscores

_currentAnchorback to summary
protected Optional<Anchor> _currentAnchor

Anchor for the value that parser currently points to: in case of structured types, value whose first token current token is.

_currentIsAliasback to summary
protected boolean _currentIsAlias

Flag that is set when current token was derived from an Alias (reference to another value's anchor)

_currentNameback to summary
protected String _currentName

Let's also have a local copy of the current property name

_formatFeaturesback to summary
protected final int _formatFeatures
_lastEventback to summary
protected Event _lastEvent

Keep track of the last event read, to get access to Location info

_lastTagEventback to summary
protected Event _lastTagEvent

To keep track of tags ("type ids"), need to either get tags for all events, or, keep tag of relevant event that might have it: this is different from _lastEvent in some cases.

_readerback to summary
protected final Reader _reader

Need to keep track of underlying Reader to be able to auto-close it (if required to)

_streamReadContextback to summary
protected SimpleStreamReadContext _streamReadContext

Information about parser context, context in which the next token is to be parsed (root, array, object).

_textValueback to summary
protected String _textValue

We need to keep track of text values.

_yamlParserback to summary
protected final ParserImpl _yamlParser
_yamlResolverback to summary
protected final ScalarResolver _yamlResolver

Constructor Detail

YAMLParserback to summary
public YAMLParser(ObjectReadContext readCtxt, IOContext ioCtxt, BufferRecycler br, int streamReadFeatures, int formatFeatures, LoadSettings loadSettings, Reader reader)
YAMLParserback to summary
protected YAMLParser(ObjectReadContext readCtxt, IOContext ioCtxt, BufferRecycler br, int streamReadFeatures, int formatFeatures, Reader reader, ParserImpl yamlParser)

Method Detail

_cleanUnderscoresback to summary
private String _cleanUnderscores(String str, int i, final int len)
_cleanYamlFloatback to summary
private JsonToken _cleanYamlFloat(String str)
_cleanYamlIntback to summary
private JsonToken _cleanYamlInt(String str) throws JacksonException

Helper method used to clean up YAML integer value so it can be parsed using standard JDK classes. Currently this just means stripping out optional underscores.

_closeInputback to summary
protected void _closeInput() throws IOException

Implements abstract tools.jackson.core.base.ParserMinimalBase._closeInput.

Doc from tools.jackson.core.base.ParserMinimalBase._closeInput.

Abstract method for sub-classes to implement; to be called by close() implementation here.

Annotations
@Override
Exceptions
IOException:
from underlying input source if thrown
_decodeBigIntback to summary
private BigInteger _decodeBigInt(String numStr, int base) throws JacksonException
_decodeFromBigIntegerback to summary
private JsonToken _decodeFromBigInteger(BigInteger unsignedValue, boolean negative)
_decodeFromLongback to summary
private JsonToken _decodeFromLong(long unsignedValue, boolean negative, boolean checkIfInt)
_decodeIntback to summary
private int _decodeInt(String numStr, int base) throws JacksonException
_decodeLongback to summary
private long _decodeLong(String numStr, int base) throws JacksonException
_decodeNumberIntBinaryback to summary
protected JsonToken _decodeNumberIntBinary(final String value, int i, final int origLen, boolean negative) throws JacksonException
_decodeNumberIntHexback to summary
protected JsonToken _decodeNumberIntHex(final String value, int i, final int origLen, boolean negative) throws JacksonException
_decodeNumberIntOctalback to summary
protected JsonToken _decodeNumberIntOctal(final String value, int i, final int origLen, boolean negative) throws JacksonException
_decodeNumberScalarback to summary
protected JsonToken _decodeNumberScalar(String value, final int len) throws JacksonException
_decodeScalarback to summary
protected JsonToken _decodeScalar(ScalarEvent scalar) throws JacksonException
_defaultParserImplback to summary
private static ParserImpl _defaultParserImpl(LoadSettings settings, Reader r)
_locationForback to summary
protected TokenStreamLocation _locationFor(Optional<Mark> option)
_matchYAMLBooleanback to summary
protected Boolean _matchYAMLBoolean(String value, int len)
_parseIntValueback to summary
protected int _parseIntValue() throws JacksonException

Implements abstract tools.jackson.core.base.ParserBase._parseIntValue.

Annotations
@Override
_parseNumericValueback to summary
protected void _parseNumericValue(int expType) throws JacksonException

Implements abstract tools.jackson.core.base.ParserBase._parseNumericValue.

Doc from tools.jackson.core.base.ParserBase._parseNumericValue.

Method that will parse actual numeric value out of a syntactically valid number value. Type it will parse into depends on whether it is a floating point number, as well as its magnitude: smallest legal type (of ones available) is used for efficiency.

Annotations
@Override
_reportInvalidNumberback to summary
private <T> T _reportInvalidNumber(String numStr, int base, Exception e) throws JacksonException
_reportMismatchedEndMarkerback to summary
protected void _reportMismatchedEndMarker(int actCh, char expCh) throws JacksonException
assignCurrentValueback to summary
public void assignCurrentValue(Object v)

Overrides tools.jackson.core.base.ParserBase.assignCurrentValue.

Doc from tools.jackson.core.JsonParser.assignCurrentValue.

Helper method, usually equivalent to: getParsingContext().assignCurrentValue(v);

Annotations
@Override
canReadObjectIdback to summary
public boolean canReadObjectId()

Overrides tools.jackson.core.JsonParser.canReadObjectId.

Doc from tools.jackson.core.JsonParser.canReadObjectId.

Introspection method that may be called to see if the underlying data format supports some kind of Object Ids natively (many do not; for example, JSON doesn't).

Default implementation returns true; overridden by data formats that do support native Object Ids. Caller is expected to either use a non-native notation (explicit property or such), or fail, in case it cannot use native object ids.

Annotations
@Override
canReadTypeIdback to summary
public boolean canReadTypeId()

Overrides tools.jackson.core.JsonParser.canReadTypeId.

Doc from tools.jackson.core.JsonParser.canReadTypeId.

Introspection method that may be called to see if the underlying data format supports some kind of Type Ids natively (many do not; for example, JSON doesn't).

Default implementation returns true; overridden by data formats that do support native Type Ids. Caller is expected to either use a non-native notation (explicit property or such), or fail, in case it cannot use native type ids.

Annotations
@Override
currentLocationback to summary
public TokenStreamLocation currentLocation()

Implements abstract tools.jackson.core.JsonParser.currentLocation.

Doc from tools.jackson.core.JsonParser.currentLocation.

Method that returns location of the last processed character; usually for error reporting purposes.

Note that the location is not guaranteed to be accurate (although most implementation will try their best): some implementations may only report specific boundary locations (start or end locations of tokens) and others only return TokenStreamLocation#NA due to not having access to input location information (when delegating actual decoding work to other library).

Annotations
@Override
currentNameback to summary
public String currentName() throws JacksonException

Implements abstract tools.jackson.core.JsonParser.currentName.

Doc from tools.jackson.core.JsonParser.currentName.

Method that can be called to get the name associated with the current token: for JsonToken#PROPERTY_NAMEs it will be the same as what getString() returns; for Object property values it will be the preceding property name; and for others (array element, root-level values) null.

Annotations
@Override
currentTokenLocationback to summary
public TokenStreamLocation currentTokenLocation()

Implements abstract tools.jackson.core.JsonParser.currentTokenLocation.

Doc from tools.jackson.core.JsonParser.currentTokenLocation.

Method that return the starting location of the current token; that is, position of the first character from input that starts the current token.

Note that the location is not guaranteed to be accurate (although most implementation will try their best): some implementations may only return TokenStreamLocation#NA due to not having access to input location information (when delegating actual decoding work to other library).

Annotations
@Override
currentValueback to summary
public Object currentValue()

Overrides tools.jackson.core.base.ParserBase.currentValue.

Doc from tools.jackson.core.JsonParser.currentValue.

Helper method, usually equivalent to: getParsingContext().currentValue();

Note that "current value" is NOT populated (or used) by Streaming parser; it is only used by higher-level data-binding functionality. The reason it is included here is that it can be stored and accessed hierarchically, and gets passed through data-binding.

Annotations
@Override
getEmbeddedObjectback to summary
public Object getEmbeddedObject() throws JacksonException

Overrides tools.jackson.core.base.ParserMinimalBase.getEmbeddedObject.

Doc from tools.jackson.core.JsonParser.getEmbeddedObject.

Accessor that can be called if (and only if) the current token is JsonToken#VALUE_EMBEDDED_OBJECT. For other token types, null is returned.

Note

only some specialized parser implementations support embedding of objects (usually ones that are facades on top of non-streaming sources, such as object trees). One exception is access to binary content (whether via base64 encoding or not) which typically is accessible using this method, as well as getBinaryValue().

Annotations
@Override
getNumberValueDeferredback to summary
public Object getNumberValueDeferred() throws JacksonException

Overrides tools.jackson.core.base.ParserBase.getNumberValueDeferred.

Doc from tools.jackson.core.JsonParser.getNumberValueDeferred.

Method similar to getNumberValue but that returns either same Number value as getNumberValue() (if already decoded), or String representation of as-of-yet undecoded number. Typically textual formats allow deferred decoding from String, whereas binary formats either decode numbers eagerly or have binary representation from which to decode value to return.

Same constraints apply to calling this method as to getNumberValue(): current token must be either JsonToken#VALUE_NUMBER_INT or JsonToken#VALUE_NUMBER_FLOAT; otherwise an exception is thrown

Default implementation simply returns getNumberValue()

Annotations
@Override
getObjectIdback to summary
public String getObjectId() throws JacksonException

Overrides tools.jackson.core.JsonParser.getObjectId.

Doc from tools.jackson.core.JsonParser.getObjectId.

Method that can be called to check whether current token (one that was just read) has an associated Object id, and if so, return it. Note that while typically caller should check with canReadObjectId first, it is not illegal to call this method even if that method returns true; but if so, it will return null. This may be used to simplify calling code.

Default implementation will simply return null.

Annotations
@Override
getStringback to summary
public String getString() throws JacksonException

Implements abstract tools.jackson.core.JsonParser.getString.

Doc from tools.jackson.core.JsonParser.getString.

Method for accessing textual representation of the current token; if no current token (before first call to nextToken, or after encountering end-of-input), returns null. Method can be called for any token type.

Annotations
@Override
getStringback to summary
public int getString(Writer writer) throws JacksonException

Overrides tools.jackson.core.base.ParserMinimalBase.getString.

Doc from tools.jackson.core.JsonParser.getString.

Method to read the textual representation of the current token in chunks and pass it to the given Writer. Functionally same as calling:

  writer.write(parser.getString());
but should typically be more efficient as longer content does need to be combined into a single String to return, and write can occur directly from intermediate buffers Jackson uses.

Note

String value will still be buffered (usually using TextBuffer) and will be accessible with other getString() calls (that is, it will not be consumed). So this accessor only avoids construction of java.lang.String compared to plain getString() method.

Note

In Jackson 2.x this method was called getString(Writer).

Annotations
@Override
getStringCharactersback to summary
public char[] getStringCharacters() throws JacksonException

Implements abstract tools.jackson.core.JsonParser.getStringCharacters.

Doc from tools.jackson.core.JsonParser.getStringCharacters.

Method similar to getString(), but that will return underlying (unmodifiable) character array that contains textual value, instead of constructing a String object to contain this information. Note, however, that:

  • String contents are not guaranteed to start at index 0 (rather, call getStringOffset) to know the actual offset
  • Length of string contents may be less than the length of returned buffer: call getStringLength for actual length of returned content.

Note that caller MUST NOT modify the returned character array in any way -- doing so may corrupt current parser state and render parser instance useless.

The only reason to call this method (over getString()) is to avoid construction of a String object (which will make a copy of contents).

Annotations
@Override
getStringLengthback to summary
public int getStringLength() throws JacksonException

Implements abstract tools.jackson.core.JsonParser.getStringLength.

Doc from tools.jackson.core.JsonParser.getStringLength.

Accessor used with getStringCharacters, to know length of String stored in returned buffer.

Annotations
@Override
getStringOffsetback to summary
public int getStringOffset() throws JacksonException

Implements abstract tools.jackson.core.JsonParser.getStringOffset.

Doc from tools.jackson.core.JsonParser.getStringOffset.

Accessor used with getStringCharacters, to know offset of the first text content character within buffer.

Annotations
@Override
getTypeIdback to summary
public String getTypeId() throws JacksonException

Overrides tools.jackson.core.JsonParser.getTypeId.

Doc from tools.jackson.core.JsonParser.getTypeId.

Method that can be called to check whether current token (one that was just read) has an associated type id, and if so, return it. Note that while typically caller should check with canReadTypeId first, it is not illegal to call this method even if that method returns true; but if so, it will return null. This may be used to simplify calling code.

Default implementation will simply return null.

Annotations
@Override
hasStringCharactersback to summary
public boolean hasStringCharacters()

Overrides tools.jackson.core.base.ParserBase.hasStringCharacters.

Doc from tools.jackson.core.JsonParser.hasStringCharacters.

Method that can be used to determine whether calling of getStringCharacters would be the most efficient way to access String value for the event parser currently points to (compared to getString()).

Annotations
@Override
isCurrentAliasback to summary
public boolean isCurrentAlias()

Method that can be used to check whether current token was created from YAML Alias token (reference to an anchor).

isEnabledback to summary
public boolean isEnabled(YAMLReadFeature f)

Method for checking whether specified YAMLReadFeature is enabled.

nextEventback to summary
protected Event nextEvent()
nextTokenback to summary
public JsonToken nextToken() throws JacksonException

Implements abstract tools.jackson.core.JsonParser.nextToken.

Doc from tools.jackson.core.JsonParser.nextToken.

Main iteration method, which will advance stream enough to determine type of the next token, if any. If none remaining (stream has no content other than possible white space before ending), null will be returned.

Annotations
@Override
Exceptions
JacksonException:
for low-level read issues
readBinaryValueback to summary
public int readBinaryValue(Base64Variant b64variant, OutputStream out) throws JacksonException

Overrides tools.jackson.core.JsonParser.readBinaryValue.

Doc from tools.jackson.core.JsonParser.readBinaryValue.

Similar to readBinaryValue(OutputStream) but allows explicitly specifying base64 variant to use.

Annotations
@Override
streamReadCapabilitiesback to summary
public JacksonFeatureSet<StreamReadCapability> streamReadCapabilities()

Overrides tools.jackson.core.base.ParserMinimalBase.streamReadCapabilities.

Doc from tools.jackson.core.JsonParser.streamReadCapabilities.

Accessor for getting metadata on capabilities of this parser, based on underlying data format being read (directly or indirectly).

Annotations
@Override
streamReadContextback to summary
public TokenStreamContext streamReadContext()

Implements abstract tools.jackson.core.JsonParser.streamReadContext.

Doc from tools.jackson.core.JsonParser.streamReadContext.

Method that can be used to access current parsing context reader is in. There are 3 different types: root, array and object contexts, with slightly different available information. Contexts are hierarchically nested, and can be used for example for figuring out part of the input document that correspond to specific array or object (for highlighting purposes, or error reporting). Contexts can also be used for simple xpath-like matching of input, if so desired.

Note

method was called getParsingContext() in Jackson 2.x

Annotations
@Override
streamReadInputSourceback to summary
public Reader streamReadInputSource()

Implements abstract tools.jackson.core.JsonParser.streamReadInputSource.

Doc from tools.jackson.core.JsonParser.streamReadInputSource.

Method that can be used to get access to object that is used to access input being parsed; this is usually either InputStream or Reader, depending on what parser was constructed with. Note that returned value may be null in some cases; including case where parser implementation does not want to exposed raw source to caller. In cases where input has been decorated, object returned here is the decorated version; this allows some level of interaction between users of parser and decorator object.

In general use of this accessor should be considered as "last effort", i.e. only used if no other mechanism is applicable.

Note

was named getInputSource() in Jackson 2.x.

Annotations
@Override
versionback to summary
public Version version()

Implements abstract tools.jackson.core.JsonParser.version.

Implements tools.jackson.core.Versioned.version.

Doc from tools.jackson.core.JsonParser.version.

Accessor for getting version of the core package, given a parser instance. Left for sub-classes to implement.

Annotations
@Override