Top Description Inners Fields Constructors Methods
com.fasterxml.jackson.dataformat.avro

public abstract Class AvroParser

extends ParserBase
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.dataformat.avro.deser.AvroParserImpl
Imports
java.io.IOException, .Writer, com.fasterxml.jackson.core.*, com.fasterxml.jackson.core.base.ParserBase, com.fasterxml.jackson.core.io.IOContext, com.fasterxml.jackson.core.json.JsonReadContext, com.fasterxml.jackson.core.util.ByteArrayBuilder, .JacksonFeatureSet, com.fasterxml.jackson.dataformat.avro.deser.AvroReadContext, .MissingReader

JsonParser implementation for decoding Avro content and exposing at as a stream of JsonTokens, to be used for data binding.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
AvroParser.Feature

Enumeration that defines all togglable features for Avro parsers.

Field Summary

Modifier and TypeField and Description
protected AvroReadContext
protected int
protected ObjectCodec
_objectCodec

Codec used for data binding when (if) requested.

protected AvroSchema
protected static final JacksonFeatureSet<StreamReadCapability>
Inherited from com.fasterxml.jackson.core.base.ParserBase:
_binaryValue_byteArrayBuilder_closed_currInputProcessed_currInputRow_currInputRowStart_expLength_fractLength_inputEnd_inputPtr_intLength_ioContext_nameCopied_nameCopyBuffer_nextToken_numberBigDecimal_numberBigInt_numberDouble_numberFloat_numberInt_numberLong_numberNegative_numberString_numTypesValid_parsingContext_streamReadConstraints_textBuffer_tokenInputCol_tokenInputRow_tokenInputTotalJSON_READ_CAPABILITIES

Constructor Summary

AccessConstructor and Description
protected
AvroParser(IOContext ctxt, int parserFeatures, int avroFeatures, ObjectCodec codec)

Method Summary

Modifier and TypeMethod and Description
protected abstract void
protected void
protected abstract void
public boolean
canReadTypeId()

Overrides com.fasterxml.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 boolean
canUseSchema(FormatSchema
Schema to check
schema
)

Overrides com.fasterxml.jackson.core.JsonParser.canUseSchema.

Method that can be used to verify that given schema can be used with this parser (using setSchema).

public JsonParser
configure(AvroParser.Feature f, boolean state)

Method for enabling or disabling specified Avro feature (check Feature for list of features)

public JsonLocation
currentLocation()

Overrides com.fasterxml.jackson.core.JsonParser.currentLocation.

Method that returns location of the last processed input unit (character or byte) from the input; usually for error reporting purposes.

public String
currentName()

Overrides com.fasterxml.jackson.core.JsonParser.currentName.

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

public JsonLocation
currentTokenLocation()

Overrides com.fasterxml.jackson.core.JsonParser.currentTokenLocation.

Method that return the starting location of the current (most recently returned) token; that is, the position of the first input unit (character or byte) from input that starts the current token.

public JsonParser
disable(AvroParser.Feature f)

Method for disabling specified Avro feature (check Feature for list of features)

public JsonParser
enable(AvroParser.Feature f)

Method for enabling specified Avro feature (check Feature for list of features)

public byte[]
getBinaryValue(Base64Variant
Expected variant of base64 encoded content (see Base64Variants for definitions of "standard" variants).
variant
)

Overrides com.fasterxml.jackson.core.base.ParserBase.getBinaryValue.

Method that can be used to read (and consume -- results may not be accessible using other methods after the call) base64-encoded binary data included in the current textual JSON value.

public ObjectCodec
getCodec()

Implements abstract com.fasterxml.jackson.core.JsonParser.getCodec.

Accessor for ObjectCodec associated with this parser, if any.

public JsonLocation
getCurrentLocation()

Overrides com.fasterxml.jackson.core.base.ParserBase.getCurrentLocation.

Deprecated

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

public String
getCurrentName()

Overrides com.fasterxml.jackson.core.base.ParserBase.getCurrentName.

Deprecated

Method that can be called to get the name associated with the current event.

public Object
getEmbeddedObject()

Overrides com.fasterxml.jackson.core.JsonParser.getEmbeddedObject.

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

public abstract Object
getInputSource()

