Class JakartaXmlBindAnnotationIntrospector
- java.lang.Object
-
- com.fasterxml.jackson.databind.AnnotationIntrospector
-
- com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationIntrospector
-
- All Implemented Interfaces:
Versioned,AnnotationIntrospector.XmlExtensions,Serializable
public class JakartaXmlBindAnnotationIntrospector extends AnnotationIntrospector implements AnnotationIntrospector.XmlExtensions, Versioned
Annotation introspector that uses Jakarta Xml Bind annotations (nee "JAXB" Annotations") where applicable for jackson-databind to use. As of Jackson 2.x, majority of XmlBind annotations are supported to some degree. Ones that are NOT yet supported are:XmlAnyAttributenot supported; possible (if unlikely) to be used (as an alias for@JsonAnySetter)XmlAnyElementnot supported; unlikely to ever be supported.XmlAttachmentRef: JSON does not support external attachmentsXmlElementDeclXmlElementRefsbecause Jackson doesn't have any support for 'named' collection itemsXmlInlineBinaryDatasince the underlying concepts (like XOP) do not exist in JSON -- Jackson will always use inline base64 encoding as the methodXmlListbecause JSON does not have (or necessarily need) method of serializing list of values as space-separated StringsXmlMimeTypeXmlMixedsince JSON has no concept of mixed contentXmlRegistrynot supported, unlikely to ever be.XmlSchemanot supported, unlikely to ever be.XmlSchemaTypenot supported, unlikely to ever be.XmlSchemaTypesnot supported, unlikely to ever be.XmlSeeAlsonot supported.
- Any property annotated with
XmlValuewill have implicit property named 'value' on its JSON object; although it should be possible to override this name
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.AnnotationIntrospector
AnnotationIntrospector.ReferenceProperty, AnnotationIntrospector.XmlExtensions
-
-
Field Summary
Fields Modifier and Type Field Description protected JsonDeserializer<?>_dataHandlerDeserializerprotected JsonSerializer<?>_dataHandlerSerializerprotected boolean_ignoreXmlIDREFprotected String_jaxbPackageNameprotected JsonInclude.Include_nonNillableInclusionInclusion value to return for properties annotated withXmlElementandXmlElementWrapper, in casenillableproperty is left asfalse.protected TypeFactory_typeFactoryprotected String_xmlValueNameWhen usingXmlValueannotation, a placeholder name is assigned to property (unless overridden by explicit name); this configuration value specified what that name is.protected static booleanDEFAULT_IGNORE_XMLIDREFprotected static StringDEFAULT_NAME_FOR_XML_VALUEprotected static JsonFormat.ValueFORMAT_INTprotected static JsonFormat.ValueFORMAT_STRINGprotected static StringMARKER_FOR_DEFAULT
-
Constructor Summary
Constructors Constructor Description JakartaXmlBindAnnotationIntrospector()Deprecated.Since 2.1, use constructor that takes TypeFactory.JakartaXmlBindAnnotationIntrospector(MapperConfig<?> config)JakartaXmlBindAnnotationIntrospector(TypeFactory typeFactory)JakartaXmlBindAnnotationIntrospector(TypeFactory typeFactory, boolean ignoreXmlIDREF)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Converter<Object,Object>_converter(XmlAdapter<?,?> adapter, boolean forSerialization)protected String_decapitalize(String name)protected Class<?>_doFindDeserializationType(Annotated a, JavaType baseType)protected XmlAdapter<?,?>_findContentAdapter(Annotated ann, boolean forSerialization)protected JavaType_fullDeserializationType(AnnotatedMember am)protected JavaType_fullSerializationType(AnnotatedMember am)protected Class<?>_getTypeFromXmlElement(Annotated a)protected String_okNameForGetter(AnnotatedMethod am)protected String_okNameForMutator(AnnotatedMethod am)protected String_propertyNameToString(PropertyName n)protected Class<?>_rawDeserializationType(Annotated a)protected Class<?>_rawSerializationType(Annotated a)protected String_stdManglePropertyName(String basename, int offset)protected TypeResolverBuilder<?>_typeResolverFromXmlElements(AnnotatedMember am)protected XmlAccessTypefindAccessType(Annotated ac)Method for locating JAXBXmlAccessTypeannotation value for given annotated entity, if it has one, or inherits one from its ancestors (in JAXB sense, package etc).VisibilityChecker<?>findAutoDetectVisibility(AnnotatedClass ac, VisibilityChecker<?> checker)Method for checking if annotations indicate changes to minimum visibility levels needed for auto-detecting property elements (fields, methods, constructors).ObjectfindContentDeserializer(Annotated a)Method for getting a deserializer definition for content (values) of associatedCollection,arrayorMapproperty.ObjectfindContentSerializer(Annotated a)Method for getting a serializer definition for content (values) of associatedCollection,arrayorMapproperty.ObjectfindDeserializationContentConverter(AnnotatedMember a)Method for findingConverterthat 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).ObjectfindDeserializationConverter(Annotated a)Method for findingConverterthat annotated entity (property or class) has indicated to be used as part of deserialization.ObjectfindDeserializer(Annotated am)Method for getting a deserializer definition on specified method or field.String[]findEnumValues(Class<?> enumType, Enum<?>[] enumValues, String[] names)Method for efficiently figuring out which if given set ofEnumvalues have explicitly defined name.JsonFormat.ValuefindFormat(Annotated m)Method for finding format annotations for property or class.StringfindImplicitPropertyName(AnnotatedMember m)Method for finding implicit name for a property that given annotated member (field, method, creator parameter) may represent.ObjectfindKeyDeserializer(Annotated am)Method for getting a deserializer definition for keys of associatedMapproperty.PropertyNamefindNameForDeserialization(Annotated a)Method for checking whether given property accessors (method, field) has an annotation that suggests property name to use for deserialization (reading JSON into POJOs).PropertyNamefindNameForSerialization(Annotated a)Method for checking whether given property accessors (method, field) has an annotation that suggests property name to use for serialization.StringfindNamespace(MapperConfig<?> config, Annotated ann)Method that can be called to figure out generic namespace property for an annotated object.ObjectIdInfofindObjectIdInfo(Annotated 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.ObjectIdInfofindObjectReferenceInfo(Annotated ann, ObjectIdInfo base)Method for figuring out additional properties of an Object Identity referenceTypeResolverBuilder<?>findPropertyContentTypeResolver(MapperConfig<?> config, AnnotatedMember am, JavaType 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.JsonInclude.ValuefindPropertyInclusion(Annotated a)Method for checking inclusion criteria for a type (Class) or property (yes, method name is bit unfortunate -- not just for properties!).TypeResolverBuilder<?>findPropertyTypeResolver(MapperConfig<?> config, AnnotatedMember am, JavaType 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.PropertyNamefindRootName(AnnotatedClass 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.ObjectfindSerializationContentConverter(AnnotatedMember a)Method for findingConverterthat 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).ObjectfindSerializationConverter(Annotated a)Method for findingConverterthat annotated entity (property or class) has indicated to be used as part of serialization.String[]findSerializationPropertyOrder(AnnotatedClass ac)Method for accessing defined property serialization order (which may be partial).BooleanfindSerializationSortAlphabetically(Annotated ann)Method for checking whether an annotation indicates that serialized properties for which no explicit is defined should be alphabetically (lexicograpically) orderedJsonSerializer<?>findSerializer(Annotated am)Method for getting a serializer definition on specified method or field.List<NamedType>findSubtypes(Annotated a)Method for locating annotation-specified subtypes related to annotated entity (class, method, field).StringfindTypeName(AnnotatedClass ac)Method for checking if specified type has explicit name.TypeResolverBuilder<?>findTypeResolver(MapperConfig<?> config, AnnotatedClass ac, JavaType baseType)Method for checking if given class has annotations that indicate that specific type resolver is to be used for handling instances.PropertyNamefindWrapperName(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.StringgetNameUsedForXmlValue()Accessor for getting currently configured placeholder named used for property annotated withXmlValue.JsonInclude.IncludegetNonNillableInclusion()protected TypeFactorygetTypeFactory()booleanhasIgnoreMarker(AnnotatedMember m)Method called to check whether given property is marked to be ignored.BooleanhasRequiredMarker(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.BooleanisIgnorableType(AnnotatedClass ac)Method for checking whether properties that have specified type (class, not generics aware) should be completely ignored for serialization and deserialization purposes.protected booleanisJAXBAnnotation(Annotation ann)An annotation is handled if it's in the same package as @XmlElement, including subpackages.BooleanisOutputAsAttribute(MapperConfig<?> config, Annotated ann)Here we assume fairly simple logic; if there isXmlAttributeto be found, we consider it an attribute; ifXmlElement, not-an-attribute; and otherwise we will consider there to be no information.BooleanisOutputAsCData(MapperConfig<?> config, Annotated ann)Method used to check whether given annotated element (field, method, constructor parameter) has indicator that suggests it should be wrapped in a CDATA tag.BooleanisOutputAsText(MapperConfig<?> config, Annotated ann)Method used to check whether given annotated element (field, method, constructor parameter) has indicator that suggests it should be serialized as text, without element wrapper.JavaTyperefineDeserializationType(MapperConfig<?> config, Annotated a, JavaType baseType)Method called to find out possible type refinements to use for deserialization.JavaTyperefineSerializationType(MapperConfig<?> config, Annotated a, 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.voidsetNameUsedForXmlValue(String name)Configuration method that can be used to change default name ("value") used for properties annotated withXmlValue; note that setting it tonullwill actually avoid name override, and name will instead be derived from underlying method name using standard bean name introspection.JakartaXmlBindAnnotationIntrospectorsetNonNillableInclusion(JsonInclude.Include incl)Method to call to change inclusion criteria used for property annotated withXmlElementorXmlElementWrapper, withnillableset asfalse.Versionversion()Method that will return version information stored in and read from jar that contains this class.-
Methods inherited from class com.fasterxml.jackson.databind.AnnotationIntrospector
_findAnnotation, _hasAnnotation, _hasOneOf, allIntrospectors, allIntrospectors, findAndAddVirtualProperties, findClassDescription, findCreatorAnnotation, findCreatorBinding, findDefaultEnumValue, findEnumAliases, findEnumNamingStrategy, findEnumValue, findFilterId, findIgnoreUnknownProperties, findInjectableValue, findInjectableValueId, findKeySerializer, findMergeInfo, findNamingStrategy, findNullSerializer, findPOJOBuilder, findPOJOBuilderConfig, findPropertiesToIgnore, findPropertyAccess, findPropertyAliases, findPropertyDefaultValue, findPropertyDescription, findPropertyIgnoralByName, findPropertyIgnorals, findPropertyInclusionByName, findPropertyIndex, findReferenceType, findRenameByField, findSerializationTyping, findSetterInfo, findUnwrappingNameTransformer, findValueInstantiator, findViews, hasAnyGetter, hasAnyGetterAnnotation, hasAnySetter, hasAnySetterAnnotation, hasAsKey, hasAsValue, hasAsValueAnnotation, hasCreatorAnnotation, isAnnotationBundle, isTypeId, nopInstance, pair, resolveSetterConflict
-
-
-
-
Field Detail
-
DEFAULT_NAME_FOR_XML_VALUE
protected static final String DEFAULT_NAME_FOR_XML_VALUE
- See Also:
- Constant Field Values
-
DEFAULT_IGNORE_XMLIDREF
protected static final boolean DEFAULT_IGNORE_XMLIDREF
- See Also:
- Constant Field Values
-
MARKER_FOR_DEFAULT
protected static final String MARKER_FOR_DEFAULT
- See Also:
- Constant Field Values
-
FORMAT_STRING
protected static final JsonFormat.Value FORMAT_STRING
-
FORMAT_INT
protected static final JsonFormat.Value FORMAT_INT
-
_jaxbPackageName
protected final String _jaxbPackageName
-
_dataHandlerSerializer
protected final JsonSerializer<?> _dataHandlerSerializer
-
_dataHandlerDeserializer
protected final JsonDeserializer<?> _dataHandlerDeserializer
-
_typeFactory
protected final TypeFactory _typeFactory
-
_ignoreXmlIDREF
protected final boolean _ignoreXmlIDREF
-
_xmlValueName
protected String _xmlValueName
When usingXmlValueannotation, a placeholder name is assigned to property (unless overridden by explicit name); this configuration value specified what that name is.
-
_nonNillableInclusion
protected JsonInclude.Include _nonNillableInclusion
Inclusion value to return for properties annotated withXmlElementandXmlElementWrapper, in casenillableproperty is left asfalse. Default setting isnull; this is typically changed to eitherJsonInclude.Include.NON_NULLorJsonInclude.Include.NON_EMPTY.- Since:
- 2.7
-
-
Constructor Detail
-
JakartaXmlBindAnnotationIntrospector
@Deprecated public JakartaXmlBindAnnotationIntrospector()
Deprecated.Since 2.1, use constructor that takes TypeFactory.
-
JakartaXmlBindAnnotationIntrospector
public JakartaXmlBindAnnotationIntrospector(MapperConfig<?> config)
-
JakartaXmlBindAnnotationIntrospector
public JakartaXmlBindAnnotationIntrospector(TypeFactory typeFactory)
-
JakartaXmlBindAnnotationIntrospector
public JakartaXmlBindAnnotationIntrospector(TypeFactory typeFactory, boolean ignoreXmlIDREF)
- Parameters:
typeFactory- Type factory used for resolving type informationignoreXmlIDREF- WhetherXmlIDREFannotation should be processed JAXB style (meaning that references are always serialized using id), or not (first reference as full POJO, others as ids)
-
-
Method Detail
-
version
public Version version()
Method that will return version information stored in and read from jar that contains this class.- Specified by:
versionin interfaceVersioned- Specified by:
versionin classAnnotationIntrospector- Returns:
- Version of the component
-
setNameUsedForXmlValue
public void setNameUsedForXmlValue(String name)
Configuration method that can be used to change default name ("value") used for properties annotated withXmlValue; note that setting it tonullwill actually avoid name override, and name will instead be derived from underlying method name using standard bean name introspection.
-
getNameUsedForXmlValue
public String getNameUsedForXmlValue()
Accessor for getting currently configured placeholder named used for property annotated withXmlValue.
-
setNonNillableInclusion
public JakartaXmlBindAnnotationIntrospector setNonNillableInclusion(JsonInclude.Include incl)
Method to call to change inclusion criteria used for property annotated withXmlElementorXmlElementWrapper, withnillableset asfalse.- Since:
- 2.7
-
getNonNillableInclusion
public JsonInclude.Include getNonNillableInclusion()
- Since:
- 2.7
-
findNamespace
public String findNamespace(MapperConfig<?> config, Annotated ann)
Description copied from interface:AnnotationIntrospector.XmlExtensionsMethod that can be called to figure out generic namespace property for an annotated object.- Specified by:
findNamespacein interfaceAnnotationIntrospector.XmlExtensions- Parameters:
config- Configuration settings in effectann- Annotated entity to introspect- Returns:
- Null if annotated thing does not define any namespace information; non-null namespace (which may be empty String) otherwise.
-
isOutputAsAttribute
public Boolean isOutputAsAttribute(MapperConfig<?> config, Annotated ann)
Here we assume fairly simple logic; if there isXmlAttributeto be found, we consider it an attribute; ifXmlElement, not-an-attribute; and otherwise we will consider there to be no information. Caller is likely to default to considering things as elements.- Specified by:
isOutputAsAttributein interfaceAnnotationIntrospector.XmlExtensions- Parameters:
config- Configuration settings in effectann- Annotated entity to introspect- Returns:
- Null if no indicator found;
TrueorFalseotherwise
-
isOutputAsText
public Boolean isOutputAsText(MapperConfig<?> config, Annotated ann)
Description copied from interface:AnnotationIntrospector.XmlExtensionsMethod used to check whether given annotated element (field, method, constructor parameter) has indicator that suggests it should be serialized as text, without element wrapper.- Specified by:
isOutputAsTextin interfaceAnnotationIntrospector.XmlExtensions- Parameters:
config- Configuration settings in effectann- Annotated entity to introspect- Returns:
- Null if no indicator found;
TrueorFalseotherwise
-
isOutputAsCData
public Boolean isOutputAsCData(MapperConfig<?> config, Annotated ann)
Description copied from interface:AnnotationIntrospector.XmlExtensionsMethod used to check whether given annotated element (field, method, constructor parameter) has indicator that suggests it should be wrapped in a CDATA tag.- Specified by:
isOutputAsCDatain interfaceAnnotationIntrospector.XmlExtensions- Parameters:
config- Configuration settings in effectann- Annotated entity to introspect- Returns:
- Null if no indicator found;
TrueorFalseotherwise
-
findObjectIdInfo
public ObjectIdInfo findObjectIdInfo(Annotated ann)
Description copied from class:AnnotationIntrospectorMethod 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.- Overrides:
findObjectIdInfoin classAnnotationIntrospector- Parameters:
ann- Annotated entity to introspect- Returns:
- Details of Object Id as explained above, if Object Id
handling to be applied;
nullotherwise.
-
findObjectReferenceInfo
public ObjectIdInfo findObjectReferenceInfo(Annotated ann, ObjectIdInfo base)
Description copied from class:AnnotationIntrospectorMethod for figuring out additional properties of an Object Identity reference- Overrides:
findObjectReferenceInfoin classAnnotationIntrospector- Parameters:
ann- Annotated entity to introspectbase- (optional) Base Object Id information, if any;nullif none- Returns:
ObjectIdInfoaugmented with possible additional information
-
findRootName
public PropertyName findRootName(AnnotatedClass ac)
Description copied from class:AnnotationIntrospectorMethod 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. Returns null if no declaration found; can return explicit empty String, which is usually ignored as well as null.NOTE: method signature changed in 2.1, to return
PropertyNameinstead of String.- Overrides:
findRootNamein classAnnotationIntrospector- Parameters:
ac- Annotated class to introspect- Returns:
- Root name to use, if any;
nullif not
-
isIgnorableType
public Boolean isIgnorableType(AnnotatedClass ac)
Description copied from class:AnnotationIntrospectorMethod for checking whether properties that have specified type (class, not generics aware) should be completely ignored for serialization and deserialization purposes.- Overrides:
isIgnorableTypein classAnnotationIntrospector- Parameters:
ac- Annotated class to introspect- 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')
-
hasIgnoreMarker
public boolean hasIgnoreMarker(AnnotatedMember m)
Description copied from class:AnnotationIntrospectorMethod 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).- Overrides:
hasIgnoreMarkerin classAnnotationIntrospector
-
hasRequiredMarker
public Boolean hasRequiredMarker(AnnotatedMember m)
Description copied from class:AnnotationIntrospectorMethod that can be called to check whether this member has an annotation that suggests whether value for matching property is required or not.- Overrides:
hasRequiredMarkerin classAnnotationIntrospector
-
findWrapperName
public PropertyName findWrapperName(Annotated ann)
Description copied from class:AnnotationIntrospectorMethod used to check if specified property has annotation that indicates that it should be wrapped in an element; and if so, name to use. Note that not all serializers and deserializers support use this method: currently (2.1) it is only used by XML-backed handlers.- Overrides:
findWrapperNamein classAnnotationIntrospector- Returns:
- Wrapper name to use, if any, or
PropertyName.USE_DEFAULTto indicate that no wrapper element should be used.
-
findImplicitPropertyName
public String findImplicitPropertyName(AnnotatedMember m)
Description copied from class:AnnotationIntrospectorMethod for finding implicit name for a property that given annotated member (field, method, creator parameter) may represent. This is different from explicit, annotation-based property name, in that it is "weak" and does not either proof that a property exists (for example, if visibility is not high enough), or override explicit names. In practice this method is used to introspect optional names for creator parameters (which may or may not be available and cannot be detected by standard databind); or to provide alternate name mangling for fields, getters and/or setters.- Overrides:
findImplicitPropertyNamein classAnnotationIntrospector
-
findFormat
public JsonFormat.Value findFormat(Annotated m)
Description copied from class:AnnotationIntrospectorMethod for finding format annotations for property or class. Return value is typically used by serializers and/or deserializers to customize presentation aspects of the serialized value.- Overrides:
findFormatin classAnnotationIntrospector
-
findAutoDetectVisibility
public VisibilityChecker<?> findAutoDetectVisibility(AnnotatedClass ac, VisibilityChecker<?> checker)
Description copied from class:AnnotationIntrospectorMethod for checking if annotations indicate changes to minimum visibility levels needed for auto-detecting property elements (fields, methods, constructors). A baseline checker is given, and introspector is to either return it as is (if no annotations are found), or build and return a derived instance (using checker's build methods).- Overrides:
findAutoDetectVisibilityin classAnnotationIntrospector- Parameters:
ac- Annotated class to introspectchecker- Default visibility settings in effect before any override- Returns:
- Visibility settings after possible annotation-based overrides
-
findAccessType
protected XmlAccessType findAccessType(Annotated ac)
Method for locating JAXBXmlAccessTypeannotation value for given annotated entity, if it has one, or inherits one from its ancestors (in JAXB sense, package etc). Returns null if nothing has been explicitly defined.
-
findTypeResolver
public TypeResolverBuilder<?> findTypeResolver(MapperConfig<?> config, AnnotatedClass ac, JavaType baseType)
Description copied from class:AnnotationIntrospectorMethod for checking if given class has annotations that indicate that specific type resolver is to be used for handling instances. This includes not only instantiating resolver builder, but also configuring it based on relevant annotations (not including ones checked with a call toAnnotationIntrospector.findSubtypes(com.fasterxml.jackson.databind.introspect.Annotated)- Overrides:
findTypeResolverin classAnnotationIntrospector- Parameters:
config- Configuration settings in effect (for serialization or deserialization)ac- Annotated class to check for annotationsbaseType- Base java type of value for which resolver is to be found- Returns:
- Type resolver builder for given type, if one found; null if none
-
findPropertyTypeResolver
public TypeResolverBuilder<?> findPropertyTypeResolver(MapperConfig<?> config, AnnotatedMember am, JavaType baseType)
Description copied from class:AnnotationIntrospectorMethod for checking if given property entity (field or method) has annotations that indicate that specific type resolver is to be used for handling instances. This includes not only instantiating resolver builder, but also configuring it based on relevant annotations (not including ones checked with a call toAnnotationIntrospector.findSubtypes(com.fasterxml.jackson.databind.introspect.Annotated)- Overrides:
findPropertyTypeResolverin classAnnotationIntrospector- Parameters:
config- Configuration settings in effect (for serialization or deserialization)am- Annotated member (field or method) to check for annotationsbaseType- Base java type of property for which resolver is to be found- Returns:
- Type resolver builder for properties of given entity, if one found; null if none
-
findPropertyContentTypeResolver
public TypeResolverBuilder<?> findPropertyContentTypeResolver(MapperConfig<?> config, AnnotatedMember am, JavaType containerType)
Description copied from class:AnnotationIntrospectorMethod 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. This includes not only instantiating resolver builder, but also configuring it based on relevant annotations (not including ones checked with a call toAnnotationIntrospector.findSubtypes(com.fasterxml.jackson.databind.introspect.Annotated)- Overrides:
findPropertyContentTypeResolverin classAnnotationIntrospector- Parameters:
config- Configuration settings in effect (for serialization or deserialization)am- Annotated member (field or method) to check for annotationscontainerType- Type of property for which resolver is to be found (must be a container type)- Returns:
- Type resolver builder for values contained in properties of given entity, if one found; null if none
-
_typeResolverFromXmlElements
protected TypeResolverBuilder<?> _typeResolverFromXmlElements(AnnotatedMember am)
-
findSubtypes
public List<NamedType> findSubtypes(Annotated a)
Description copied from class:AnnotationIntrospectorMethod 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)- Overrides:
findSubtypesin classAnnotationIntrospector- Parameters:
a- Annotated entity (class, field/method) to check for annotations- Returns:
- List of subtype definitions found if any;
nullif none
-
findTypeName
public String findTypeName(AnnotatedClass ac)
Description copied from class:AnnotationIntrospectorMethod for checking if specified type has explicit name.- Overrides:
findTypeNamein classAnnotationIntrospector- Parameters:
ac- Class to check for type name annotations- Returns:
- Explicit type name (aka Type Id) found, if any;
nullif none
-
findSerializer
public JsonSerializer<?> findSerializer(Annotated am)
Description copied from class:AnnotationIntrospectorMethod for getting a serializer definition on specified method or field. Type of definition is either instance (of typeJsonSerializer) or Class (ofClass<JsonSerializer>implementation subtype); if value of different type is returned, a runtime exception may be thrown by caller.- Overrides:
findSerializerin classAnnotationIntrospector
-
findContentSerializer
public Object findContentSerializer(Annotated a)
Description copied from class:AnnotationIntrospectorMethod for getting a serializer definition for content (values) of associatedCollection,arrayorMapproperty. Type of definition is either instance (of typeJsonSerializer) or Class (of typeClass<JsonSerializer>); if value of different type is returned, a runtime exception may be thrown by caller.- Overrides:
findContentSerializerin classAnnotationIntrospector
-
findPropertyInclusion
public JsonInclude.Value findPropertyInclusion(Annotated a)
Description copied from class:AnnotationIntrospectorMethod for checking inclusion criteria for a type (Class) or property (yes, method name is bit unfortunate -- not just for properties!). In case of class, acts as the default for properties POJO contains; for properties acts as override for class defaults and possible global defaults.- Overrides:
findPropertyInclusionin classAnnotationIntrospector
-
refineSerializationType
public JavaType refineSerializationType(MapperConfig<?> config, Annotated a, JavaType baseType) throws JsonMappingException
Description copied from class:AnnotationIntrospectorMethod 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.- Overrides:
refineSerializationTypein classAnnotationIntrospector- Throws:
JsonMappingException
-
findSerializationPropertyOrder
public String[] findSerializationPropertyOrder(AnnotatedClass ac)
Description copied from class:AnnotationIntrospectorMethod for accessing defined property serialization order (which may be partial). May return null if no ordering is defined.- Overrides:
findSerializationPropertyOrderin classAnnotationIntrospector
-
findSerializationSortAlphabetically
public Boolean findSerializationSortAlphabetically(Annotated ann)
Description copied from class:AnnotationIntrospectorMethod for checking whether an annotation indicates that serialized properties for which no explicit is defined should be alphabetically (lexicograpically) ordered- Overrides:
findSerializationSortAlphabeticallyin classAnnotationIntrospector
-
findSerializationConverter
public Object findSerializationConverter(Annotated a)
Description copied from class:AnnotationIntrospectorMethod for findingConverterthat annotated entity (property or class) has indicated to be used as part of serialization. If not null, either has to be actualConverterinstance, or class for such converter; and resulting converter will be used first to convert property value to converter target type, and then serializer for that type is used for actual serialization.This feature is typically used to convert internal values into types that Jackson can convert.
Note also that this feature does not necessarily work well with polymorphic type handling, or object identity handling; if such features are needed an explicit serializer is usually better way to handle serialization.
- Overrides:
findSerializationConverterin classAnnotationIntrospector- Parameters:
a- Annotated property (field, method) or class to check for annotations
-
findSerializationContentConverter
public Object findSerializationContentConverter(AnnotatedMember a)
Description copied from class:AnnotationIntrospectorMethod for findingConverterthat 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).If not null, either has to be actual
Converterinstance, or class for such converter; and resulting converter will be used first to convert property value to converter target type, and then serializer for that type is used for actual serialization.Other notes are same as those for
AnnotationIntrospector.findSerializationConverter(com.fasterxml.jackson.databind.introspect.Annotated)- Overrides:
findSerializationContentConverterin classAnnotationIntrospector- Parameters:
a- Annotated property (field, method) to check.
-
findNameForSerialization
public PropertyName findNameForSerialization(Annotated a)
Description copied from class:AnnotationIntrospectorMethod 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 (possiblyPropertyName.USE_DEFAULT, which means "use default heuristics").- Overrides:
findNameForSerializationin classAnnotationIntrospector- Parameters:
a- Property accessor to check- Returns:
- Name to use if found; null if not.
-
findEnumValues
public String[] findEnumValues(Class<?> enumType, Enum<?>[] enumValues, String[] names)
Description copied from class:AnnotationIntrospectorMethod for efficiently figuring out which if given set ofEnumvalues have explicitly defined name. Method will overwrite entries in incomingnamesarray with explicit names found, if any, leaving other entries unmodified.- Overrides:
findEnumValuesin classAnnotationIntrospector- Parameters:
enumType- Type of EnumerationenumValues- Values of enumerationnames- Matching declared names of enumeration values (with indexes matchingenumValuesentries)- Returns:
- Array of names to use (possible
namespassed as argument)
-
findDeserializer
public Object findDeserializer(Annotated am)
Description copied from class:AnnotationIntrospectorMethod for getting a deserializer definition on specified method or field. Type of definition is either instance (of typeJsonDeserializer) or Class (of typeClass&<JsonDeserializer>); type is returned, a runtime exception may be thrown by caller.- Overrides:
findDeserializerin classAnnotationIntrospector
-
findKeyDeserializer
public Object findKeyDeserializer(Annotated am)
Description copied from class:AnnotationIntrospectorMethod for getting a deserializer definition for keys of associatedMapproperty. Type of definition is either instance (of typeJsonDeserializer) or Class (of typeClass<JsonDeserializer>); if value of different type is returned, a runtime exception may be thrown by caller.- Overrides:
findKeyDeserializerin classAnnotationIntrospector
-
findContentDeserializer
public Object findContentDeserializer(Annotated a)
Description copied from class:AnnotationIntrospectorMethod for getting a deserializer definition for content (values) of associatedCollection,arrayorMapproperty. Type of definition is either instance (of typeJsonDeserializer) or Class (of typeClass<JsonDeserializer>); if value of different type is returned, a runtime exception may be thrown by caller.- Overrides:
findContentDeserializerin classAnnotationIntrospector
-
_doFindDeserializationType
protected Class<?> _doFindDeserializationType(Annotated a, JavaType baseType)
-
refineDeserializationType
public JavaType refineDeserializationType(MapperConfig<?> config, Annotated a, JavaType baseType) throws JsonMappingException
Description copied from class:AnnotationIntrospectorMethod called to find out possible type refinements to use for deserialization.- Overrides:
refineDeserializationTypein classAnnotationIntrospector- Throws:
JsonMappingException
-
findNameForDeserialization
public PropertyName findNameForDeserialization(Annotated a)
Description copied from class:AnnotationIntrospectorMethod 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 (possiblyPropertyName.USE_DEFAULT, which means "use default heuristics").- Overrides:
findNameForDeserializationin classAnnotationIntrospector- Parameters:
a- Annotated entity to check- Returns:
- Name to use if found;
nullif not.
-
findDeserializationConverter
public Object findDeserializationConverter(Annotated a)
Description copied from class:AnnotationIntrospectorMethod for findingConverterthat annotated entity (property or class) has indicated to be used as part of deserialization. If not null, either has to be actualConverterinstance, or class for such converter; and resulting converter will be used after Jackson has deserializer data into intermediate type (Converter input type), and Converter needs to convert this into its target type to be set as property value.This feature is typically used to convert intermediate Jackson types (that default deserializers can produce) into custom type instances.
Note also that this feature does not necessarily work well with polymorphic type handling, or object identity handling; if such features are needed an explicit deserializer is usually better way to handle deserialization.
- Overrides:
findDeserializationConverterin classAnnotationIntrospector- Parameters:
a- Annotated property (field, method) or class to check for annotations
-
findDeserializationContentConverter
public Object findDeserializationContentConverter(AnnotatedMember a)
Description copied from class:AnnotationIntrospectorMethod for findingConverterthat 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).If not null, either has to be actual
Converterinstance, or class for such converter; and resulting converter will be used after Jackson has deserializer data into intermediate type (Converter input type), and Converter needs to convert this into its target type to be set as property value.Other notes are same as those for
AnnotationIntrospector.findDeserializationConverter(com.fasterxml.jackson.databind.introspect.Annotated)- Overrides:
findDeserializationContentConverterin classAnnotationIntrospector- Parameters:
a- Annotated property (field, method) to check.
-
isJAXBAnnotation
protected boolean isJAXBAnnotation(Annotation ann)
An annotation is handled if it's in the same package as @XmlElement, including subpackages.- Parameters:
ann- The annotation.- Returns:
- Whether the annotation is in the JAXB package.
-
getTypeFactory
protected final TypeFactory getTypeFactory()
-
_findContentAdapter
protected XmlAdapter<?,?> _findContentAdapter(Annotated ann, boolean forSerialization)
-
_propertyNameToString
protected String _propertyNameToString(PropertyName n)
-
_fullDeserializationType
protected JavaType _fullDeserializationType(AnnotatedMember am)
-
_fullSerializationType
protected JavaType _fullSerializationType(AnnotatedMember am)
-
_converter
protected Converter<Object,Object> _converter(XmlAdapter<?,?> adapter, boolean forSerialization)
-
_okNameForGetter
protected String _okNameForGetter(AnnotatedMethod am)
-
_okNameForMutator
protected String _okNameForMutator(AnnotatedMethod am)
-
-