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 DefinedSchemas |
_schemas |
protected com.fasterxml.jackson.databind.JavaType |
_type |
| Constructor and Description |
|---|
RecordVisitor(com.fasterxml.jackson.databind.SerializerProvider p,
com.fasterxml.jackson.databind.JavaType type,
DefinedSchemas schemas) |
| 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 DefinedSchemas _schemas
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,
DefinedSchemas schemas)
public org.apache.avro.Schema builtAvroSchema()
builtAvroSchema in interface SchemaBuilderpublic void property(com.fasterxml.jackson.databind.BeanProperty writer)
throws com.fasterxml.jackson.databind.JsonMappingException
property in interface com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitorproperty in class com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Basecom.fasterxml.jackson.databind.JsonMappingExceptionpublic 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.JsonObjectFormatVisitorproperty in class com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Basecom.fasterxml.jackson.databind.JsonMappingExceptionpublic void optionalProperty(com.fasterxml.jackson.databind.BeanProperty writer)
throws com.fasterxml.jackson.databind.JsonMappingException
optionalProperty in interface com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitoroptionalProperty in class com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Basecom.fasterxml.jackson.databind.JsonMappingExceptionpublic 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.JsonObjectFormatVisitoroptionalProperty in class com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Basecom.fasterxml.jackson.databind.JsonMappingExceptionprotected org.apache.avro.Schema.Field schemaFieldForWriter(com.fasterxml.jackson.databind.BeanProperty prop,
boolean optional)
throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingExceptionprotected 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 © 2020 FasterXML. All rights reserved.