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.ReferenceProperty
Value type used with managed and back references; contains type and logic name, used to link related references |
| public static interface | AnnotationIntrospector.XmlExtensions
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 < Annotation type being checked 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 | Returns: Visibility settings after possible annotation-based overridesAnnotated class to introspect ac, VisibilityChecker<?> Default visibility settings in effect before any override 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.Annotated class to introspect ac)Method used to check whether specified class defines a human-readable description to use for documentation. |
| public Object | findContentDeserializer(Annotated am)
Method for getting a deserializer definition for content (values) of
associated |
| public Object | findContentSerializer(Annotated am)
Method for getting a serializer definition for content (values) of
associated |
| public JsonCreator. | Returns: Creator mode found, if any;null if noneConfiguration settings in effect (for serialization or deserialization) config, Annotated Annotated accessor (usually constructor or static method) to check ann)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 JsonCreator. | Returns: Creator mode found, if any;null if noneAnnotated entity to check ann)
Deprecated
Since 2.9 use
Method for finding indication of creator binding mode for
a creator (something for which findCreatorAnnotation instead.
hasCreatorAnnotation returns
true), for cases where there may be ambiguity (currently: single-argument
creator with implicit but no explicit name for the argument).
|
| 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 Enum | Returns: null if none found or it's not possible to determine oneThe Enum class to scan for the default value enumCls)
Deprecated
Since 2.16.
Finds the Enum value that should be considered the default value, if possible.
|
| public Object | findDeserializationContentConverter(AnnotatedMember
Annotated property (field, method) to check. a)Method for finding |
| public Object | findDeserializationConverter(Annotated
Annotated property (field, method) or class to check for
annotations a)Method for finding |
| public Object | findDeserializer(Annotated am)
Method for getting a deserializer definition on specified method or field. |
| public void | findEnumAliases(Class<?>
Type of Enumeration enumType, Enum<?>[] Values of enumeration enumValues, String[][] (in/out) Pre-allocated array where aliases found, if any, may be
added (in indexes matching those of aliases)enumValues)
Deprecated
Since 2.16
Method that is related to findEnumValues but is called to check if
there are alternative names (aliased) that can be accepted for entries, in
addition to primary names introspected earlier.
|
| 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: Serialized enum value.Enum value to introspect value)
Deprecated
Since 2.8: use
Method for determining the String value to use for serializing
given enumeration entry; used when serializing enumerations
as Strings (the standard method).
findEnumValues instead because this method
does not properly handle override settings (defaults to enum.name
without indicating whether that is explicit or not), and is inefficient to
call one-by-one.
|
| public String[] | Returns: Array of names to use (possiblenames passed as argument)Type of Enumeration enumType, Enum<?>[] Values of enumeration enumValues, String[] Matching declared names of enumeration values (with indexes
matching names)enumValues entries)
Deprecated
Since 2.16
Method for efficiently figuring out which if given set of Enum values
have explicitly defined name.
|
| 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.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. | |
| public Boolean | Returns: True if class has something indicating "ignore [all] unknown properties"Annotated class to introspect ac)
Deprecated
Since 2.8, use
Method for checking whether an annotation indicates that all unknown properties
should be ignored.
findPropertyIgnoralByName instead
|
| public String | findImplicitPropertyName(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 foundMember to check m)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 | |
| public Object | findKeyDeserializer(Annotated am)
Method for getting a deserializer definition for keys of
associated |
| public Object | findKeySerializer(Annotated am)
Method for getting a serializer definition for keys of associated |
| public Boolean | Returns: Boolean.TRUE or Boolean.FALSE if explicit
merge enable/disable found; null otherwise.Annotated entity to check ann)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.Annotated class to introspect ac)Method for finding |
| public Object | findNullSerializer(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.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 informationAnnotated 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 | Returns: Builder class to use, if annotation found;null if not.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. | Returns: Builder settings to use, if any found;null if not.Annotated class to introspect ac)
|
| 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 String[] | Returns: Array of names of properties to ignoreAnnotated class to introspect ac, boolean True if requesting properties to ignore for serialization;
false if for deserialization forSerialization)
Deprecated
Since 2.8, use
findPropertyIgnoralByName instead
|
| public JsonProperty. | findPropertyAccess(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.Method called to find if given property has alias(es) defined. |
| public TypeResolverBuilder | Returns: Type resolver builder for values contained in properties of given entity, if one found; null if noneConfiguration settings in effect (for serialization or deserialization) config, AnnotatedMember Annotated member (field or method) to check for annotations am, JavaType Type of property for which resolver is to be found (must be a container type) containerType)Method for checking if given structured property entity (field or method that has nominal value of Map, Collection or array type) has annotations that indicate that specific type resolver is to be used for handling type information of contained values. |
| public String | findPropertyDefaultValue(Annotated ann)
Method for finding suggested default value (as simple textual serialization) for the property. |
| public String | Returns: Human-readable description, if any.Method used to check whether specified property member (accessor or mutator) defines human-readable description to use for documentation. |
| public JsonIgnoreProperties. | Returns: Property ignoral settings to use;JsonIgnoreProperties.Value.empty() for defaults (should not return null)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 JsonIgnoreProperties. | Returns: Property ignoral settings to use;JsonIgnoreProperties.Value.empty() for defaults (should not return null)Annotated class to introspect ac)
Deprecated
2.12, use
findPropertyIgnoralByName instead.
|
| public JsonInclude. | findPropertyInclusion(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. | Returns: Property inclusion settings to use;JsonIncludeProperties.Value.all() for defaults (should not return null)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 anyMethod used to check whether specified property member (accessor or mutator) defines numeric index, and if so, what is the index value. |
| public TypeResolverBuilder | Returns: Type resolver builder for properties of given entity, if one found; null if noneConfiguration settings in effect (for serialization or deserialization) config, AnnotatedMember Annotated member (field or method) to check for annotations am, JavaType Base java type of property for which resolver is to be found baseType)Method for checking if given property entity (field or method) has annotations that indicate that specific type resolver is to be used for handling instances. |
| public AnnotationIntrospector. | findReferenceType(AnnotatedMember 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 | Returns: Root name to use, if any;null if notAnnotated 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(AnnotatedMember
Annotated property (field, method) to check. a)Method for finding |
| public Object | findSerializationConverter(Annotated
Annotated property (field, method) or class to check for
annotations a)Method for finding |
| public String[] | findSerializationPropertyOrder(AnnotatedClass ac)
Method for accessing defined property serialization order (which may be partial). |
| public Boolean | findSerializationSortAlphabetically(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(Annotated am)
Method for getting a serializer definition on specified method or field. |
| public JsonSetter. | Returns: Setter info value found, if any;JsonSetter.Value.empty() if none (should not return null)Annotated entity to check ann)Method for finding possible settings for property, given annotations on an accessor. |
| public List | Returns: List of subtype definitions found if any;null if noneAnnotated entity (class, field/method) to check for annotations a)Method for locating annotation-specified subtypes related to annotated entity (class, method, field). |
| public String | Returns: Explicit type name (aka Type Id) found, if any;null if noneClass to check for type name annotations ac)Method for checking if specified type has explicit name. |
| public TypeResolverBuilder | Returns: Type resolver builder for given type, if one found; null if noneConfiguration settings in effect (for serialization or deserialization) config, AnnotatedClass Annotated class to check for annotations ac, JavaType Base java type of value for which resolver is to be found baseType)Method for checking if given class has annotations that indicate that specific type resolver is to be used for handling instances. |
| public NameTransformer | findUnwrappingNameTransformer(AnnotatedMember 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 | Returns: EitherValueInstantiator instance to use, or
Class of one to create; or null if no annotations
found to indicate custom value instantiator.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)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.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 | hasAnyGetterAnnotation(AnnotatedMethod
Annotated method to check am)
Deprecated
Since 2.9 Use
hasAnyGetter instead
|
| public Boolean | Returns: Boolean.TRUE or Boolean.FALSE if explicit
"any setter" marker found; null otherwise.Annotated 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: true if "any-setter" annotation was found; false otherwiseAnnotated method to check am)
Deprecated
Since 2.9 use
hasAnySetter instead.
|
| 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 | hasAsValueAnnotation(AnnotatedMethod
Annotated method to check am)
Deprecated
Since 2.9 Use
hasAsValue(Annotated) instead.
|
| public boolean | Returns: True if such annotation is found (and is not disabled), false otherwiseAnnotated entity to check ann)
Deprecated
Since 2.9 use
Method for checking whether given annotated item (method, constructor)
has an annotation
that suggests that the method is a "creator" (aka factory)
method to be used for construct new instances of deserialized
values.
findCreatorAnnotation instead.
|
| public boolean | hasIgnoreMarker(AnnotatedMember m)
Method called to check whether given property is marked to be ignored. |
| public Boolean | hasRequiredMarker(AnnotatedMember m)
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')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 | Returns: Boolean to indicate whether member is a type id or not, if annotation found;null if no information found.Annotated accessor (field/method/constructor parameter) to check for annotations am)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(final 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<?> 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 com. Version for details).
|