com.fasterxml.jackson.dataformat.xml
Class JacksonXmlAnnotationIntrospector

java.lang.Object
  extended by com.fasterxml.jackson.databind.AnnotationIntrospector
      extended by com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector
          extended by com.fasterxml.jackson.dataformat.xml.JacksonXmlAnnotationIntrospector
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, XmlAnnotationIntrospector

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).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.AnnotationIntrospector
com.fasterxml.jackson.databind.AnnotationIntrospector.Pair, com.fasterxml.jackson.databind.AnnotationIntrospector.ReferenceProperty
 
Nested classes/interfaces inherited from interface com.fasterxml.jackson.dataformat.xml.XmlAnnotationIntrospector
XmlAnnotationIntrospector.Pair
 
Constructor Summary
JacksonXmlAnnotationIntrospector()
           
 
Method Summary
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  String _findXmlName(com.fasterxml.jackson.databind.introspect.Annotated a)
           
 String findDeserializationName(com.fasterxml.jackson.databind.introspect.AnnotatedField af)
           
 String findDeserializationName(com.fasterxml.jackson.databind.introspect.AnnotatedMethod am)
           
 String findDeserializationName(com.fasterxml.jackson.databind.introspect.AnnotatedParameter ap)
           
 String findNamespace(com.fasterxml.jackson.databind.introspect.Annotated ann)
          Method that can be called to figure out generic namespace property for an annotated object.
 QName findRootElement(com.fasterxml.jackson.databind.introspect.Annotated ann)
          Method used to find out name to use for the outermost (root) XML element name when serializing (since there is no property that would define it); this overrides default name based on type of object.
 String findSerializationName(com.fasterxml.jackson.databind.introspect.AnnotatedField af)
           
 String findSerializationName(com.fasterxml.jackson.databind.introspect.AnnotatedMethod am)
           
 QName findWrapperElement(com.fasterxml.jackson.databind.introspect.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.
 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)
 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.
 
Methods inherited from class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector
_constructNoTypeResolverBuilder, _findTypeResolver, _isIgnorable, findAutoDetectVisibility, findContentDeserializer, findContentSerializer, findDeserializationContentType, findDeserializationKeyType, findDeserializationType, findDeserializer, findEnumValue, findFilterId, findFormat, findIgnoreUnknownProperties, findInjectableValueId, findKeyDeserializer, findKeySerializer, findObjectIdInfo, findPOJOBuilder, findPOJOBuilderConfig, findPropertiesToIgnore, findPropertyContentTypeResolver, findPropertyTypeResolver, findReferenceType, findRootName, findSerializationContentType, findSerializationInclusion, findSerializationKeyType, findSerializationPropertyOrder, findSerializationSortAlphabetically, findSerializationType, findSerializationTyping, findSerializer, findSubtypes, findTypeName, findTypeResolver, findUnwrappingNameTransformer, findValueInstantiator, findViews, hasAnyGetterAnnotation, hasAnySetterAnnotation, hasAsValueAnnotation, hasCreatorAnnotation, hasIgnoreMarker, hasRequiredMarker, isAnnotationBundle, isHandled, isIgnorableType, isTypeId, version
 
Methods inherited from class com.fasterxml.jackson.databind.AnnotationIntrospector
allIntrospectors, allIntrospectors, nopInstance, pair
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JacksonXmlAnnotationIntrospector

public JacksonXmlAnnotationIntrospector()
Method Detail

findNamespace

public 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

findWrapperElement

public QName findWrapperElement(com.fasterxml.jackson.databind.introspect.Annotated ann)
Description copied from interface: XmlAnnotationIntrospector
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: local name of "" is used to indicate that name should default to using name (local name and namespace) of property itself.

Specified by:
findWrapperElement in interface XmlAnnotationIntrospector

findRootElement

public QName findRootElement(com.fasterxml.jackson.databind.introspect.Annotated ann)
Description copied from interface: XmlAnnotationIntrospector
Method used to find out name to use for the outermost (root) XML element name when serializing (since there is no property that would define it); this overrides default name based on type of object.

Specified by:
findRootElement in interface XmlAnnotationIntrospector

isOutputAsAttribute

public 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 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

findSerializationName

public String findSerializationName(com.fasterxml.jackson.databind.introspect.AnnotatedField af)
Overrides:
findSerializationName in class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector

findSerializationName

public String findSerializationName(com.fasterxml.jackson.databind.introspect.AnnotatedMethod am)
Overrides:
findSerializationName in class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector

findDeserializationName

public String findDeserializationName(com.fasterxml.jackson.databind.introspect.AnnotatedField af)
Overrides:
findDeserializationName in class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector

findDeserializationName

public String findDeserializationName(com.fasterxml.jackson.databind.introspect.AnnotatedMethod am)
Overrides:
findDeserializationName in class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector

findDeserializationName

public String findDeserializationName(com.fasterxml.jackson.databind.introspect.AnnotatedParameter ap)
Overrides:
findDeserializationName in class com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector

_findXmlName

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

_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


Copyright © 2012 fasterxml.com. All Rights Reserved.