Top Description Fields Constructors Methods
tools.jackson.databind.introspect

public Class JacksonAnnotationIntrospector

extends AnnotationIntrospector
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.lang.annotation.Annotation, java.lang.reflect.MalformedParametersException, .Parameter, java.util.*, com.fasterxml.jackson.annotation.*, tools.jackson.core.JsonParser, .Version, tools.jackson.databind.*, tools.jackson.databind.annotation.*, tools.jackson.databind.cfg.HandlerInstantiator, .MapperConfig, tools.jackson.databind.ext.beans.JavaBeansAnnotations, tools.jackson.databind.jsontype.NamedType, tools.jackson.databind.ser.BeanPropertyWriter, .VirtualBeanPropertyWriter, tools.jackson.databind.ser.impl.AttributePropertyWriter, tools.jackson.databind.ser.jackson.RawSerializer, tools.jackson.databind.type.MapLikeType, .TypeFactory, tools.jackson.databind.util.*

AnnotationIntrospector implementation that handles standard Jackson annotations.

Field Summary

Modifier and TypeField and Description
protected transient LookupCache<String, Boolean>
_annotationsInside

Since introspection of annotation types is a performance issue in some use cases (rare, but do exist), let's try a simple cache to reduce need for actual meta-annotation introspection.

protected boolean
private static final JavaBeansAnnotations
private static final Class<? extends Annotation>[]
private static final Class<? extends Annotation>[]
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Class<?>
protected Class<?>
_classIfExplicit(Class<?> cls, Class<?> implicit)

protected BeanPropertyWriter
protected BeanPropertyWriter
private DatabindException
private DatabindException
protected String
private final Boolean
protected boolean
private boolean
_primitiveAndWrapper(Class<?> baseType, Class<?> refinement)

private boolean
_primitiveAndWrapper(JavaType baseType, Class<?> refinement)

protected PropertyName
_propertyName(String localName, String namespace)

public void
findAndAddVirtualProperties(MapperConfig<?> config, AnnotatedClass ac, List<BeanPropertyWriter> properties)

Overrides tools.jackson.databind.AnnotationIntrospector.findAndAddVirtualProperties.

Method for adding possible virtual properties to be serialized along with regular properties.

public VisibilityChecker
findAutoDetectVisibility(MapperConfig<?> config, AnnotatedClass ac, VisibilityChecker checker)

Overrides tools.jackson.databind.AnnotationIntrospector.findAutoDetectVisibility.

Method for checking if annotations indicate changes to minimum visibility levels needed for auto-detecting property elements (fields, methods, constructors).

