Class JacksonXmlAnnotationIntrospector

    • 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
    • Constructor Detail

      • JacksonXmlAnnotationIntrospector

        public JacksonXmlAnnotationIntrospector()
      • JacksonXmlAnnotationIntrospector

        public JacksonXmlAnnotationIntrospector​(boolean defaultUseWrapper)
    • Method Detail

      • setDefaultUseWrapper

        public void setDefaultUseWrapper​(boolean b)
      • findWrapperName

        public PropertyName findWrapperName​(Annotated ann)
        Description copied from class: AnnotationIntrospector
        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 (2.1) it is only used by XML-backed handlers.
        Overrides:
        findWrapperName in class AnnotationIntrospector
        Returns:
        Wrapper name to use, if any, or PropertyName.USE_DEFAULT to indicate that no wrapper element should be used.
      • findRootName

        public PropertyName findRootName​(AnnotatedClass ac)
        Description copied from class: AnnotationIntrospector
        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.

        NOTE: method signature changed in 2.1, to return PropertyName instead of String.

        Overrides:
        findRootName in class JacksonAnnotationIntrospector
        Parameters:
        ac - Annotated class to introspect
        Returns:
        Root name to use, if any; null if not
      • findNamespace

        public java.lang.String findNamespace​(MapperConfig<?> config,
                                              Annotated ann)
        Description copied from interface: AnnotationIntrospector.XmlExtensions
        Method that can be called to figure out generic namespace property for an annotated object.
        Specified by:
        findNamespace in interface AnnotationIntrospector.XmlExtensions
        Parameters:
        config - Configuration settings in effect
        ann - 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 java.lang.Boolean isOutputAsAttribute​(MapperConfig<?> config,
                                                     Annotated ann)
        Description copied from interface: AnnotationIntrospector.XmlExtensions
        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)
        Specified by:
        isOutputAsAttribute in interface AnnotationIntrospector.XmlExtensions
        Parameters:
        config - Configuration settings in effect
        ann - Annotated entity to introspect
        Returns:
        Null if no indicator found; True or False otherwise
      • isOutputAsText

        public java.lang.Boolean isOutputAsText​(MapperConfig<?> config,
                                                Annotated ann)
        Description copied from interface: AnnotationIntrospector.XmlExtensions
        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 AnnotationIntrospector.XmlExtensions
        Parameters:
        config - Configuration settings in effect
        ann - Annotated entity to introspect
        Returns:
        Null if no indicator found; True or False otherwise
      • isOutputAsCData

        public java.lang.Boolean isOutputAsCData​(MapperConfig<?> config,
                                                 Annotated ann)
        Description copied from interface: AnnotationIntrospector.XmlExtensions
        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 AnnotationIntrospector.XmlExtensions
        Parameters:
        config - Configuration settings in effect
        ann - Annotated entity to introspect
        Returns:
        Null if no indicator found; True or False otherwise
      • findNameForDeserialization

        public PropertyName findNameForDeserialization​(Annotated a)
        Description copied from class: AnnotationIntrospector
        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").
        Overrides:
        findNameForDeserialization in class JacksonAnnotationIntrospector
        Parameters:
        a - Annotated entity to check
        Returns:
        Name to use if found; null if not.