Overrides com.fasterxml.jackson.core.JsonParser.getInputSource.

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 JacksonFeatureSet<StreamReadCapability>
getReadCapabilities()

Overrides com.fasterxml.jackson.core.JsonParser.getReadCapabilities.

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

public AvroSchema
getSchema()

Overrides com.fasterxml.jackson.core.JsonParser.getSchema.

Method for accessing Schema that this parser uses, if any.

public abstract String
getText()

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.getText.

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 abstract int
getText(Writer
Writer to write textual content to
writer
)

Overrides com.fasterxml.jackson.core.JsonParser.getText.

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

public char[]
getTextCharacters()

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.getTextCharacters.

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

public int
getTextLength()

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.getTextLength.

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

public int
getTextOffset()

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.getTextOffset.

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

public JsonLocation
getTokenLocation()

Overrides com.fasterxml.jackson.core.base.ParserBase.getTokenLocation.

Deprecated

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
getTypeId()

Overrides com.fasterxml.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 abstract boolean
hasTextCharacters()

Overrides com.fasterxml.jackson.core.base.ParserBase.hasTextCharacters.

Method that can be used to determine whether calling of getTextCharacters would be the most efficient way to access textual content for the event parser currently points to.

public boolean
isEnabled(AvroParser.Feature f)

Method for checking whether specified Avro Feature is enabled.

public abstract JsonToken
nextToken()

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.nextToken.

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

public void
overrideCurrentName(String
Name to use as the current name; may be null.
name
)

Overrides com.fasterxml.jackson.core.base.ParserBase.overrideCurrentName.

Method that can be used to change what is considered to be the current (field) name.

public abstract JsonParser
overrideFormatFeatures(int
Bit mask of set/clear state for features to change
values
,
int
Bit mask of features to change
mask
)

Overrides com.fasterxml.jackson.core.JsonParser.overrideFormatFeatures.

Bulk set method for (re)setting states of FormatFeatures, by specifying values (set / clear) along with a mask, to determine which features to change, if any.

public void
setCodec(ObjectCodec
Codec to assign, if any; null if none
c
)

Implements abstract com.fasterxml.jackson.core.JsonParser.setCodec.

Setter that allows defining ObjectCodec associated with this parser, if any.

public void
setSchema(FormatSchema
Schema to use
schema
)

Overrides com.fasterxml.jackson.core.JsonParser.setSchema.

Method to call to make this parser use specified schema.

public Version
version()

Overrides com.fasterxml.jackson.core.base.ParserBase.version.

Implements com.fasterxml.jackson.core.Versioned.version.

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

Inherited from com.fasterxml.jackson.core.base.ParserBase:
_checkStdFeatureChanges_contentReference_contentReferenceRedacted_convertBigDecimalToBigInteger_decodeBase64Escape_decodeBase64Escape_decodeEscaped_eofAsNextChar_getBigDecimal_getBigInteger_getByteArrayBuilder_getNumberDouble_getNumberFloat_getSourceReference_growNameDecodeBuffer_handleBase64MissingPadding_handleEOF_handleUnrecognizedCharacterEscape_parseIntValue_parseNumericValue_releaseBuffers_reportMismatchedEndMarker_reportTooLongIntegral_throwUnquotedSpace_validJsonTokenList_validJsonValueListcloseconvertNumberToBigDecimalconvertNumberToBigIntegerconvertNumberToDoubleconvertNumberToFloatconvertNumberToIntconvertNumberToLongcreateChildArrayContextcreateChildObjectContextdisableenablegetBigIntegerValuegetCurrentValuegetDecimalValuegetDoubleValuegetFloatValuegetIntValuegetLongValuegetNumberTypegetNumberValuegetNumberValueDeferredgetNumberValueExactgetParsingContextgetTokenCharacterOffsetgetTokenColumnNrgetTokenLineNrgrowArrayByisClosedisNaNloadMoreloadMoreGuaranteedoverrideStdFeaturesreportInvalidBase64CharreportInvalidBase64CharresetresetAsNaNresetFloatresetIntsetCurrentValuesetFeatureMaskstreamReadConstraints

Field Detail

_avroContextback to summary
protected AvroReadContext _avroContext
_formatFeaturesback to summary
protected int _formatFeatures
_objectCodecback to summary
protected ObjectCodec _objectCodec

