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

    Fields
    Modifier and Type
    Field
    Description
    protected final org.apache.avro.Schema
     
    protected final boolean
     
    protected final List<org.apache.avro.Schema.Field>
     
    protected final boolean
    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 tools.jackson.databind.JavaType
     
    protected final VisitorFormatWrapperImpl
     

    Fields inherited from class tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base

    _context
  • Constructor Summary

    Constructors
    Constructor
    Description
    RecordVisitor(tools.jackson.databind.SerializationContext ctxt, tools.jackson.databind.JavaType type, VisitorFormatWrapperImpl visitorWrapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.avro.Schema
     
    void
    optionalProperty(String name, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, tools.jackson.databind.JavaType type)
     
    void
    optionalProperty(tools.jackson.databind.BeanProperty writer)
     
    void
    property(String name, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, tools.jackson.databind.JavaType type)
     
    void
    property(tools.jackson.databind.BeanProperty writer)
     
    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.
    protected org.apache.avro.Schema.Field
    schemaFieldForWriter(tools.jackson.databind.BeanProperty prop, boolean optional)
     

    Methods inherited from class tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base

    getContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _type

      protected final tools.jackson.databind.JavaType _type
    • _visitorWrapper

      protected final VisitorFormatWrapperImpl _visitorWrapper
    • _overridden

      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.
    • _cfgAddNullDefaults

      protected final boolean _cfgAddNullDefaults
    • _avroSchema

      protected final org.apache.avro.Schema _avroSchema
    • _fields

      protected final List<org.apache.avro.Schema.Field> _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:
      builtAvroSchema in interface SchemaBuilder
    • property

      public void property(tools.jackson.databind.BeanProperty writer)
      Specified by:
      property in interface tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor
      Overrides:
      property in class tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
    • property

      public void property(String name, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, tools.jackson.databind.JavaType type)
      Specified by:
      property in interface tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor
      Overrides:
      property in class tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
    • optionalProperty

      public void optionalProperty(tools.jackson.databind.BeanProperty writer)
      Specified by:
      optionalProperty in interface tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor
      Overrides:
      optionalProperty in class tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor.Base
    • optionalProperty

      public void optionalProperty(String name, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable handler, tools.jackson.databind.JavaType type)
      Specified by:
      optionalProperty in interface tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor
      Overrides:
      optionalProperty in class tools.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. 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 to reorder; If null or not a UNION, 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, schema is returned unmodified.