public String
findClassDescription(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.AnnotationIntrospector.findClassDescription.

Method used to check whether specified class defines a human-readable description to use for documentation.

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

Overrides tools.jackson.databind.AnnotationIntrospector.findContentDeserializer.

Method for getting a deserializer definition for content (values) of associated Collection, array or Map property.

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

Overrides tools.jackson.databind.AnnotationIntrospector.findContentSerializer.

Method for getting a serializer definition for content (values) of associated Collection, array or Map property.

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 Enum<?>

Returns:

null if none found or it's not possible to determine one.
findDefaultEnumValue
(MapperConfig<?> config, AnnotatedClass
The Enum class to scan for the default value annotation.
annotatedClass
,
Enum<?>[] enumValues)

Overrides tools.jackson.databind.AnnotationIntrospector.findDefaultEnumValue.

Finds the Enum value that should be considered the default value, if possible.

public Object
findDeserializationContentConverter(MapperConfig<?> config, AnnotatedMember a)

Overrides tools.jackson.databind.AnnotationIntrospector.findDeserializationContentConverter.

Method for finding Converter that annotated property has indicated needs to be used for values of container type (this also means that method should only be called for properties of container types, List/Map/array properties).

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

Overrides tools.jackson.databind.AnnotationIntrospector.findDeserializationConverter.

Method for finding Converter that annotated entity (property or class) has indicated to be used as part of deserialization.

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

Overrides tools.jackson.databind.AnnotationIntrospector.findDeserializer.

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

public void
findEnumAliases(MapperConfig<?> config, AnnotatedClass annotatedClass, Enum<?>[] enumValues, String[][] aliasList)

Overrides tools.jackson.databind.AnnotationIntrospector.findEnumAliases.

Method that is called to check if there are alternative names (aliases) that can be accepted for entries in addition to primary names that were introspected earlier, related to findEnumValues.

public Object
findEnumNamingStrategy(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.AnnotationIntrospector.findEnumNamingStrategy.

Method for finding EnumNamingStrategy for given class, if any specified by annotations; and if so, either return a EnumNamingStrategy instance, or Class to use for creating instance

public String[]
findEnumValues(MapperConfig<?> config, AnnotatedClass annotatedClass, Enum<?>[] enumValues, String[] names)

Overrides tools.jackson.databind.AnnotationIntrospector.findEnumValues.

Finds the explicitly defined name of the given set of Enum values, if any.

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

Overrides tools.jackson.databind.AnnotationIntrospector.findFilterId.

Method for finding if annotated class has associated filter; and if so, to return id that is used to locate filter.

public JsonFormat.Value
findFormat(MapperConfig<?> config, Annotated ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findFormat.

Method for finding format annotations for property or class.

public String
findImplicitPropertyName(MapperConfig<?> config, AnnotatedMember m)

Overrides tools.jackson.databind.AnnotationIntrospector.findImplicitPropertyName.

Method for finding implicit name for a property that given annotated member (field, method, creator parameter) may represent.

public JacksonInject.Value
findInjectableValue(MapperConfig<?> config, AnnotatedMember m)

Overrides tools.jackson.databind.AnnotationIntrospector.findInjectableValue.

Method called to find out whether given member expectes a value to be injected, and if so, what is the identifier of the value to use during injection.

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

Overrides tools.jackson.databind.AnnotationIntrospector.findKeyDeserializer.

Method for getting a deserializer definition for keys of associated Map property.

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

Overrides tools.jackson.databind.AnnotationIntrospector.findKeySerializer.

Method for getting a serializer definition for keys of associated java.util.Map property.

public Boolean
findMergeInfo(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findMergeInfo.

Method for finding merge settings for property, if any.

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 Object
findNamingStrategy(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.AnnotationIntrospector.findNamingStrategy.

Method for finding PropertyNamingStrategy for given class, if any specified by annotations; and if so, either return a PropertyNamingStrategy instance, or Class to use for creating instance

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

Overrides tools.jackson.databind.AnnotationIntrospector.findNullSerializer.

Method for getting a serializer definition for serializer to use for nulls (null values) of associated property or type.

public ObjectIdInfo
findObjectIdInfo(MapperConfig<?> config, Annotated ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findObjectIdInfo.

Method for checking whether given annotated thing (type, or accessor) indicates that values referenced (values of type of annotated class, or values referenced by annotated property; latter having precedence) should include Object Identifier, and if so, specify details of Object Identity used.

public ObjectIdInfo
findObjectReferenceInfo(MapperConfig<?> config, Annotated ann, ObjectIdInfo objectIdInfo)

Overrides tools.jackson.databind.AnnotationIntrospector.findObjectReferenceInfo.

Method for figuring out additional properties of an Object Identity reference

public Class<?>
findPOJOBuilder(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.AnnotationIntrospector.findPOJOBuilder.

Method for finding Builder object to use for constructing value instance and binding data (sort of combining value instantiators that can construct, and deserializers that can bind data).

public JsonPOJOBuilder.Value
public JsonTypeInfo.Value
findPolymorphicTypeInfo(MapperConfig<?> config, Annotated ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findPolymorphicTypeInfo.

Method for checking whether given Class or Property Accessor specifies polymorphic type-handling information, to indicate need for polymorphic handling.

public JsonProperty.Access
findPropertyAccess(MapperConfig<?> config, Annotated m)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyAccess.

Method for finding optional access definition for a property, annotated on one of its accessors.

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 ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyDefaultValue.

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

public String
findPropertyDescription(MapperConfig<?> config, Annotated ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyDescription.

Method used to check whether specified property member (accessor or mutator) defines human-readable description to use for documentation.

public JsonIgnoreProperties.Value
findPropertyIgnoralByName(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyIgnoralByName.

Method for finding information about properties to ignore either by name, or by more general specification ("ignore all unknown").

public JsonInclude.Value
findPropertyInclusion(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyInclusion.

Method for checking inclusion criteria for a type (Class) or property (yes, method name is bit unfortunate -- not just for properties!).

public JsonIncludeProperties.Value
findPropertyInclusionByName(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyInclusionByName.

Method for finding information about names of properties to included.

public Integer
findPropertyIndex(MapperConfig<?> config, Annotated ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findPropertyIndex.

Method used to check whether specified property member (accessor or mutator) defines numeric index, and if so, what is the index value.

public AnnotationIntrospector.ReferenceProperty
findReferenceType(MapperConfig<?> config, AnnotatedMember member)

Overrides tools.jackson.databind.AnnotationIntrospector.findReferenceType.

Method for checking if given member indicates that it is part of a reference (parent/child).

public PropertyName
findRenameByField(MapperConfig<?> config, AnnotatedField f, PropertyName implName)

Overrides tools.jackson.databind.AnnotationIntrospector.findRenameByField.

Method called on fields that are eligible candidates for properties (that is, non-static member fields), but not necessarily selected (may or may not be visible), to let fields affect name linking.

public PropertyName
findRootName(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.AnnotationIntrospector.findRootName.

Method for locating name used as "root name" (for use by some serializers when outputting root-level object -- mostly for XML compatibility purposes) for given class, if one is defined.

public Object
findSerializationContentConverter(MapperConfig<?> config, AnnotatedMember a)

Overrides tools.jackson.databind.AnnotationIntrospector.findSerializationContentConverter.

Method for finding Converter that annotated property has indicated needs to be used for values of container type (this also means that method should only be called for properties of container types, List/Map/array properties).

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

Overrides tools.jackson.databind.AnnotationIntrospector.findSerializationConverter.

Method for finding Converter that annotated entity (property or class) has indicated to be used as part of serialization.

public String[]
findSerializationPropertyOrder(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.AnnotationIntrospector.findSerializationPropertyOrder.

Method for accessing defined property serialization order (which may be partial).

public Boolean
findSerializationSortAlphabetically(MapperConfig<?> config, Annotated ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findSerializationSortAlphabetically.

Method for checking whether an annotation indicates that serialized properties for which no explicit is defined should be alphabetically (lexicograpically) ordered

public JsonSerialize.Typing
findSerializationTyping(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findSerializationTyping.

Method for accessing declared typing mode annotated (if any).

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 JsonSetter.Value
findSetterInfo(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findSetterInfo.

Method for finding possible settings for property, given annotations on an accessor.

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).

private List<NamedType>
private List<NamedType>
private List<NamedType>
public Object
public String
findTypeName(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.AnnotationIntrospector.findTypeName.

Method for checking if specified type has explicit name.

public Object
public NameTransformer
findUnwrappingNameTransformer(MapperConfig<?> config, AnnotatedMember member)

Overrides tools.jackson.databind.AnnotationIntrospector.findUnwrappingNameTransformer.

Method called to check whether given property is marked to be "unwrapped" when being serialized (and appropriately handled in reverse direction, i.e. expect unwrapped representation during deserialization).

public Object
findValueInstantiator(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.AnnotationIntrospector.findValueInstantiator.

Method getting ValueInstantiator to use for given type (class): return value can either be an instance of instantiator, or class of instantiator to create.

public Class<?>[]
findViews(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.findViews.

Method for checking if annotated property (represented by a field or getter/setter method) has definitions for views it is to be included in. If null is returned, no view definitions exist and property is always included (or always excluded as per default view inclusion configuration); otherwise it will only be included for views included in returned array.

public Boolean
hasAnyGetter(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.hasAnyGetter.

Method for checking whether given method has an annotation that suggests that the method is to serve as "any setter"; method to be used for accessing set of miscellaneous "extra" properties, often bound with matching "any setter" method.

public Boolean
hasAnySetter(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.hasAnySetter.

Method for checking whether given method has an annotation that suggests that the method is to serve as "any setter"; method to be used for setting values of any properties for which no dedicated setter method is found.

public Boolean
hasAsKey(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.hasAsKey.

Method for checking whether given method has an annotation that suggests the return value of annotated field or method should be used as "the key" of the object instance; usually serialized as a primitive value such as String or number.

public Boolean
hasAsValue(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.AnnotationIntrospector.hasAsValue.

Method for checking whether given method has an annotation that suggests that the return value of annotated method should be used as "the value" of the object instance; usually serialized as a primitive value such as String or number.

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 boolean
public Boolean
isIgnorableType(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.AnnotationIntrospector.isIgnorableType.

Method for checking whether properties that have specified type (class, not generics aware) should be completely ignored for serialization and deserialization purposes.

public Boolean
isTypeId(MapperConfig<?> config, AnnotatedMember member)

Overrides tools.jackson.databind.AnnotationIntrospector.isTypeId.

Method for checking whether given accessor claims to represent type id: if so, its value may be used as an override, instead of generated type id.

protected Object
public JavaType
refineDeserializationType(final MapperConfig<?> config, final Annotated a, final JavaType baseType)

Overrides tools.jackson.databind.AnnotationIntrospector.refineDeserializationType.

Method called to find out possible type refinements to use for deserialization.

public JavaType
refineSerializationType(final MapperConfig<?> config, final Annotated a, final JavaType baseType)

Overrides tools.jackson.databind.AnnotationIntrospector.refineSerializationType.

Method called to find out possible type refinements to use for deserialization, including not just value itself but key and/or content type, if type has those.

public AnnotatedMethod
resolveSetterConflict(MapperConfig<?> config, AnnotatedMethod setter1, AnnotatedMethod setter2)

Overrides tools.jackson.databind.AnnotationIntrospector.resolveSetterConflict.

Method called in cases where a class has two methods eligible to be used for the same logical property, and default logic is not enough to figure out clear precedence.

public JacksonAnnotationIntrospector
setConstructorPropertiesImpliesCreator(boolean b)

Method for changing behavior of java.beans.ConstructorProperties: if set to `true`, existence DOES indicate that the given constructor should be considered a creator; `false` that it should NOT be considered a creator without explicit use of JsonCreator annotation.

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_hasOneOfallIntrospectorsallIntrospectorsfindPreferredCreatorfindWrapperNamenopInstancepair