Codec used for data binding when (if) requested.

_rootSchemaback to summary
protected AvroSchema _rootSchema
AVRO_READ_CAPABILITIESback to summary
protected static final JacksonFeatureSet<StreamReadCapability> AVRO_READ_CAPABILITIES

Constructor Detail

AvroParserback to summary
protected AvroParser(IOContext ctxt, int parserFeatures, int avroFeatures, ObjectCodec codec)

Method Detail

_closeInputback to summary
protected abstract void _closeInput() throws IOException

Implements abstract com.fasterxml.jackson.core.base.ParserBase._closeInput.

Annotations
@Override
_finishStringback to summary
protected void _finishString() throws IOException

Overrides com.fasterxml.jackson.core.base.ParserBase._finishString.

Annotations
@Override
_initSchemaback to summary
protected abstract void _initSchema(AvroSchema schema) throws IOException
canReadTypeIdback to summary
public boolean canReadTypeId()

Overrides com.fasterxml.jackson.core.JsonParser.canReadTypeId.

Doc from com.fasterxml.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 can not use native type ids.

Returns:boolean

True if the format being read supports native Type Ids; false if not

Annotations
@Override
canUseSchemaback to summary
public boolean canUseSchema(FormatSchema schema)

Overrides com.fasterxml.jackson.core.JsonParser.canUseSchema.

Doc from com.fasterxml.jackson.core.JsonParser.canUseSchema.

Method that can be used to verify that given schema can be used with this parser (using setSchema).

Parameters
schema:FormatSchema

Schema to check

Returns:boolean

True if this parser can use given schema; false if not

Annotations
@Override
configureback to summary
public JsonParser configure(AvroParser.Feature f, boolean state)

Method for enabling or disabling specified Avro feature (check Feature for list of features)

currentLocationback to summary
public JsonLocation currentLocation()

Overrides com.fasterxml.jackson.core.JsonParser.currentLocation.

Doc from com.fasterxml.jackson.core.JsonParser.currentLocation.

Method that returns location of the last processed input unit (character or byte) from the input; 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 JsonLocation#NA due to not having access to input location information (when delegating actual decoding work to other library)

Returns:JsonLocation

Location of the last processed input unit (byte or character)

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

Overrides com.fasterxml.jackson.core.JsonParser.currentName.

Doc from com.fasterxml.jackson.core.JsonParser.currentName.

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

Returns:String

Name of the current field in the parsing context

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems
currentTokenLocationback to summary
public JsonLocation currentTokenLocation()

Overrides com.fasterxml.jackson.core.JsonParser.currentTokenLocation.

Doc from com.fasterxml.jackson.core.JsonParser.currentTokenLocation.

Method that return the starting location of the current (most recently returned) token; that is, the position of the first input unit (character or byte) 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 JsonLocation#NA due to not having access to input location information (when delegating actual decoding work to other library)

Returns:JsonLocation

Starting location of the token parser currently points to

Annotations
@Override
disableback to summary
public JsonParser disable(AvroParser.Feature f)

Method for disabling specified Avro feature (check Feature for list of features)

enableback to summary
public JsonParser enable(AvroParser.Feature f)

Method for enabling specified Avro feature (check Feature for list of features)

getBinaryValueback to summary
public byte[] getBinaryValue(Base64Variant variant) throws IOException

Overrides com.fasterxml.jackson.core.base.ParserBase.getBinaryValue.

Doc from com.fasterxml.jackson.core.JsonParser.getBinaryValue.

Method that can be used to read (and consume -- results may not be accessible using other methods after the call) base64-encoded binary data included in the current textual JSON value. It works similar to getting String value via getText and decoding result (except for decoding part), but should be significantly more performant.

Note that non-decoded textual contents of the current token are not guaranteed to be accessible after this method is called. Current implementation, for example, clears up textual content during decoding. Decoded binary content, however, will be retained until parser is advanced to the next event.

Parameters
variant:Base64Variant

Expected variant of base64 encoded content (see Base64Variants for definitions of "standard" variants).

Returns:byte[]

Decoded binary data

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems
getCodecback to summary
public ObjectCodec getCodec()

