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

public abstract Class AvroReaderFactory

extends Object
Class Inheritance
Known Direct Subclasses
com.fasterxml.jackson.dataformat.avro.deser.AvroReaderFactory.NonResolving, com.fasterxml.jackson.dataformat.avro.deser.AvroReaderFactory.Resolving
Imports
java.io.IOException, java.util.*, org.apache.avro.Schema, com.fasterxml.jackson.dataformat.avro.deser.ScalarDecoder.*, com.fasterxml.jackson.dataformat.avro.schema.AvroSchemaHelper

Helper class used for constructing a hierarchic reader for given (reader-) schema.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
AvroReaderFactory.NonResolving

Implementation used when no schema-resolution is needed, when we are using same schema for reading as was used for writing.

private static class
AvroReaderFactory.Resolving

Implementation used when schema-resolution is needed, when we are using different schema for reading ("reader schema") than was used for writing encoded data ("writer schema")

Field Summary

Modifier and TypeField and Description
protected final TreeMap<String, AvroStructureReader>
_knownReaders

To resolve cyclic types, need to keep track of resolved named types.

protected static final ScalarDecoder
protected static final ScalarDecoder
protected static final ScalarDecoder
protected static final ScalarDecoder
protected static final ScalarDecoder
protected static final ScalarDecoder
protected static final ScalarDecoder
protected static final ScalarDecoder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected AvroStructureReader
protected AvroFieldReader
public static AvroStructureReader
createFor(Schema schema)

public static AvroStructureReader
createFor(Schema writerSchema, Schema readerSchema)

protected AvroStructureReader
public AvroStructureReader
createReader(Schema schema)

Method for creating a reader instance for specified type, only using specific schema that was used to encoded data ("writer schema").

protected AvroStructureReader
public ScalarDecoder
protected AvroStructureReader
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_knownReadersback to summary
protected final TreeMap<String, AvroStructureReader> _knownReaders

To resolve cyclic types, need to keep track of resolved named types.

READER_BOOLEANback to summary
protected static final ScalarDecoder READER_BOOLEAN
READER_BYTESback to summary
protected static final ScalarDecoder READER_BYTES
READER_DOUBLEback to summary
protected static final ScalarDecoder READER_DOUBLE
READER_FLOATback to summary
protected static final ScalarDecoder READER_FLOAT
READER_INTback to summary
protected static final ScalarDecoder READER_INT
READER_LONGback to summary
protected static final ScalarDecoder READER_LONG
READER_NULLback to summary
protected static final ScalarDecoder READER_NULL
READER_STRINGback to summary
protected static final ScalarDecoder READER_STRING

Constructor Detail

AvroReaderFactoryback to summary
public AvroReaderFactory()

Method Detail

createArrayReaderback to summary
protected AvroStructureReader createArrayReader(Schema schema) throws IOException
createFieldReaderback to summary
protected AvroFieldReader createFieldReader(Schema.Field field) throws IOException
createForback to summary
public static AvroStructureReader createFor(Schema schema) throws IOException
createForback to summary
public static AvroStructureReader createFor(Schema writerSchema, Schema readerSchema) throws IOException
createMapReaderback to summary
protected AvroStructureReader createMapReader(Schema schema) throws IOException
createReaderback to summary
public AvroStructureReader createReader(Schema schema) throws IOException

Method for creating a reader instance for specified type, only using specific schema that was used to encoded data ("writer schema").

createRecordReaderback to summary
protected AvroStructureReader createRecordReader(Schema schema) throws IOException
createScalarValueDecoderback to summary
public ScalarDecoder createScalarValueDecoder(Schema type)
createUnionReaderback to summary
protected AvroStructureReader createUnionReader(Schema schema) throws IOException
com.fasterxml.jackson.dataformat.avro.deser back to summary

private Class AvroReaderFactory.NonResolving

extends AvroReaderFactory
Class Inheritance

