public class RecordVisitor extends com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base implements SchemaBuilder
Modifier and Type | Field and Description |
---|---|
protected org.apache.avro.Schema |
_avroSchema |
protected List<org.apache.avro.Schema.Field> |
_fields |
protected 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 com.fasterxml.jackson.databind.JavaType |
_type |
protected VisitorFormatWrapperImpl |
_visitorWrapper |
Constructor and Description |
---|
RecordVisitor(com.fasterxml.jackson.databind.SerializerProvider p,
com.fasterxml.jackson.databind.JavaType type,
VisitorFormatWrapperImpl visitorWrapper) |
Modifier and Type | Method and Description |
---|---|
org.apache.avro.Schema |
builtAvroSchema() |
void |
optionalProperty(com.fasterxml.jackson.databind.BeanProperty writer) |
void |
optionalProperty(String name,
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler,
com.fasterxml.jackson.databind.JavaType type) |
void |
property(com.fasterxml.jackson.databind.BeanProperty writer) |
void |
property(String name,
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler,
com.fasterxml.jackson.databind.JavaType type) |
protected org.apache.avro.Schema |
reorderUnionToMatchDefaultType(org.apache.avro.Schema schema,
com.fasterxml.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.Field |
schemaFieldForWriter(com.fasterxml.jackson.databind.BeanProperty prop,
boolean optional) |
protected final com.fasterxml.jackson.databind.JavaType _type
protected final VisitorFormatWrapperImpl _visitorWrapper
protected final boolean _overridden
property
and
optionalProperty
methods should be ignored.protected org.apache.avro.Schema _avroSchema
protected List<org.apache.avro.Schema.Field> _fields
public RecordVisitor(com.fasterxml.jackson.databind.SerializerProvider p, com.fasterxml.jackson.databind.JavaType type, VisitorFormatWrapperImpl visitorWrapper)
public org.apache.avro.Schema builtAvroSchema()
builtAvroSchema
in interface SchemaBuilder
public void property(com.fasterxml.jackson.databind.BeanProperty writer) throws com.fasterxml.jackson.databind.JsonMappingException
property
in interface com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor
property
in class com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
com.fasterxml.jackson.databind.JsonMappingException
public void property(String name, com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, com.fasterxml.jackson.databind.JavaType type) throws com.fasterxml.jackson.databind.JsonMappingException
property
in interface com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor
property
in class com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
com.fasterxml.jackson.databind.JsonMappingException
public void optionalProperty(com.fasterxml.jackson.databind.BeanProperty writer) throws com.fasterxml.jackson.databind.JsonMappingException
optionalProperty
in interface com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor
optionalProperty
in class com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
com.fasterxml.jackson.databind.JsonMappingException
public void optionalProperty(String name, com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, com.fasterxml.jackson.databind.JavaType type) throws com.fasterxml.jackson.databind.JsonMappingException
optionalProperty
in interface com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor
optionalProperty
in class com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
com.fasterxml.jackson.databind.JsonMappingException
protected org.apache.avro.Schema.Field schemaFieldForWriter(com.fasterxml.jackson.databind.BeanProperty prop, boolean optional) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingException
protected org.apache.avro.Schema reorderUnionToMatchDefaultType(org.apache.avro.Schema schema, com.fasterxml.jackson.databind.JsonNode defaultValue)
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.schema
- Schema to reorder; If null
or not a UNION
, then it is returned unmodified.defaultValue
- Default value to match with the uniondefaultValue
; otherwise, schema
is returned
unmodified.Copyright © 2021 FasterXML. All rights reserved.