Implements abstract com.fasterxml.jackson.core.JsonParser.getCodec.

Doc from com.fasterxml.jackson.core.JsonParser.getCodec.

Accessor for ObjectCodec associated with this parser, if any. Codec is used by readValueAs(Class) method (and its variants).

Returns:ObjectCodec

Codec assigned to this parser, if any; null if none

Annotations
@Override
getCurrentLocationback to summary
public JsonLocation getCurrentLocation()

Overrides com.fasterxml.jackson.core.base.ParserBase.getCurrentLocation.

Doc from com.fasterxml.jackson.core.base.ParserBase.getCurrentLocation.

Deprecated

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

Returns:JsonLocation

Doc from com.fasterxml.jackson.core.JsonParser.getCurrentLocation.

Location of the last processed input unit (byte or character)

Annotations
@Deprecated
@Override
getCurrentNameback to summary
public String getCurrentName() throws IOException

Overrides com.fasterxml.jackson.core.base.ParserBase.getCurrentName.

Doc from com.fasterxml.jackson.core.base.ParserBase.getCurrentName.

Deprecated

Method that can be called to get the name associated with the current event.

Returns:String

Doc from com.fasterxml.jackson.core.JsonParser.getCurrentName.

Name of the current field in the parsing context

Annotations
@Deprecated
@Override
Exceptions
IOException:

Doc from com.fasterxml.jackson.core.JsonParser.getCurrentName.

for low-level read issues, or JsonParseException for decoding problems

getEmbeddedObjectback to summary
public Object getEmbeddedObject() throws IOException

Overrides com.fasterxml.jackson.core.JsonParser.getEmbeddedObject.

Doc from com.fasterxml.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().

Returns:Object

Embedded value (usually of "native" type supported by format) for the current token, if any; null otherwise

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems
getInputSourceback to summary
public abstract Object getInputSource()

Overrides com.fasterxml.jackson.core.JsonParser.getInputSource.

Doc from com.fasterxml.jackson.core.JsonParser.getInputSource.

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.

Returns:Object

Input source this parser was configured with

Annotations
@Override
getReadCapabilitiesback to summary
public JacksonFeatureSet<StreamReadCapability> getReadCapabilities()

Overrides com.fasterxml.jackson.core.JsonParser.getReadCapabilities.

Doc from com.fasterxml.jackson.core.JsonParser.getReadCapabilities.

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

Returns:JacksonFeatureSet<StreamReadCapability>

Set of read capabilities for content to read via this parser

Annotations
@Override
getSchemaback to summary
public AvroSchema getSchema()

Overrides com.fasterxml.jackson.core.JsonParser.getSchema.

Doc from com.fasterxml.jackson.core.JsonParser.getSchema.

Method for accessing Schema that this parser uses, if any. Default implementation returns null.

Returns:AvroSchema

Schema in use by this parser, if any; null if none

Annotations
@Override
getTextback to summary
public abstract String getText() throws IOException

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.getText.

Doc from com.fasterxml.jackson.core.JsonParser.getText.

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.

Returns:String

Textual value associated with the current token (one returned by nextToken() or other iteration methods)

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems, including if the text is too large, see com.fasterxml.jackson.core.StreamReadConstraints.Builder#maxStringLength(int)
getTextback to summary
public abstract int getText(Writer writer) throws IOException

Overrides com.fasterxml.jackson.core.JsonParser.getText.

Doc from com.fasterxml.jackson.core.JsonParser.getText.

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

  writer.write(parser.getText());
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

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

Parameters
writer:Writer

Writer to write textual content to

Returns:int

The number of characters written to the Writer

Annotations
@Override
Exceptions
IOException:
for low-level read issues or writes using passed writer, or JsonParseException for decoding problems
getTextCharactersback to summary
public char[] getTextCharacters() throws IOException

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.getTextCharacters.

Doc from com.fasterxml.jackson.core.JsonParser.getTextCharacters.

Method similar to getText, 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:

  • Textual contents are not guaranteed to start at index 0 (rather, call getTextOffset) to know the actual offset
  • Length of textual contents may be less than the length of returned buffer: call getTextLength 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 getText) is to avoid construction of a String object (which will make a copy of contents).

Returns:char[]