Implementation used when no schema-resolution is needed, when we are using same schema for reading as was used for writing.

Field Summary

Inherited from com.fasterxml.jackson.dataformat.avro.deser.AvroReaderFactory:
_knownReadersREADER_BOOLEANREADER_BYTESREADER_DOUBLEREADER_FLOATREADER_INTREADER_LONGREADER_NULLREADER_STRING

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Inherited from com.fasterxml.jackson.dataformat.avro.deser.AvroReaderFactory:
createArrayReadercreateFieldReadercreateForcreateForcreateMapReadercreateReadercreateRecordReadercreateScalarValueDecodercreateUnionReader

Constructor Detail

NonResolvingback to summary
protected NonResolving()
com.fasterxml.jackson.dataformat.avro.deser back to summary

private Class AvroReaderFactory.Resolving

extends AvroReaderFactory
Class Inheritance

Implementation used when schema-resolution is needed, when we are using different schema for reading ("reader schema") than was used for writing encoded data ("writer schema")

Field Summary

Inherited from com.fasterxml.jackson.dataformat.avro.deser.AvroReaderFactory:
_knownReadersREADER_BOOLEANREADER_BYTESREADER_DOUBLEREADER_FLOATREADER_INTREADER_LONGREADER_NULLREADER_STRING

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private Schema

Returns:

Reader schema that matches expected writer schema
_verifyMatchingStructure
(Schema readerSchema, Schema writerSchema)

Helper method that verifies that the given reader schema is compatible with specified writer schema type: either directly (same type), or via latter being a union with compatible type.

protected AvroStructureReader
createArrayReader(Schema writerSchema, Schema readerSchema)

protected AvroFieldReader
createFieldReader(String name, Schema writerSchema, Schema readerSchema)

protected AvroFieldReader
createFieldSkipper(String name, Schema writerSchema)

protected AvroStructureReader
createMapReader(Schema writerSchema, Schema readerSchema)

public AvroStructureReader
createReader(Schema writerSchema, Schema readerSchema)

Method for creating a reader instance for specified type.

protected AvroStructureReader
createRecordReader(Schema writerSchema, Schema readerSchema)

protected AvroStructureReader
createUnionReader(Schema writerSchema, Schema readerSchema)

Inherited from com.fasterxml.jackson.dataformat.avro.deser.AvroReaderFactory:
createArrayReadercreateFieldReadercreateForcreateForcreateMapReadercreateReadercreateRecordReadercreateScalarValueDecodercreateUnionReader

Constructor Detail

Resolvingback to summary
protected Resolving()

Method Detail

_verifyMatchingStructureback to summary
private Schema _verifyMatchingStructure(Schema readerSchema, Schema writerSchema)

Helper method that verifies that the given reader schema is compatible with specified writer schema type: either directly (same type), or via latter being a union with compatible type. In latter case, type (schema) within union that matches writer schema is returned instead of containing union

Returns:Schema

Reader schema that matches expected writer schema

createArrayReaderback to summary
protected AvroStructureReader createArrayReader(Schema writerSchema, Schema readerSchema) throws IOException
createFieldReaderback to summary
protected AvroFieldReader createFieldReader(String name, Schema writerSchema, Schema readerSchema) throws IOException
createFieldSkipperback to summary
protected AvroFieldReader createFieldSkipper(String name, Schema writerSchema) throws IOException
createMapReaderback to summary
protected AvroStructureReader createMapReader(Schema writerSchema, Schema readerSchema) throws IOException
createReaderback to summary
public AvroStructureReader createReader(Schema writerSchema, Schema readerSchema) throws IOException

Method for creating a reader instance for specified type.

createRecordReaderback to summary
protected AvroStructureReader createRecordReader(Schema writerSchema, Schema readerSchema) throws IOException
createUnionReaderback to summary
protected AvroStructureReader createUnionReader(Schema writerSchema, Schema readerSchema) throws IOException