Top Description Fields Constructors Methods
tools.jackson.dataformat.avro

public Class AvroAnnotationIntrospector

extends AnnotationIntrospector
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.util.*, org.apache.avro.reflect.*, com.fasterxml.jackson.annotation.JsonCreator, tools.jackson.core.Version, tools.jackson.databind.AnnotationIntrospector, .PropertyName, tools.jackson.databind.cfg.MapperConfig, tools.jackson.databind.introspect.*, tools.jackson.databind.jsontype.NamedType, tools.jackson.databind.ser.std.ToStringSerializer, tools.jackson.databind.util.ClassUtil, tools.jackson.dataformat.avro.apacheimpl.CustomEncodingDeserializer, tools.jackson.dataformat.avro.schema.AvroSchemaHelper, tools.jackson.dataformat.avro.ser.CustomEncodingSerializer

Adds support for the following annotations from the Apache Avro implementation:

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected PropertyName
protected Class<?>[]
public JsonCreator.Mode
findCreatorAnnotation(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findCreatorAnnotation.

Method called to check whether potential Creator (constructor or static factory method) has explicit annotation to indicate it as actual Creator; and if so, which com.fasterxml.jackson.annotation.JsonCreator.Mode to use.

public Object
findDeserializer(MapperConfig<?> config, Annotated am)

Overrides tools.jackson.databind.AnnotationIntrospector.findDeserializer.

Method for getting a deserializer definition on specified method or field.

public PropertyName
findNameForDeserialization(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findNameForDeserialization.

Method for checking whether given property accessors (method, field) has an annotation that suggests property name to use for deserialization (reading JSON into POJOs).

public PropertyName
findNameForSerialization(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findNameForSerialization.

Method for checking whether given property accessors (method, field) has an annotation that suggests property name to use for serialization.

public List<PropertyName>
findPropertyAliases(MapperConfig<?> config, Annotated m)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyAliases.

Method called to find if given property has alias(es) defined.

public String
findPropertyDefaultValue(MapperConfig<?> config, Annotated m)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyDefaultValue.

Method for finding suggested default value (as simple textual serialization) for the property.

public Object
findSerializer(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findSerializer.

Method for getting a serializer definition on specified method or field.

public List<NamedType>
findSubtypes(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findSubtypes.

Method for locating annotation-specified subtypes related to annotated entity (class, method, field).

public Object
public boolean
hasIgnoreMarker(MapperConfig<?> config, AnnotatedMember m)

Overrides tools.jackson.databind.AnnotationIntrospector.hasIgnoreMarker.

Method called to check whether given property is marked to be ignored.

public Boolean
hasRequiredMarker(MapperConfig<?> config, AnnotatedMember m)

Overrides tools.jackson.databind.AnnotationIntrospector.hasRequiredMarker.

Method that can be called to check whether this member has an annotation that suggests whether value for matching property is required or not.

public Version
version()

Implements abstract tools.jackson.databind.AnnotationIntrospector.version.

Implements tools.jackson.core.Versioned.version.

Method called to detect version of the component that implements this interface; returned version should never be null, but may return specific "not available" instance (see Version for details).

Inherited from tools.jackson.databind.AnnotationIntrospector:
_findAnnotation_hasAnnotation_hasOneOfallIntrospectorsallIntrospectorsfindAndAddVirtualPropertiesfindAutoDetectVisibilityfindClassDescriptionfindContentDeserializerfindContentSerializerfindDefaultEnumValuefindDeserializationContentConverterfindDeserializationConverterfindEnumAliasesfindEnumNamingStrategyfindEnumValuesfindFilterIdfindFormatfindImplicitPropertyNamefindInjectableValuefindKeyDeserializerfindKeySerializerfindMergeInfofindNamingStrategyfindNullSerializerfindObjectIdInfofindObjectReferenceInfofindPOJOBuilderfindPOJOBuilderConfigfindPolymorphicTypeInfofindPreferredCreatorfindPropertyAccessfindPropertyDescriptionfindPropertyIgnoralByNamefindPropertyInclusionfindPropertyInclusionByNamefindPropertyIndexfindReferenceTypefindRenameByFieldfindRootNamefindSerializationContentConverterfindSerializationConverterfindSerializationPropertyOrderfindSerializationSortAlphabeticallyfindSerializationTypingfindSetterInfofindTypeIdResolverfindTypeNamefindUnwrappingNameTransformerfindValueInstantiatorfindViewsfindWrapperNamehasAnyGetterhasAnySetterhasAsKeyhasAsValueisAnnotationBundleisIgnorableTypeisTypeIdnopInstancepairrefineDeserializationTyperefineSerializationTyperesolveSetterConflict

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

AvroAnnotationIntrospectorback to summary
public AvroAnnotationIntrospector()

Method Detail

_findNameback to summary
protected PropertyName _findName(Annotated a)
_getUnionTypesback to summary
protected Class<?>[] _getUnionTypes(Annotated a)
findCreatorAnnotationback to summary
public JsonCreator.Mode findCreatorAnnotation(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findCreatorAnnotation.

Doc from tools.jackson.databind.AnnotationIntrospector.findCreatorAnnotation.

Method called to check whether potential Creator (constructor or static factory method) has explicit annotation to indicate it as actual Creator; and if so, which com.fasterxml.jackson.annotation.JsonCreator.Mode to use.

Note

caller needs to consider possibility of both `null` (no annotation found) and com.fasterxml.jackson.annotation.JsonCreator.Mode#DISABLED (annotation found, but disabled); latter is necessary as marker in case multiple introspectors are chained, as well as possibly as when using mix-in annotations.

Annotations
@Override
findDeserializerback to summary
public Object findDeserializer(MapperConfig<?> config, Annotated am)

Overrides tools.jackson.databind.AnnotationIntrospector.findDeserializer.

Doc from tools.jackson.databind.AnnotationIntrospector.findDeserializer.

Method for getting a deserializer definition on specified method or field. Type of definition is either instance (of type ValueDeserializer) or Class (of type Class&<ValueDeserializer>); type is returned, a runtime exception may be thrown by caller.

Annotations
@Override
findNameForDeserializationback to summary
public PropertyName findNameForDeserialization(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findNameForDeserialization.

Doc from tools.jackson.databind.AnnotationIntrospector.findNameForDeserialization.

Method for checking whether given property accessors (method, field) has an annotation that suggests property name to use for deserialization (reading JSON into POJOs). Should return null if no annotation is found; otherwise a non-null name (possibly PropertyName#USE_DEFAULT, which means "use default heuristics").

Annotations
@Override
findNameForSerializationback to summary
public PropertyName findNameForSerialization(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findNameForSerialization.

Doc from tools.jackson.databind.AnnotationIntrospector.findNameForSerialization.

Method for checking whether given property accessors (method, field) has an annotation that suggests property name to use for serialization. Should return null if no annotation is found; otherwise a non-null name (possibly PropertyName#USE_DEFAULT, which means "use default heuristics").

Annotations
@Override
findPropertyAliasesback to summary
public List<PropertyName> findPropertyAliases(MapperConfig<?> config, Annotated m)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyAliases.

Doc from tools.jackson.databind.AnnotationIntrospector.findPropertyAliases.

Method called to find if given property has alias(es) defined.

Annotations
@Override
findPropertyDefaultValueback to summary
public String findPropertyDefaultValue(MapperConfig<?> config, Annotated m)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyDefaultValue.

Doc from tools.jackson.databind.AnnotationIntrospector.findPropertyDefaultValue.

Method for finding suggested default value (as simple textual serialization) for the property. While core databind does not make any use of it, it is exposed for extension modules to use: an expected use is generation of schema representations and documentation.

Annotations
@Override
findSerializerback to summary
public Object findSerializer(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findSerializer.

Doc from tools.jackson.databind.AnnotationIntrospector.findSerializer.

Method for getting a serializer definition on specified method or field. Type of definition is either instance (of type ValueSerializer) or Class (of Class<ValueSerializer> implementation subtype); if value of different type is returned, a runtime exception may be thrown by caller.

Annotations
@Override
findSubtypesback to summary
public List<NamedType> findSubtypes(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findSubtypes.

Doc from tools.jackson.databind.AnnotationIntrospector.findSubtypes.

Method for locating annotation-specified subtypes related to annotated entity (class, method, field). Note that this is only guaranteed to be a list of directly declared subtypes, no recursive processing is guarantees (i.e. caller has to do it if/as necessary)

Annotations
@Override
findTypeResolverBuilderback to summary
public Object findTypeResolverBuilder(MapperConfig<?> config, Annotated ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findTypeResolverBuilder.

Annotations
@Override
hasIgnoreMarkerback to summary
public boolean hasIgnoreMarker(MapperConfig<?> config, AnnotatedMember m)

Overrides tools.jackson.databind.AnnotationIntrospector.hasIgnoreMarker.

Doc from tools.jackson.databind.AnnotationIntrospector.hasIgnoreMarker.

Method called to check whether given property is marked to be ignored. This is used to determine whether to ignore properties, on per-property basis, usually combining annotations from multiple accessors (getters, setters, fields, constructor parameters).

Annotations
@Override
hasRequiredMarkerback to summary
public Boolean hasRequiredMarker(MapperConfig<?> config, AnnotatedMember m)

Overrides tools.jackson.databind.AnnotationIntrospector.hasRequiredMarker.

Doc from tools.jackson.databind.AnnotationIntrospector.hasRequiredMarker.

Method that can be called to check whether this member has an annotation that suggests whether value for matching property is required or not.

Annotations
@Override
versionback to summary
public Version version()

Implements abstract tools.jackson.databind.AnnotationIntrospector.version.

Implements tools.jackson.core.Versioned.version.

Doc from tools.jackson.core.Versioned.version.

Method called to detect version of the component that implements this interface; returned version should never be null, but may return specific "not available" instance (see Version for details).

Annotations
@Override