Buffer that contains the current textual value (but not necessarily at offset 0, and not necessarily until the end of buffer)

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems, including if the text is too large, see com.fasterxml.jackson.core.StreamReadConstraints.Builder#maxStringLength(int)
getTextLengthback to summary
public int getTextLength() throws IOException

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.getTextLength.

Doc from com.fasterxml.jackson.core.JsonParser.getTextLength.

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

Returns:int

Number of characters within buffer returned by getTextCharacters that are part of textual content of the current token.

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems
getTextOffsetback to summary
public int getTextOffset() throws IOException

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.getTextOffset.

Doc from com.fasterxml.jackson.core.JsonParser.getTextOffset.

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

Returns:int

Offset of the first character within buffer returned by getTextCharacters that is part of textual content of the current token.

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems
getTokenLocationback to summary
public JsonLocation getTokenLocation()

Overrides com.fasterxml.jackson.core.base.ParserBase.getTokenLocation.

Doc from com.fasterxml.jackson.core.base.ParserBase.getTokenLocation.

Deprecated

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

Returns:JsonLocation

Doc from com.fasterxml.jackson.core.JsonParser.getTokenLocation.

Starting location of the token parser currently points to

Annotations
@Deprecated
@Override
getTypeIdback to summary
public Object getTypeId() throws IOException

Overrides com.fasterxml.jackson.core.JsonParser.getTypeId.

Doc from com.fasterxml.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.

Returns:Object

Native Type Id associated with the current token, if any; null if none

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems
hasTextCharactersback to summary
public abstract boolean hasTextCharacters()

Overrides com.fasterxml.jackson.core.base.ParserBase.hasTextCharacters.

Doc from com.fasterxml.jackson.core.JsonParser.hasTextCharacters.

Method that can be used to determine whether calling of getTextCharacters would be the most efficient way to access textual content for the event parser currently points to.

Default implementation simply returns false since only actual implementation class has knowledge of its internal buffering state. Implementations are strongly encouraged to properly override this method, to allow efficient copying of content by other code.

Returns:boolean

True if parser currently has character array that can be efficiently returned via getTextCharacters; false means that it may or may not exist

Annotations
@Override
isEnabledback to summary
public boolean isEnabled(AvroParser.Feature f)

Method for checking whether specified Avro Feature is enabled.

nextTokenback to summary
public abstract JsonToken nextToken() throws IOException

Implements abstract com.fasterxml.jackson.core.base.ParserMinimalBase.nextToken.

Doc from com.fasterxml.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.

Returns:JsonToken

Next token from the stream, if any found, or null to indicate end-of-input

Annotations
@Override
Exceptions
IOException:
for low-level read issues, or JsonParseException for decoding problems
overrideCurrentNameback to summary
public void overrideCurrentName(String name)

Overrides com.fasterxml.jackson.core.base.ParserBase.overrideCurrentName.

Doc from com.fasterxml.jackson.core.JsonParser.overrideCurrentName.

Method that can be used to change what is considered to be the current (field) name. May be needed to support non-JSON data formats or unusual binding conventions; not needed for typical processing.

Note that use of this method should only be done as sort of last resort, as it is a work-around for regular operation.

Parameters
name:String

Name to use as the current name; may be null.

Annotations
@Override
overrideFormatFeaturesback to summary
public abstract JsonParser overrideFormatFeatures(int values, int mask)

Overrides com.fasterxml.jackson.core.JsonParser.overrideFormatFeatures.

Doc from com.fasterxml.jackson.core.JsonParser.overrideFormatFeatures.

Bulk set method for (re)setting states of FormatFeatures, by specifying values (set / clear) along with a mask, to determine which features to change, if any.

Default implementation will simply throw an exception to indicate that the parser implementation does not support any FormatFeatures.

Parameters
values:int

Bit mask of set/clear state for features to change

mask:int

Bit mask of features to change

Returns:JsonParser

This parser, to allow call chaining

Annotations
@Override
setCodecback to summary
public void setCodec(ObjectCodec c)

Implements abstract com.fasterxml.jackson.core.JsonParser.setCodec.

Doc from com.fasterxml.jackson.core.JsonParser.setCodec.

