public class AvroFactory
extends com.fasterxml.jackson.core.JsonFactory
JsonFactory
implementation for encoding/decoding Avro
content, uses native Jackson encoder/decoder.ApacheAvroFactory
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected int |
_avroGeneratorFeatures |
protected int |
_avroParserFeatures |
protected boolean |
_useApacheLibDecoder
Flag that is set if Apache Avro lib's decoder is to be used for decoding;
`false` to use Jackson native Avro decoder.
|
static String |
FORMAT_NAME_AVRO |
_byteSymbolCanonicalizer, _characterEscapes, _factoryFeatures, _generatorFeatures, _inputDecorator, _maximumNonEscapedChar, _objectCodec, _outputDecorator, _parserFeatures, _quoteChar, _rootCharSymbols, _rootValueSeparator, DEFAULT_FACTORY_FEATURE_FLAGS, DEFAULT_GENERATOR_FEATURE_FLAGS, DEFAULT_PARSER_FEATURE_FLAGS, DEFAULT_QUOTE_CHAR, DEFAULT_ROOT_VALUE_SEPARATOR, FORMAT_NAME_JSON
Modifier | Constructor and Description |
---|---|
|
AvroFactory()
Default constructor used to create factory instances.
|
protected |
AvroFactory(AvroFactoryBuilder b)
Constructors used by
AvroFactoryBuilder for instantiation. |
protected |
AvroFactory(AvroFactory src,
com.fasterxml.jackson.core.ObjectCodec oc) |
|
AvroFactory(com.fasterxml.jackson.core.ObjectCodec oc) |
Modifier and Type | Method and Description |
---|---|
protected AvroGenerator |
_createGenerator(OutputStream out,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected com.fasterxml.jackson.core.JsonGenerator |
_createGenerator(Writer out,
com.fasterxml.jackson.core.io.IOContext ctxt)
Overridable factory method that actually instantiates desired
generator.
|
protected AvroParser |
_createParser(byte[] data,
int offset,
int len,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected com.fasterxml.jackson.core.JsonParser |
_createParser(char[] data,
int offset,
int len,
com.fasterxml.jackson.core.io.IOContext ctxt,
boolean recyclable) |
protected AvroParser |
_createParser(InputStream in,
com.fasterxml.jackson.core.io.IOContext ctxt)
Overridable factory method that actually instantiates desired
parser.
|
protected com.fasterxml.jackson.core.JsonParser |
_createParser(Reader r,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected Writer |
_createWriter(OutputStream out,
com.fasterxml.jackson.core.JsonEncoding enc,
com.fasterxml.jackson.core.io.IOContext ctxt) |
protected <T> T |
_nonByteSource() |
protected <T> T |
_nonByteTarget() |
static AvroFactoryBuilder |
builder()
Main factory method to use for constructing a builder for creating
AvroFactory instances with different configuration. |
static AvroFactoryBuilder |
builderWithApacheDecoder()
Main factory method to use for constructing a builder for creating
AvroFactory instances with different configuration,
initialized to use Apache Avro library codec for decoding content
(instead of Jackson native decoder). |
static AvroFactoryBuilder |
builderWithNativeDecoder()
Main factory method to use for constructing a builder for creating
AvroFactory instances with different configuration,
initialized to use Jackson antive codec for decoding content
(instead of Apache Avro library decoder). |
boolean |
canHandleBinaryNatively() |
boolean |
canUseSchema(com.fasterxml.jackson.core.FormatSchema schema) |
AvroFactory |
configure(AvroGenerator.Feature f,
boolean state)
Method for enabling or disabling specified generator feature
(check
AvroGenerator.Feature for list of features) |
AvroFactory |
configure(AvroParser.Feature f,
boolean state)
Method for enabling or disabling specified parser feature
(check
AvroParser.Feature for list of features) |
AvroFactory |
copy() |
AvroGenerator |
createGenerator(OutputStream out)
Since Avro format always uses UTF-8 internally, no encoding need
to be passed to this method.
|
AvroGenerator |
createGenerator(OutputStream out,
com.fasterxml.jackson.core.JsonEncoding enc)
note: co-variant return type
|
AvroParser |
createParser(byte[] data) |
AvroParser |
createParser(byte[] data,
int offset,
int len) |
AvroParser |
createParser(File f) |
AvroParser |
createParser(InputStream in) |
AvroParser |
createParser(URL url) |
AvroFactory |
disable(AvroGenerator.Feature f)
Method for disabling specified generator feature
(check
AvroGenerator.Feature for list of features) |
AvroFactory |
disable(AvroParser.Feature f)
Method for disabling specified parser features
(check
AvroParser.Feature for list of features) |
AvroFactory |
enable(AvroGenerator.Feature f)
Method for enabling specified generator features
(check
AvroGenerator.Feature for list of features) |
AvroFactory |
enable(AvroParser.Feature f)
Method for enabling specified parser feature
(check
AvroParser.Feature for list of features) |
int |
getFormatGeneratorFeatures() |
String |
getFormatName() |
int |
getFormatParserFeatures() |
com.fasterxml.jackson.core.format.MatchStrength |
hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)
Sub-classes need to override this method
|
boolean |
isEnabled(AvroGenerator.Feature f)
Check whether specified generator feature is enabled.
|
boolean |
isEnabled(AvroParser.Feature f)
Checked whether specified parser feature is enabled.
|
protected Object |
readResolve()
Method that we need to override to actually make restoration go
through constructors etc.
|
AvroFactoryBuilder |
rebuild() |
boolean |
requiresPropertyOrdering() |
com.fasterxml.jackson.core.Version |
version() |
_checkInvalidCopy, _createContentReference, _createContentReference, _createContext, _createContext, _createNonBlockingContext, _createParser, _createUTF8Generator, _decorate, _decorate, _decorate, _decorate, _decorate, _getBufferRecycler, canParseAsync, canUseCharArrays, configure, configure, configure, createGenerator, createGenerator, createGenerator, createGenerator, createJsonGenerator, createJsonGenerator, createJsonGenerator, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createNonBlockingByteArrayParser, createNonBlockingByteBufferParser, createParser, createParser, createParser, createParser, createParser, disable, disable, disable, enable, enable, enable, getCharacterEscapes, getCodec, getFormatReadFeatureType, getFormatWriteFeatureType, getGeneratorFeatures, getInputDecorator, getOutputDecorator, getParserFeatures, getRootValueSeparator, hasJSONFormat, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, requiresCustomCodec, setCharacterEscapes, setCodec, setInputDecorator, setOutputDecorator, setRootValueSeparator
public static final String FORMAT_NAME_AVRO
protected int _avroParserFeatures
protected int _avroGeneratorFeatures
protected boolean _useApacheLibDecoder
public AvroFactory()
public AvroFactory(com.fasterxml.jackson.core.ObjectCodec oc)
protected AvroFactory(AvroFactory src, com.fasterxml.jackson.core.ObjectCodec oc)
protected AvroFactory(AvroFactoryBuilder b)
AvroFactoryBuilder
for instantiation.public AvroFactoryBuilder rebuild()
rebuild
in class com.fasterxml.jackson.core.JsonFactory
public static AvroFactoryBuilder builder()
AvroFactory
instances with different configuration.
Builder is initialized to defaults and this is equivalent to calling
builderWithNativeDecoder()
.public static AvroFactoryBuilder builderWithApacheDecoder()
AvroFactory
instances with different configuration,
initialized to use Apache Avro library codec for decoding content
(instead of Jackson native decoder).public static AvroFactoryBuilder builderWithNativeDecoder()
AvroFactory
instances with different configuration,
initialized to use Jackson antive codec for decoding content
(instead of Apache Avro library decoder).public AvroFactory copy()
copy
in class com.fasterxml.jackson.core.JsonFactory
public boolean requiresPropertyOrdering()
requiresPropertyOrdering
in class com.fasterxml.jackson.core.JsonFactory
public boolean canHandleBinaryNatively()
canHandleBinaryNatively
in class com.fasterxml.jackson.core.JsonFactory
protected Object readResolve()
readResolve
in class com.fasterxml.jackson.core.JsonFactory
public com.fasterxml.jackson.core.Version version()
version
in interface com.fasterxml.jackson.core.Versioned
version
in class com.fasterxml.jackson.core.JsonFactory
public String getFormatName()
getFormatName
in class com.fasterxml.jackson.core.JsonFactory
public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)
canUseSchema
in class com.fasterxml.jackson.core.JsonFactory
public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc) throws IOException
hasFormat
in class com.fasterxml.jackson.core.JsonFactory
IOException
public final AvroFactory configure(AvroParser.Feature f, boolean state)
AvroParser.Feature
for list of features)public AvroFactory enable(AvroParser.Feature f)
AvroParser.Feature
for list of features)public AvroFactory disable(AvroParser.Feature f)
AvroParser.Feature
for list of features)public final boolean isEnabled(AvroParser.Feature f)
public int getFormatParserFeatures()
getFormatParserFeatures
in class com.fasterxml.jackson.core.JsonFactory
public final AvroFactory configure(AvroGenerator.Feature f, boolean state)
AvroGenerator.Feature
for list of features)public AvroFactory enable(AvroGenerator.Feature f)
AvroGenerator.Feature
for list of features)public AvroFactory disable(AvroGenerator.Feature f)
AvroGenerator.Feature
for list of features)public final boolean isEnabled(AvroGenerator.Feature f)
public int getFormatGeneratorFeatures()
getFormatGeneratorFeatures
in class com.fasterxml.jackson.core.JsonFactory
public AvroParser createParser(File f) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public AvroParser createParser(URL url) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public AvroParser createParser(InputStream in) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public AvroParser createParser(byte[] data) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public AvroParser createParser(byte[] data, int offset, int len) throws IOException
createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
public AvroGenerator createGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException
note: co-variant return type
createGenerator
in class com.fasterxml.jackson.core.JsonFactory
IOException
public AvroGenerator createGenerator(OutputStream out) throws IOException
createGenerator
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected AvroParser _createParser(InputStream in, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected com.fasterxml.jackson.core.JsonParser _createParser(Reader r, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected com.fasterxml.jackson.core.JsonParser _createParser(char[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt, boolean recyclable) throws IOException
_createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected AvroParser _createParser(byte[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createParser
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected com.fasterxml.jackson.core.JsonGenerator _createGenerator(Writer out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createGenerator
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected Writer _createWriter(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
_createWriter
in class com.fasterxml.jackson.core.JsonFactory
IOException
protected AvroGenerator _createGenerator(OutputStream out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException
IOException
protected <T> T _nonByteSource() throws IOException
IOException
protected <T> T _nonByteTarget() throws IOException
IOException
Copyright © 2022 FasterXML. All rights reserved.