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

public Class JacksonXmlAnnotationIntrospector

extends JacksonAnnotationIntrospector
implements XmlAnnotationIntrospector
Class Inheritance
All Implemented Interfaces
tools.jackson.dataformat.xml.XmlAnnotationIntrospector, tools.jackson.databind.AnnotationIntrospector.XmlExtensions
Imports
java.lang.annotation.Annotation, com.fasterxml.jackson.annotation.JsonProperty, tools.jackson.databind.PropertyName, tools.jackson.databind.cfg.MapperConfig, tools.jackson.databind.introspect.*, tools.jackson.dataformat.xml.annotation.*

Extension of JacksonAnnotationIntrospector that is needed to support additional xml-specific annotation that Jackson provides. Note, however, that there is no JAXB annotation support here; that is provided with separate introspector (see https://github.com/FasterXML/jackson-modules-base/tree/master/jaxb, class com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector).

Field Summary

Modifier and TypeField and Description
protected boolean
private static final Class<? extends Annotation>[]
public static final boolean
DEFAULT_USE_WRAPPER

For backwards compatibility with 2.0, the default behavior is to assume use of List wrapper if no annotations are used.

private static final long
Inherited from tools.jackson.databind.introspect.JacksonAnnotationIntrospector:
_annotationsInside_cfgConstructorPropertiesImpliesCreator

Constructor Summary

AccessConstructor and Description
public
public
JacksonXmlAnnotationIntrospector(boolean defaultUseWrapper)

Method Summary

Modifier and TypeMethod and Description
protected PropertyName
public PropertyName
findNameForDeserialization(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.introspect.JacksonAnnotationIntrospector.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.introspect.JacksonAnnotationIntrospector.findNameForSerialization.

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

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

Implements tools.jackson.databind.AnnotationIntrospector.XmlExtensions.findNamespace.

Method that can be called to figure out generic namespace property for an annotated object.

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

Overrides tools.jackson.databind.introspect.JacksonAnnotationIntrospector.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 PropertyName
findWrapperName(MapperConfig<?> config, Annotated ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findWrapperName.

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
isOutputAsAttribute(MapperConfig<?> config, Annotated ann)

Implements tools.jackson.databind.AnnotationIntrospector.XmlExtensions.isOutputAsAttribute.

Method used to check whether given annotated element (field, method, constructor parameter) has indicator that suggests it be output as an XML attribute or not (if not, then as element)

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

Implements tools.jackson.databind.AnnotationIntrospector.XmlExtensions.isOutputAsCData.

Method used to check whether given annotated element (field, method, constructor parameter) has indicator that suggests it should be wrapped in a CDATA tag.

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

Implements tools.jackson.databind.AnnotationIntrospector.XmlExtensions.isOutputAsText.

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.

public void
Inherited from tools.jackson.databind.introspect.JacksonAnnotationIntrospector:
_classIfExplicit_classIfExplicit_constructVirtualProperty_constructVirtualProperty_findImplicitName_isIgnorable_propertyNamefindAndAddVirtualPropertiesfindAutoDetectVisibilityfindClassDescriptionfindContentDeserializerfindContentSerializerfindCreatorAnnotationfindDefaultEnumValuefindDeserializationContentConverterfindDeserializationConverterfindDeserializerfindEnumAliasesfindEnumNamingStrategyfindEnumValuesfindFilterIdfindFormatfindImplicitPropertyNamefindInjectableValuefindKeyDeserializerfindKeySerializerfindMergeInfofindNamingStrategyfindNullSerializerfindObjectIdInfofindObjectReferenceInfofindPOJOBuilderfindPOJOBuilderConfigfindPolymorphicTypeInfofindPropertyAccessfindPropertyAliasesfindPropertyDefaultValuefindPropertyDescriptionfindPropertyIgnoralByNamefindPropertyInclusionfindPropertyInclusionByNamefindPropertyIndexfindReferenceTypefindRenameByFieldfindSerializationContentConverterfindSerializationConverterfindSerializationPropertyOrderfindSerializationSortAlphabeticallyfindSerializationTypingfindSerializerfindSetterInfofindSubtypesfindTypeIdResolverfindTypeNamefindTypeResolverBuilderfindUnwrappingNameTransformerfindValueInstantiatorfindViewshasAnyGetterhasAnySetterhasAsKeyhasAsValuehasIgnoreMarkerhasRequiredMarkerisAnnotationBundleisIgnorableTypeisTypeIdreadResolverefineDeserializationTyperefineSerializationTyperesolveSetterConflictsetConstructorPropertiesImpliesCreatorversion

Field Detail

_cfgDefaultUseWrapperback to summary
protected boolean _cfgDefaultUseWrapper
ANNOTATIONS_TO_INFER_XML_PROPback to summary
private static final Class<? extends Annotation>[] ANNOTATIONS_TO_INFER_XML_PROP
Annotations
@SuppressWarnings:unchecked
DEFAULT_USE_WRAPPERback to summary
public static final boolean DEFAULT_USE_WRAPPER

For backwards compatibility with 2.0, the default behavior is to assume use of List wrapper if no annotations are used.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides tools.jackson.databind.introspect.JacksonAnnotationIntrospector.serialVersionUID.

Constructor Detail

JacksonXmlAnnotationIntrospectorback to summary
public JacksonXmlAnnotationIntrospector()
JacksonXmlAnnotationIntrospectorback to summary
public JacksonXmlAnnotationIntrospector(boolean defaultUseWrapper)

Method Detail

_findXmlNameback to summary
protected PropertyName _findXmlName(Annotated a)
findNameForDeserializationback to summary
public PropertyName findNameForDeserialization(MapperConfig<?> config, Annotated a)

Overrides tools.jackson.databind.introspect.JacksonAnnotationIntrospector.findNameForDeserialization.

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

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

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

Overrides tools.jackson.databind.introspect.JacksonAnnotationIntrospector.findNameForSerialization.

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

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

Annotations
@Override
findNamespaceback to summary
public String findNamespace(MapperConfig<?> config, Annotated ann)

Implements tools.jackson.databind.AnnotationIntrospector.XmlExtensions.findNamespace.

Doc from tools.jackson.databind.AnnotationIntrospector.XmlExtensions.findNamespace.

Method that can be called to figure out generic namespace property for an annotated object.

Annotations
@Override
findRootNameback to summary
public PropertyName findRootName(MapperConfig<?> config, AnnotatedClass ac)

Overrides tools.jackson.databind.introspect.JacksonAnnotationIntrospector.findRootName.

Doc from 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. Returns null if no declaration found; can return explicit empty String, which is usually ignored as well as null.

Annotations
@SuppressWarnings:deprecation
@Override
findWrapperNameback to summary
public PropertyName findWrapperName(MapperConfig<?> config, Annotated ann)

Overrides tools.jackson.databind.AnnotationIntrospector.findWrapperName.

Doc from tools.jackson.databind.AnnotationIntrospector.findWrapperName.

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. Note that not all serializers and deserializers support use this method: currently (3.0) it is only used by XML-backed handlers.

Annotations
@Override
isOutputAsAttributeback to summary
public Boolean isOutputAsAttribute(MapperConfig<?> config, Annotated ann)

Implements tools.jackson.databind.AnnotationIntrospector.XmlExtensions.isOutputAsAttribute.

Doc from tools.jackson.databind.AnnotationIntrospector.XmlExtensions.isOutputAsAttribute.

Method used to check whether given annotated element (field, method, constructor parameter) has indicator that suggests it be output as an XML attribute or not (if not, then as element)

Annotations
@Override
isOutputAsCDataback to summary
public Boolean isOutputAsCData(MapperConfig<?> config, Annotated ann)

Implements tools.jackson.databind.AnnotationIntrospector.XmlExtensions.isOutputAsCData.

Doc from tools.jackson.databind.AnnotationIntrospector.XmlExtensions.isOutputAsCData.

Method used to check whether given annotated element (field, method, constructor parameter) has indicator that suggests it should be wrapped in a CDATA tag.

Annotations
@Override
isOutputAsTextback to summary
public Boolean isOutputAsText(MapperConfig<?> config, Annotated ann)

Implements tools.jackson.databind.AnnotationIntrospector.XmlExtensions.isOutputAsText.

Doc from tools.jackson.databind.AnnotationIntrospector.XmlExtensions.isOutputAsText.

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.

Annotations
@Override
setDefaultUseWrapperback to summary
public void setDefaultUseWrapper(boolean b)