Setter that allows defining ObjectCodec associated with this parser, if any. Codec is used by readValueAs(Class) method (and its variants).

Parameters
c:ObjectCodec

Codec to assign, if any; null if none

Annotations
@Override
setSchemaback to summary
public void setSchema(FormatSchema schema)

Overrides com.fasterxml.jackson.core.JsonParser.setSchema.

Doc from com.fasterxml.jackson.core.JsonParser.setSchema.

Method to call to make this parser use specified schema. Method must be called before trying to parse any content, right after parser instance has been created. Note that not all parsers support schemas; and those that do usually only accept specific types of schemas: ones defined for data format parser can read.

If parser does not support specified schema, UnsupportedOperationException is thrown.

Parameters
schema:FormatSchema

Schema to use

Annotations
@Override
versionback to summary
public Version version()

Overrides com.fasterxml.jackson.core.base.ParserBase.version.

Implements com.fasterxml.jackson.core.Versioned.version.

Doc from com.fasterxml.jackson.core.JsonParser.version.

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

Returns:Version

Version of this generator (derived from version declared for jackson-core jar that contains the class

Annotations
@Override
com.fasterxml.jackson.dataformat.avro back to summary

public final Enum AvroParser.Feature

extends Enum<AvroParser.Feature>
implements FormatFeature
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.core.FormatFeature, com.fasterxml.jackson.core.util.JacksonFeature

Enumeration that defines all togglable features for Avro parsers.

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv final int
public static final AvroParser.Feature
AVRO_BUFFERING

Feature that can be disabled to prevent Avro from buffering any more data then absolutely necessary.

Constructor Summary

AccessConstructor and Description
private
Feature(boolean defaultState)

Method Summary

Modifier and TypeMethod and Description
public static int
collectDefaults()

Method that calculates bit set (flags) of all features that are enabled by default.

public boolean
enabledByDefault()

Implements com.fasterxml.jackson.core.FormatFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

public boolean
enabledIn(int
Bit field that contains a set of enabled features of this type
flags
)

Implements com.fasterxml.jackson.core.FormatFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask

public int
getMask()

Implements com.fasterxml.jackson.core.FormatFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form (1 << N)

public static AvroParser.Feature
public static AvroParser.Feature[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

_defaultStateback to summary
pack-priv final boolean _defaultState
_maskback to summary
pack-priv final int _mask
AVRO_BUFFERINGback to summary
public static final AvroParser.Feature AVRO_BUFFERING

Feature that can be disabled to prevent Avro from buffering any more data then absolutely necessary. This affects buffering by underlying `SnakeYAML` codec.

Enabled by default to preserve the existing behavior.

Since
2.7

Constructor Detail

Featureback to summary
private Feature(boolean defaultState)

Method Detail

collectDefaultsback to summary
public static int collectDefaults()

Method that calculates bit set (flags) of all features that are enabled by default.

enabledByDefaultback to summary
public boolean enabledByDefault()

Implements com.fasterxml.jackson.core.FormatFeature.enabledByDefault.

Doc from com.fasterxml.jackson.core.FormatFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

Returns:boolean

Doc from com.fasterxml.jackson.core.util.JacksonFeature.enabledByDefault.

Whether this instance is enabled by default or not

Annotations
@Override
enabledInback to summary
public boolean enabledIn(int flags)

Implements com.fasterxml.jackson.core.FormatFeature.enabledIn.

Doc from com.fasterxml.jackson.core.FormatFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask

Parameters
flags:int

Doc from com.fasterxml.jackson.core.util.JacksonFeature.enabledIn.

Bit field that contains a set of enabled features of this type

Returns:boolean

Doc from com.fasterxml.jackson.core.util.JacksonFeature.enabledIn.

True if this feature is enabled in passed bit field

Annotations
@Override
getMaskback to summary
public int getMask()

Implements com.fasterxml.jackson.core.FormatFeature.getMask.

Doc from com.fasterxml.jackson.core.FormatFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form (1 << N)

Returns:int

Doc from com.fasterxml.jackson.core.util.JacksonFeature.getMask.

Bit mask of this feature

Annotations
@Override
valueOfback to summary
public static AvroParser.Feature valueOf(String name)
valuesback to summary
public static AvroParser.Feature[] values()