Class JacksonXmlAnnotationIntrospector

  • All Implemented Interfaces:
    com.fasterxml.jackson.core.Versioned, XmlAnnotationIntrospector, java.io.Serializable

    public class JacksonXmlAnnotationIntrospector
    extends com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector
    implements XmlAnnotationIntrospector
    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 JaxbAnnotationIntrospector).
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean _cfgDefaultUseWrapper  
      static 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.
      • Fields inherited from class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector

        _annotationsInside, _cfgConstructorPropertiesImpliesCreator
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder _constructStdTypeResolverBuilder()
      We will override this method so that we can return instance that cleans up type id property name to be a valid xml name.
      protected com.fasterxml.jackson.databind.PropertyName _findXmlName​(com.fasterxml.jackson.databind.introspect.Annotated a)  
      com.fasterxml.jackson.databind.PropertyName findNameForDeserialization​(com.fasterxml.jackson.databind.introspect.Annotated a)  
      com.fasterxml.jackson.databind.PropertyName findNameForSerialization​(com.fasterxml.jackson.databind.introspect.Annotated a)  
      java.lang.String findNamespace​(com.fasterxml.jackson.databind.introspect.Annotated ann)
      Method that can be called to figure out generic namespace property for an annotated object.
      com.fasterxml.jackson.databind.PropertyName findRootName​(com.fasterxml.jackson.databind.introspect.AnnotatedClass ac)  
      com.fasterxml.jackson.databind.PropertyName findWrapperName​(com.fasterxml.jackson.databind.introspect.Annotated ann)  
      java.lang.Boolean isOutputAsAttribute​(com.fasterxml.jackson.databind.introspect.Annotated ann)
      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 (as element)
      java.lang.Boolean isOutputAsCData​(com.fasterxml.jackson.databind.introspect.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.
      java.lang.Boolean isOutputAsText​(com.fasterxml.jackson.databind.introspect.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.
      void setDefaultUseWrapper​(boolean b)  
      • Methods inherited from class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector

        _classIfExplicit, _classIfExplicit, _constructNoTypeResolverBuilder, _constructVirtualProperty, _constructVirtualProperty, _findConstructorName, _findTypeResolver, _isIgnorable, _propertyName, findAndAddVirtualProperties, findAutoDetectVisibility, findClassDescription, findContentDeserializer, findContentSerializer, findCreatorAnnotation, findCreatorBinding, findDefaultEnumValue, findDeserializationContentConverter, findDeserializationContentType, findDeserializationConverter, findDeserializationKeyType, findDeserializationType, findDeserializer, findEnumValue, findEnumValues, findFilterId, findFormat, findImplicitPropertyName, findInjectableValue, findInjectableValueId, findKeyDeserializer, findKeySerializer, findMergeInfo, findNamingStrategy, findNullSerializer, findObjectIdInfo, findObjectReferenceInfo, findPOJOBuilder, findPOJOBuilderConfig, findPropertyAccess, findPropertyAliases, findPropertyContentTypeResolver, findPropertyDefaultValue, findPropertyDescription, findPropertyIgnorals, findPropertyInclusion, findPropertyIndex, findPropertyTypeResolver, findReferenceType, findSerializationContentConverter, findSerializationContentType, findSerializationConverter, findSerializationKeyType, findSerializationPropertyOrder, findSerializationSortAlphabetically, findSerializationType, findSerializationTyping, findSerializer, findSetterInfo, findSubtypes, findTypeName, findTypeResolver, findUnwrappingNameTransformer, findValueInstantiator, findViews, hasAnyGetter, hasAnyGetterAnnotation, hasAnySetter, hasAnySetterAnnotation, hasAsValue, hasAsValueAnnotation, hasCreatorAnnotation, hasIgnoreMarker, hasRequiredMarker, isAnnotationBundle, isIgnorableType, isTypeId, readResolve, refineDeserializationType, refineSerializationType, resolveSetterConflict, setConstructorPropertiesImpliesCreator, version
      • Methods inherited from class com.fasterxml.jackson.databind.AnnotationIntrospector

        _findAnnotation, _hasAnnotation, _hasOneOf, allIntrospectors, allIntrospectors, findIgnoreUnknownProperties, findPropertiesToIgnore, findPropertiesToIgnore, findSerializationInclusion, findSerializationInclusionForContent, nopInstance, pair
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_USE_WRAPPER

        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.
        See Also:
        Constant Field Values
      • _cfgDefaultUseWrapper

        protected boolean _cfgDefaultUseWrapper
    • Constructor Detail

      • JacksonXmlAnnotationIntrospector

        public JacksonXmlAnnotationIntrospector()
      • JacksonXmlAnnotationIntrospector

        public JacksonXmlAnnotationIntrospector​(boolean defaultUseWrapper)
    • Method Detail

      • findWrapperName

        public com.fasterxml.jackson.databind.PropertyName findWrapperName​(com.fasterxml.jackson.databind.introspect.Annotated ann)
        Overrides:
        findWrapperName in class com.fasterxml.jackson.databind.AnnotationIntrospector
      • findRootName

        public com.fasterxml.jackson.databind.PropertyName findRootName​(com.fasterxml.jackson.databind.introspect.AnnotatedClass ac)
        Overrides:
        findRootName in class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector
      • findNamespace

        public java.lang.String findNamespace​(com.fasterxml.jackson.databind.introspect.Annotated ann)
        Description copied from interface: XmlAnnotationIntrospector
        Method that can be called to figure out generic namespace property for an annotated object.
        Specified by:
        findNamespace in interface XmlAnnotationIntrospector
        Returns:
        Null if annotated thing does not define any namespace information; non-null namespace (which may be empty String) otherwise
      • isOutputAsAttribute

        public java.lang.Boolean isOutputAsAttribute​(com.fasterxml.jackson.databind.introspect.Annotated ann)
        Description copied from interface: XmlAnnotationIntrospector
        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 (as element)
        Specified by:
        isOutputAsAttribute in interface XmlAnnotationIntrospector
      • isOutputAsText

        public java.lang.Boolean isOutputAsText​(com.fasterxml.jackson.databind.introspect.Annotated ann)
        Description copied from interface: XmlAnnotationIntrospector
        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.
        Specified by:
        isOutputAsText in interface XmlAnnotationIntrospector
      • isOutputAsCData

        public java.lang.Boolean isOutputAsCData​(com.fasterxml.jackson.databind.introspect.Annotated ann)
        Description copied from interface: XmlAnnotationIntrospector
        Method 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:
        isOutputAsCData in interface XmlAnnotationIntrospector
      • findNameForSerialization

        public com.fasterxml.jackson.databind.PropertyName findNameForSerialization​(com.fasterxml.jackson.databind.introspect.Annotated a)
        Overrides:
        findNameForSerialization in class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector
      • findNameForDeserialization

        public com.fasterxml.jackson.databind.PropertyName findNameForDeserialization​(com.fasterxml.jackson.databind.introspect.Annotated a)
        Overrides:
        findNameForDeserialization in class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector
      • _constructStdTypeResolverBuilder

        protected com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder _constructStdTypeResolverBuilder()
        We will override this method so that we can return instance that cleans up type id property name to be a valid xml name.
        Overrides:
        _constructStdTypeResolverBuilder in class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector
      • _findXmlName

        protected com.fasterxml.jackson.databind.PropertyName _findXmlName​(com.fasterxml.jackson.databind.introspect.Annotated a)