Top Fields Constructors Methods
com.fasterxml.jackson.dataformat.avro.schema

public Class RecordVisitor

extends Base
implements SchemaBuilder
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.dataformat.avro.schema.SchemaBuilder
Imports
java.util.ArrayList, .List, .Map, org.apache.avro.Schema, .Schema.Type, org.apache.avro.reflect.AvroMeta, .AvroSchema, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable, .JsonObjectFormatVisitor, com.fasterxml.jackson.databind.jsontype.NamedType, com.fasterxml.jackson.databind.ser.BeanPropertyWriter, com.fasterxml.jackson.dataformat.avro.AvroFixedSize, com.fasterxml.jackson.dataformat.avro.ser.CustomEncodingSerializer

Field Summary

Modifier and TypeField and Description
protected Schema
protected List<Schema.Field>
protected final boolean
_overridden

Tracks if the schema for this record has been overridden (by an annotation or other means), and calls to the property and optionalProperty methods should be ignored.

protected final JavaType
protected final VisitorFormatWrapperImpl
Inherited from com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base:
_provider

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Schema
public void
public void
public void
public void
property(String name, JsonFormatVisitable handler, JavaType type)

Overrides com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base.property.

Implements com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.property.

Callback method called when a non-POJO property (typically something like an Enum entry of java.util.EnumMap type) is being traversed.

protected Schema

Returns:

A schema modified so the first branch matches the type of defaultValue; otherwise, schema is returned unmodified.
reorderUnionToMatchDefaultType
(Schema
Schema to reorder; If null or not a UNION, then it is returned unmodified.
schema
,
JsonNode
Default value to match with the union
defaultValue
)

A union schema with a default value must always have the schema branch corresponding to the default value first, or Avro will print a warning complaining that the default value is not compatible.

protected Schema.Field
schemaFieldForWriter(BeanProperty prop, boolean optional)

Inherited from com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base:
getProvidersetProvider

Field Detail

_avroSchemaback to summary
protected Schema _avroSchema
_fieldsback to summary
protected List<Schema.Field> _fields
_overriddenback to summary
protected final boolean _overridden

Tracks if the schema for this record has been overridden (by an annotation or other means), and calls to the property and optionalProperty methods should be ignored.

_typeback to summary
protected final JavaType _type
_visitorWrapperback to summary
protected final VisitorFormatWrapperImpl _visitorWrapper

Constructor Detail

RecordVisitorback to summary
public RecordVisitor(SerializerProvider p, JavaType type, VisitorFormatWrapperImpl visitorWrapper)

Method Detail

builtAvroSchemaback to summary
public Schema builtAvroSchema()

Implements com.fasterxml.jackson.dataformat.avro.schema.SchemaBuilder.builtAvroSchema.

Annotations
@Override
optionalPropertyback to summary
public void optionalProperty(BeanProperty writer) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base.optionalProperty.

Implements com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.optionalProperty.

Annotations
@Override
optionalPropertyback to summary
public void optionalProperty(String name, JsonFormatVisitable handler, JavaType type) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base.optionalProperty.

Implements com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.optionalProperty.

Annotations
@Override
propertyback to summary
public void property(BeanProperty writer) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base.property.

Implements com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.property.

Doc from com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.property.

Callback method called when a POJO property is being traversed.

Annotations
@Override
propertyback to summary
public void property(String name, JsonFormatVisitable handler, JavaType type) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base.property.

Implements com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.property.

Doc from com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.property.

Callback method called when a non-POJO property (typically something like an Enum entry of java.util.EnumMap type) is being traversed. With POJOs, property(BeanProperty) is called instead.

Annotations
@Override
reorderUnionToMatchDefaultTypeback to summary
protected Schema reorderUnionToMatchDefaultType(Schema schema, JsonNode defaultValue)

A union schema with a default value must always have the schema branch corresponding to the default value first, or Avro will print a warning complaining that the default value is not compatible. If schema is a UNION schema and defaultValue is non-null, this finds the appropriate branch in the union and reorders the union so that it is first.

Parameters
schema:Schema

Schema to reorder; If null or not a UNION, then it is returned unmodified.

defaultValue:JsonNode

Default value to match with the union

Returns:Schema

A schema modified so the first branch matches the type of defaultValue; otherwise, schema is returned unmodified.

schemaFieldForWriterback to summary
protected Schema.Field schemaFieldForWriter(BeanProperty prop, boolean optional) throws JsonMappingException