Package org.jsonschema2pojo
Class AbstractTypeInfoAwareAnnotator
java.lang.Object
org.jsonschema2pojo.AbstractAnnotator
org.jsonschema2pojo.AbstractTypeInfoAwareAnnotator
- All Implemented Interfaces:
Annotator
- Direct Known Subclasses:
JacksonAnnotator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddJsonTypeInfoAnnotation(com.sun.codemodel.JDefinedClass clazz, String propertyName) booleanisPolymorphicDeserializationSupported(com.fasterxml.jackson.databind.JsonNode node) Indicates whether type hint annotations should be added to support polymorphic deserialization.voidtypeInfo(com.sun.codemodel.JDefinedClass clazz, com.fasterxml.jackson.databind.JsonNode node) Add the necessary annotation to dictate correct type information during serialization and deserialization; often required with polymorphic types.Methods inherited from class org.jsonschema2pojo.AbstractAnnotator
additionalPropertiesField, anyGetter, anySetter, dateField, dateTimeField, enumConstant, enumCreatorMethod, enumValueMethod, getGenerationConfig, isAdditionalPropertiesSupported, propertyField, propertyGetter, propertyInclusion, propertyOrder, propertySetter, timeField
-
Constructor Details
-
AbstractTypeInfoAwareAnnotator
-
-
Method Details
-
typeInfo
public void typeInfo(com.sun.codemodel.JDefinedClass clazz, com.fasterxml.jackson.databind.JsonNode node) Description copied from interface:AnnotatorAdd the necessary annotation to dictate correct type information during serialization and deserialization; often required with polymorphic types.- Specified by:
typeInfoin interfaceAnnotator- Overrides:
typeInfoin classAbstractAnnotator- Parameters:
clazz- a generated pojo class, that needs serialization annotationsnode- the object schema associated with this clazz- See Also:
-
isPolymorphicDeserializationSupported
public boolean isPolymorphicDeserializationSupported(com.fasterxml.jackson.databind.JsonNode node) Description copied from interface:AnnotatorIndicates whether type hint annotations should be added to support polymorphic deserialization.- Specified by:
isPolymorphicDeserializationSupportedin interfaceAnnotator- Overrides:
isPolymorphicDeserializationSupportedin classAbstractAnnotator- Parameters:
node- the relevant schema node- Returns:
trueif 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)
-