Class AbstractTypeInfoAwareAnnotator

java.lang.Object
org.jsonschema2pojo.AbstractAnnotator
org.jsonschema2pojo.AbstractTypeInfoAwareAnnotator
All Implemented Interfaces:
Annotator
Direct Known Subclasses:
JacksonAnnotator

public abstract class AbstractTypeInfoAwareAnnotator extends AbstractAnnotator
  • Constructor Details

    • AbstractTypeInfoAwareAnnotator

      public AbstractTypeInfoAwareAnnotator(GenerationConfig generationConfig)
  • Method Details

    • typeInfo

      public void typeInfo(com.sun.codemodel.JDefinedClass clazz, com.fasterxml.jackson.databind.JsonNode node)
      Description copied from interface: Annotator
      Add the necessary annotation to dictate correct type information during serialization and deserialization; often required with polymorphic types.
      Specified by:
      typeInfo in interface Annotator
      Overrides:
      typeInfo in class AbstractAnnotator
      Parameters:
      clazz - a generated pojo class, that needs serialization annotations
      node - the object schema associated with this clazz
      See Also:
    • isPolymorphicDeserializationSupported

      public boolean isPolymorphicDeserializationSupported(com.fasterxml.jackson.databind.JsonNode node)
      Description copied from interface: Annotator
      Indicates whether type hint annotations should be added to support polymorphic deserialization.
      Specified by:
      isPolymorphicDeserializationSupported in interface Annotator
      Overrides:
      isPolymorphicDeserializationSupported in class AbstractAnnotator
      Parameters:
      node - the relevant schema node
      Returns:
      true if the JSON library supports polymorphic deserialization AND the deserializationClassProperty is present in this schema
    • addJsonTypeInfoAnnotation

      protected abstract void addJsonTypeInfoAnnotation(com.sun.codemodel.JDefinedClass clazz, String propertyName)