Class RecordVisitor
java.lang.Object
tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
tools.jackson.dataformat.avro.schema.RecordVisitor
- All Implemented Interfaces:
tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor,tools.jackson.databind.jsonFormatVisitors.WithGettableSerializationContext,SchemaBuilder
public class RecordVisitor
extends tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
implements SchemaBuilder
-
Nested Class Summary
Nested classes/interfaces inherited from interface tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor
tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.avro.Schemaprotected final booleanprotected final List<org.apache.avro.Schema.Field>protected final booleanTracks if the schema for this record has been overridden (by an annotation or other means), and calls to thepropertyandoptionalPropertymethods should be ignored.protected final tools.jackson.databind.JavaTypeprotected final VisitorFormatWrapperImplFields inherited from class tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
_context -
Constructor Summary
ConstructorsConstructorDescriptionRecordVisitor(tools.jackson.databind.SerializationContext ctxt, tools.jackson.databind.JavaType type, VisitorFormatWrapperImpl visitorWrapper) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.avro.SchemavoidoptionalProperty(String name, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, tools.jackson.databind.JavaType type) voidoptionalProperty(tools.jackson.databind.BeanProperty writer) voidproperty(String name, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, tools.jackson.databind.JavaType type) voidproperty(tools.jackson.databind.BeanProperty writer) protected org.apache.avro.SchemareorderUnionToMatchDefaultType(org.apache.avro.Schema schema, tools.jackson.databind.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.protected org.apache.avro.Schema.FieldschemaFieldForWriter(tools.jackson.databind.BeanProperty prop, boolean optional) Methods inherited from class tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
getContext
-
Field Details
-
_type
protected final tools.jackson.databind.JavaType _type -
_visitorWrapper
-
_overridden
protected final boolean _overriddenTracks if the schema for this record has been overridden (by an annotation or other means), and calls to thepropertyandoptionalPropertymethods should be ignored. -
_cfgAddNullDefaults
protected final boolean _cfgAddNullDefaults -
_avroSchema
protected final org.apache.avro.Schema _avroSchema -
_fields
-
-
Constructor Details
-
RecordVisitor
public RecordVisitor(tools.jackson.databind.SerializationContext ctxt, tools.jackson.databind.JavaType type, VisitorFormatWrapperImpl visitorWrapper)
-
-
Method Details
-
builtAvroSchema
public org.apache.avro.Schema builtAvroSchema()- Specified by:
builtAvroSchemain interfaceSchemaBuilder
-
property
public void property(tools.jackson.databind.BeanProperty writer) - Specified by:
propertyin interfacetools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor- Overrides:
propertyin classtools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
-
property
public void property(String name, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, tools.jackson.databind.JavaType type) - Specified by:
propertyin interfacetools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor- Overrides:
propertyin classtools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
-
optionalProperty
public void optionalProperty(tools.jackson.databind.BeanProperty writer) - Specified by:
optionalPropertyin interfacetools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor- Overrides:
optionalPropertyin classtools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
-
optionalProperty
public void optionalProperty(String name, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, tools.jackson.databind.JavaType type) - Specified by:
optionalPropertyin interfacetools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor- Overrides:
optionalPropertyin classtools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
-
schemaFieldForWriter
protected org.apache.avro.Schema.Field schemaFieldForWriter(tools.jackson.databind.BeanProperty prop, boolean optional) -
reorderUnionToMatchDefaultType
protected org.apache.avro.Schema reorderUnionToMatchDefaultType(org.apache.avro.Schema schema, tools.jackson.databind.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. Ifschemais aUNIONschema anddefaultValueis non-null, this finds the appropriate branch in the union and reorders the union so that it is first.- Parameters:
schema- Schema to reorder; Ifnullor not aUNION, then it is returned unmodified.defaultValue- Default value to match with the union- Returns:
- A schema modified so the first branch matches the type of
defaultValue; otherwise,schemais returned unmodified.
-