Although default implementations are based on using annotations as the only (or at least main) information source, custom implementations are not limited in such a way, and in fact there is no expectation they should be. So the name is bit of misnomer; this is a general configuration introspection facility.
Note
due to rapid addition of new methods (and changes to existing methods),
it is strongly recommended that custom implementations should not directly
extend this class, but rather extend NopAnnotationIntrospector.
This way added methods will not break backwards compatibility of custom annotation
introspectors.
| Modifier and Type | Class and Description |
|---|---|
| public static class | AnnotationIntrospector.
Value type used with managed and back references; contains type and logic name, used to link related references |
| public static interface | AnnotationIntrospector.
Add-on extension used for XML-specific configuration, needed to decouple format module functionality from pluggable introspection functionality (especially JAXB-annotation related one). |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected <A extends Annotation> A | Returns: Value of given annotation (as perannoClass), if entity
has one; null otherwiseAnnotated entity to check for specified annotation ann, Class<A> Type of annotation to find annoClass)Method that should be used by sub-classes for ALL annotation access; overridable so that sub-classes may, if they choose to, mangle actual access to block access ("hide" annotations) or perhaps change it. |
| protected boolean | Returns: true if specified annotation exists in given entity; false if notAnnotated entity to check for specified annotation ann, Class<? extends Annotation> Type of annotation to find annoClass)Method that should be used by sub-classes for ALL annotation existence access; overridable so that sub-classes may, if they choose to, mangle actual access to block access ("hide" annotations) or perhaps change value seen. |
| protected boolean | Returns: true if at least one of specified annotation exists in given entity;
false otherwiseAnnotated entity to check for specified annotation ann, Class<? extends Annotation>[] Types of annotation to find annoClasses)Alternative lookup method that is used to see if annotation has at least one of annotations of types listed in second argument. |
| public Collection | Returns: Collection of all introspectors starting with this one, in case multiple introspectors are chainedMethod that can be used to collect all "real" introspectors that this introspector contains, if any; or this introspector if it is not a container. |
| public Collection | Returns: Passed inCollection filled with introspectors as explained
aboveContainer to add introspectors to result)Method that can be used to collect all "real" introspectors that this introspector contains, if any; or this introspector if it is not a container. |
| public void | findAndAddVirtualProperties(MapperConfig<?> config, AnnotatedClass ac, List<BeanPropertyWriter> properties)
Method for adding possible virtual properties to be serialized along with regular properties. |
| public VisibilityChecker | findAutoDetectVisibility(MapperConfig<?>
Effective mapper configuration in use config, AnnotatedClass Annotated class to introspect ac, VisibilityChecker checker)Method for checking if annotations indicate changes to minimum visibility levels needed for auto-detecting property elements (fields, methods, constructors). |
| public String | Returns: Human-readable description, if any.Effective mapper configuration in use config, AnnotatedClass Annotated class to introspect ac)Method used to check whether specified class defines a human-readable description to use for documentation. |
| public Object | findContentDeserializer(MapperConfig<?> config, Annotated am)
Method for getting a deserializer definition for content (values) of
associated |
| public Object | findContentSerializer(MapperConfig<?> config, Annotated am)
Method for getting a serializer definition for content (values) of
associated |
| public JsonCreator. | findCreatorAnnotation(MapperConfig<?>
Configuration settings in effect (for serialization or deserialization) config, Annotated Annotated accessor (usually constructor or static method) to check a)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 |
| public Enum | Returns: null if none found or it's not possible to determine one.The Enum class to scan for the default value. ac, Enum<?>[] The Enum values of the Enum class. enumValues)Finds the first Enum value that should be considered as default value for unknown Enum values, if present. |
| public Object | findDeserializationContentConverter(MapperConfig<?> config, AnnotatedMember
Annotated property (field, method) to check. a)Method for finding |
| public Object | findDeserializationConverter(MapperConfig<?> config, Annotated
Annotated property (field, method) or class to check for annotations a)Method for finding |
| public Object | findDeserializer(MapperConfig<?> config, Annotated am)
Method for getting a deserializer definition on specified method or field. |
| public void | findEnumAliases(MapperConfig<?>
The configuration of the mapper config, AnnotatedClass The annotated class of the enumeration type annotatedClass, Enum<?>[] The values of the enumeration enumValues, String[][] (in/out) Pre-allocated array where aliases found, if any, may be added (in indexes
matching those of aliases)enumValues)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 |
| public Object | Returns: Subclass or instance ofEnumNamingStrategy, if one
is specified for given class; null if not.Annotated class to introspect ac)Method for finding |
| public String[] | Returns: an array of names to use (possiblynames passed as argument)the mapper configuration to use config, AnnotatedClass the annotated class for which to find the explicit names annotatedClass, Enum<?>[] the set of enumValues, String[] Enum values to find the explicit names forthe matching declared names of enumeration values (with indexes matching
names)enumValues entries)Finds the explicitly defined name of the given set of |
| public Object | Returns: Id of the filter to use for filtering properties of annotated class, if any; or null if none found.Effective mapper configuration in use config, Annotated Annotated entity to introspect ann)Method for finding if annotated class has associated filter; and if so, to return id that is used to locate filter. |
| public JsonFormat. | findFormat(MapperConfig<?>
Effective mapper configuration in use config, Annotated memberOrClass)Method for finding format annotations for property or class. |
| public String | findImplicitPropertyName(MapperConfig<?>
Effective mapper configuration in use config, AnnotatedMember member)Method for finding implicit name for a property that given annotated member (field, method, creator parameter) may represent. |
| public JacksonInject. | Returns: Identifier of value to inject, if any; null if no injection indicator is foundEffective mapper configuration in use config, AnnotatedMember Member to check for information member)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 am)
Method for getting a deserializer definition for keys of
associated |
| public Object | findKeySerializer(MapperConfig<?> config, Annotated am)
Method for getting a serializer definition for keys of associated |
| public Boolean | findMergeInfo(MapperConfig<?> config, Annotated a)
Method for finding merge settings for property, if any. |
| public PropertyName | Returns: Name to use if found; null if not.Annotated entity to check ann)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 | Returns: Name to use if found; null if not.Property accessor to check a)Method for checking whether given property accessors (method, field) has an annotation that suggests property name to use for serialization. |
| public Object | Returns: Sub-class or instance ofPropertyNamingStrategy, if one
is specified for given class; null if not.Effective mapper configuration in use config, AnnotatedClass Annotated class to introspect ac)Method for finding |
| public Object | findNullSerializer(MapperConfig<?> config, Annotated am)
Method for getting a serializer definition for serializer to use for nulls (null values) of associated property or type. |
| public ObjectIdInfo | Returns: Details of Object Id as explained above, if Object Id handling to be applied;null otherwise.Effective mapper configuration in use config, Annotated Annotated entity to introspect ann)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 | Returns: ObjectIdInfo augmented with possible additional informationEffective mapper configuration in use config, Annotated Annotated entity to introspect ann, ObjectIdInfo (optional) Base Object Id information, if any; objectIdInfo)null if noneMethod for figuring out additional properties of an Object Identity reference |
| public Class | findPOJOBuilder(MapperConfig<?> config, AnnotatedClass
Annotated class to introspect ac)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. | |
| public JsonTypeInfo. | findPolymorphicTypeInfo(MapperConfig<?>
Effective mapper configuration in use config, Annotated Annotated entity to introspect ann)Method for checking whether given Class or Property Accessor specifies polymorphic type-handling information, to indicate need for polymorphic handling. |
| public PotentialCreator | Returns: Default Creator to possibly use forvalueClass, if one can be
determined; null if not.Configuration settings in effect (for deserialization) config, AnnotatedClass Class being instantiated; defines Creators passed valueClass, List<PotentialCreator> Constructors value class declares (EXCEPT possible
0-parameter ("default") constructor which is passed separately) declaredConstructors, List<PotentialCreator> Factory methods value class declares declaredFactories, Optional<PotentialCreator> 0-parameter ("default") constructor, if class has one. zeroParamsConstructor)Method called to check if introspector can find a Creator it considers
its "Preferred Creator": Creator to use as the primary one, when no Creator has
explicit annotation ( |
| public JsonProperty. | findPropertyAccess(MapperConfig<?>
Effective mapper configuration in use config, Annotated ann)Method for finding optional access definition for a property, annotated on one of its accessors. |
| public List | Returns: `null` if member has no information; otherwise a `List` (possibly empty) of aliases to use.Effective mapper configuration in use config, Annotated ann)Method called to find if given property has alias(es) defined. |
| public String | findPropertyDefaultValue(MapperConfig<?>
Effective mapper configuration in use config, Annotated ann)Method for finding suggested default value (as simple textual serialization) for the property. |
| public String | Returns: Human-readable description, if any.Effective mapper configuration in use config, Annotated ann)Method used to check whether specified property member (accessor or mutator) defines human-readable description to use for documentation. |
| public JsonIgnoreProperties. | findPropertyIgnoralByName(MapperConfig<?>
Configuration settings in effect (for serialization or deserialization) config, Annotated Annotated entity (Class, Accessor) to introspect ann)Method for finding information about properties to ignore either by name, or by more general specification ("ignore all unknown"). |
| public JsonInclude. | findPropertyInclusion(MapperConfig<?> config, Annotated a)
Method for checking inclusion criteria for a type (Class) or property (yes, method name is bit unfortunate -- not just for properties!). |
| public JsonIncludeProperties. | findPropertyInclusionByName(MapperConfig<?>
Configuration settings in effect (for serialization or deserialization) config, Annotated Annotated entity (Class, Accessor) to introspect ann)Method for finding information about names of properties to included. |
| public Integer | Returns: Explicitly specified index for the property, if anyEffective mapper configuration in use config, Annotated ann)Method used to check whether specified property member (accessor or mutator) defines numeric index, and if so, what is the index value. |
| public AnnotationIntrospector. | findReferenceType(MapperConfig<?>
Effective mapper configuration in use config, AnnotatedMember Member to check for information member)Method for checking if given member indicates that it is part of a reference (parent/child). |
| public PropertyName | Returns: Name used to find other accessors to rename, if any;null to indicate
no renamingEffective mapper configuration in use config, AnnotatedField Field to check f, PropertyName Implicit name of the field; usually name of field itself but not always,
used as the target name for accessors to rename. implName)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<?>
Effective mapper configuration in use config, AnnotatedClass Annotated class to introspect ac)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
Annotated property (field, method) to check. a)Method for finding |
| public Object | findSerializationConverter(MapperConfig<?> config, Annotated
Annotated property (field, method) or class to check for annotations a)Method for finding |
| public String[] | findSerializationPropertyOrder(MapperConfig<?> config, AnnotatedClass ac)
Method for accessing defined property serialization order (which may be partial). |
| public Boolean | findSerializationSortAlphabetically(MapperConfig<?> config, Annotated ann)
Method for checking whether an annotation indicates that serialized properties for which no explicit is defined should be alphabetically (lexicograpically) ordered |
| public JsonSerialize. | Returns: Typing mode to use, if annotation is found; null otherwiseMethod for accessing declared typing mode annotated (if any). |
| public Object | findSerializer(MapperConfig<?> config, Annotated am)
Method for getting a serializer definition on specified method or field. |
| public JsonSetter. | findSetterInfo(MapperConfig<?> config, Annotated a)
Method for finding possible settings for property, given annotations on an accessor. |
| public List | findSubtypes(MapperConfig<?>
Effective mapper configuration in use config, Annotated Annotated entity (class, field/method) to check for annotations a)Method for locating annotation-specified subtypes related to annotated entity (class, method, field). |
| public Object | findTypeIdResolver(MapperConfig<?>
Effective mapper configuration in use config, Annotated Annotated entity to introspect ann)
|
| public String | findTypeName(MapperConfig<?>
Effective mapper configuration in use config, AnnotatedClass Class to check for type name annotations ac)Method for checking if specified type has explicit name. |
| public Object | findTypeResolverBuilder(MapperConfig<?>
Effective mapper configuration in use config, Annotated Annotated entity to introspect ann)
|
| public NameTransformer | findUnwrappingNameTransformer(MapperConfig<?>
Effective mapper configuration in use config, AnnotatedMember Member to check for information member)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
Annotated class to introspect ac)Method getting |
| public Class | Returns: Array of views (represented by classes) that the property is included in; if null, always included (same as returning array containingObject.class)Effective mapper configuration in use config, Annotated Annotated property (represented by a method, field or ctor parameter) a)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 PropertyName | Returns: Wrapper name to use, if any, orPropertyName#USE_DEFAULT
to indicate that no wrapper element should be used.Effective mapper configuration in use config, Annotated ann)Method used to check if specified property has annotation that indicates that it should be wrapped in an element; and if so, name to use. |
| public Boolean | Returns: True if such annotation is found (and is not disabled), false otherwiseAnnotated entity to check ann)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 | Returns: True if such annotation is found (and is not disabled), false otherwiseAnnotated entity to check ann)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 | Returns: Boolean#TRUE if such annotation is found and is not disabled;
Boolean#FALSE if disabled annotation (block) is found (to indicate
accessor is definitely NOT to be used "as value"); or `null` if no
information found.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 | Returns: Boolean#TRUE if such annotation is found and is not disabled;
Boolean#FALSE if disabled annotation (block) is found (to indicate
accessor is definitely NOT to be used "as value"); or `null` if no
information found.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<?>
Effective mapper configuration in use config, AnnotatedMember Member to check for information member)Method called to check whether given property is marked to be ignored. |
| public Boolean | hasRequiredMarker(MapperConfig<?>
Effective mapper configuration in use config, AnnotatedMember Member to check for information member)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 | Returns: True if given annotation is considered an annotation bundle; false if notAnnotated entity to introspect ann)Method for checking whether given annotation is considered an annotation bundle: if so, all meta-annotations it has will be used instead of annotation ("bundle") itself. |
| public Boolean | Returns: Boolean.TRUE if properties of type should be ignored; Boolean.FALSE if they are not to be ignored, null for default handling (which is 'do not ignore')Effective mapper configuration in use config, AnnotatedClass Annotated class to introspect ac)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<?>
Effective mapper configuration in use config, AnnotatedMember Member to check for type id information member)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. |
| public static AnnotationIntrospector | Returns: "no operation" instanceFactory method for accessing "no operation" implementation of introspector: instance that will never find any annotation-based configuration. |
| public static AnnotationIntrospector | |
| public JavaType | refineDeserializationType(MapperConfig<?> config, final Annotated a, final JavaType baseType)
Method called to find out possible type refinements to use for deserialization. |
| public JavaType | refineSerializationType(final MapperConfig<?> config, final Annotated a, final JavaType baseType)
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<?>
Effective mapper configuration in use config, AnnotatedMethod setter1, AnnotatedMethod setter2)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 abstract Version | version()
Redeclares tools. 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 |