|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.map.AnnotationIntrospector
org.codehaus.jackson.xc.JaxbAnnotationIntrospector
public class JaxbAnnotationIntrospector
Annotation introspector that leverages JAXB annotations where applicable to JSON mapping.
The following JAXB annotations were determined to be not-applicable:XmlAnyAttribute
because it applies only to MapXmlAnyElement
because it applies only to JAXBElement, which jackson can't serialize
XmlAttachmentRef
XmlElementDecl
XmlElementRefs
because Jackson doesn't have any support for 'named' collection items.
XmlElements
because Jackson doesn't have any support for 'named' collection items.
XmlID
because jackson' doesn't support referential integrity.
XmlIDREF
because jackson' doesn't support referential integrity.
XmlInlineBinaryData
XmlList
because jackson doesn't support serializing collections to a single string.
XmlMimeType
XmlMixed
XmlNs
XmlRegistry
XmlRootElement
is not currently used, but it may be used in future for XML compatibility features
XmlSchema
XmlSchemaType
XmlSchemaTypes
XmlSeeAlso
XmlValue
will have a property named 'value' on its JSON object.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.codehaus.jackson.map.AnnotationIntrospector |
---|
AnnotationIntrospector.Pair |
Constructor Summary | |
---|---|
JaxbAnnotationIntrospector()
|
Method Summary | ||
---|---|---|
protected XmlAccessType |
findAccessType(Annotated ac)
Method for locating JAXB XmlAccessType annotation value
for given annotated entity, if it has one, or inherits one from
its ancestors (in JAXB sense, package etc). |
|
protected XmlAdapter<Object,Object> |
findAdapter(Annotated am)
Finds the XmlAdapter for the specified annotation. |
|
protected
|
findAnnotation(Class<A> annotationClass,
Annotated annotated,
boolean includePackage,
boolean includeClass,
boolean includeSuperclasses)
Finds an annotation. |
|
Boolean |
findCachability(AnnotatedClass ac)
Method that checks whether specified class has annotations that indicate that it is (or is not) cachable. |
|
Class<JsonDeserializer<?>> |
findContentDeserializer(Annotated am)
Method for getting a deserializer definition for content (values) of associated Collection , array or
Map property. |
|
Boolean |
findCreatorAutoDetection(AnnotatedClass ac)
Method for checking whether there is a class annotation that indicates whether creator-method auto detection should be enabled. |
|
String |
findDeserializablePropertyName(AnnotatedField af)
Method for checking whether given member field represent a deserializable logical property; and if so, returns the name of that property. |
|
Class<?> |
findDeserializationContentType(Annotated am)
Method for accessing additional narrowing type definition that a method can have, to define more specific content type to use; content refers to Map values and Collection/array elements. |
|
Class<?> |
findDeserializationKeyType(Annotated am)
Method for accessing additional narrowing type definition that a method can have, to define more specific key type to use. |
|
Class<?> |
findDeserializationType(Annotated am)
Method for accessing annotated type definition that a method can have, to be used as the type for serialization instead of the runtime type. |
|
JsonDeserializer<?> |
findDeserializer(Annotated am)
Method for getting a deserializer definition on specified method or field. |
|
String |
findEnumValue(Enum<?> e)
!!! 12-Oct-2009, tatu: This is hideously slow implementation, called potentially for every single enum value being serialized. |
|
Boolean |
findFieldAutoDetection(AnnotatedClass ac)
Method for checking whether there is a class annotation that indicates whether field auto detection should be enabled. |
|
String |
findGettablePropertyName(AnnotatedMethod am)
Method for checking whether given method has an annotation that suggests property name associated with method that may be a "getter". |
|
Boolean |
findGetterAutoDetection(AnnotatedClass ac)
Method for checking whether there is a class annotation that indicates whether (regular) getter-method auto detection should be enabled. |
|
Boolean |
findIgnoreUnknownProperties(AnnotatedClass ac)
Method for checking whether an annotation indicates that all unknown properties |
|
Boolean |
findIsGetterAutoDetection(AnnotatedClass ac)
Method for checking whether there is a class annotation that indicates whether (regular) getter-method auto detection should be enabled. |
|
protected String |
findJaxbPropertyName(AnnotatedElement ae,
Class<?> aeType,
String defaultName)
Find the JAXB property name for the given annotated element. |
|
protected String |
findJaxbSpecifiedPropertyName(AnnotatedMethod am)
Find the property name for the specified annotated method. |
|
Class<KeyDeserializer> |
findKeyDeserializer(Annotated am)
Method for getting a deserializer definition for keys of associated Map property. |
|
String |
findNamespace(Annotated ann)
Method that can be called to figure out generic namespace property for an annotated object. |
|
String[] |
findPropertiesToIgnore(AnnotatedClass ac)
Method for finding list of properties to ignore for given class (null is returned if not specified). |
|
protected PropertyDescriptor |
findPropertyDescriptor(AnnotatedMethod m)
Finds the property descriptor (adapted to AnnotatedElement) for the specified method. |
|
String |
findPropertyNameForParam(AnnotatedParameter param)
Method for checking whether given set of annotations indicates property name for associated parameter. |
|
String |
findRootName(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. |
|
String |
findSerializablePropertyName(AnnotatedField af)
Method for checking whether given member field represent a serializable logical property; and if so, returns the name of that property. |
|
JsonSerialize.Inclusion |
findSerializationInclusion(Annotated a,
JsonSerialize.Inclusion defValue)
By default only non-null properties are written (per the JAXB spec.) |
|
String[] |
findSerializationPropertyOrder(AnnotatedClass ac)
Method for accessing defined property serialization order (which may be partial). |
|
Boolean |
findSerializationSortAlphabetically(AnnotatedClass ac)
Method for checking whether an annotation indicates that serialized properties for which no explicit is defined should be alphabetically (lexicograpically) ordered |
|
Class<?> |
findSerializationType(Annotated a)
Method for accessing annotated type definition that a method/field can have, to be used as the type for serialization instead of the runtime type. |
|
JsonSerialize.Typing |
findSerializationTyping(Annotated a)
Method for accessing declared typing mode annotated (if any). |
|
Class<?>[] |
findSerializationViews(Annotated a)
Method for checking if annotated serializable property (represented by field or getter method) has definitions for views it is to be included in. |
|
JsonSerializer<?> |
findSerializer(Annotated am)
Method for getting a serializer definition on specified method or field. |
|
String |
findSettablePropertyName(AnnotatedMethod am)
Method for checking whether given method has an annotation that suggests property name associated with method that may be a "setter". |
|
Boolean |
findSetterAutoDetection(AnnotatedClass ac)
Method for checking whether there is a class annotation that indicates whether setter-method auto detection should be enabled. |
|
boolean |
hasAnySetterAnnotation(AnnotatedMethod am)
Method for checking whether given method has an annotation that suggests that the method is to serve as "any setter"; method to be used for setting values of any properties for which no dedicated setter method is found. |
|
boolean |
hasAsValueAnnotation(AnnotatedMethod am)
Method for checking whether given method has an annotation that suggests that the return value of annotated method should be used as "the value" of the object instance; usually serialized as a primitive value such as String or number. |
|
boolean |
hasCreatorAnnotation(Annotated am)
Method for checking whether given annotated item (method, constructor) has an annotation that suggests that the method is a "creator" (aka factory) method to be used for construct new instances of deserialized values. |
|
protected boolean |
isFieldsAccessible(Annotated ac)
Whether fields are accessible to this class. |
|
boolean |
isHandled(Annotation ann)
An annotation is handled if it's in the same package as @XmlElement, including subpackages. |
|
boolean |
isIgnorableConstructor(AnnotatedConstructor c)
|
|
boolean |
isIgnorableField(AnnotatedField f)
Method for checking whether there is an annotation that indicates that given field should be ignored for all operations (serialization, deserialization). |
|
boolean |
isIgnorableMethod(AnnotatedMethod m)
Method for checking whether there is an annotation that indicates that given method should be ignored for all operations (serialization, deserialization). |
|
protected boolean |
isInvisible(AnnotatedField f)
Whether the specified field is invisible, per the JAXB visibility rules. |
|
protected boolean |
isInvisible(AnnotatedMethod m)
Whether the specified method (assumed to be a property) is invisible, per the JAXB rules. |
|
protected boolean |
isPropertiesAccessible(Annotated ac)
Whether properties are accessible to this class. |
Methods inherited from class org.codehaus.jackson.map.AnnotationIntrospector |
---|
nopInstance, pair |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JaxbAnnotationIntrospector()
Method Detail |
---|
public boolean isHandled(Annotation ann)
isHandled
in class AnnotationIntrospector
ann
- The annotation.
public String findNamespace(Annotated ann)
AnnotationIntrospector
findNamespace
in class AnnotationIntrospector
public String findEnumValue(Enum<?> e)
!!! 12-Oct-2009, tatu: This is hideously slow implementation, called potentially for every single enum value being serialized. Need to improve somehow
findEnumValue
in class AnnotationIntrospector
public Boolean findCachability(AnnotatedClass ac)
AnnotationIntrospector
Currently only used with deserializers, to determine whether provider should cache instances, and if no annotations are found, assumes non-cachable instances.
findCachability
in class AnnotationIntrospector
public Boolean findFieldAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findFieldAutoDetection
in class AnnotationIntrospector
public String findRootName(AnnotatedClass ac)
AnnotationIntrospector
findRootName
in class AnnotationIntrospector
public String[] findPropertiesToIgnore(AnnotatedClass ac)
AnnotationIntrospector
findPropertiesToIgnore
in class AnnotationIntrospector
public Boolean findIgnoreUnknownProperties(AnnotatedClass ac)
AnnotationIntrospector
findIgnoreUnknownProperties
in class AnnotationIntrospector
public boolean isIgnorableMethod(AnnotatedMethod m)
AnnotationIntrospector
Note that this method should ONLY return true for such explicit ignoral cases; and not if method just happens not to be visible for annotation processor.
isIgnorableMethod
in class AnnotationIntrospector
public boolean isIgnorableConstructor(AnnotatedConstructor c)
isIgnorableConstructor
in class AnnotationIntrospector
public boolean isIgnorableField(AnnotatedField f)
AnnotationIntrospector
isIgnorableField
in class AnnotationIntrospector
public JsonSerializer<?> findSerializer(Annotated am)
AnnotationIntrospector
JsonSerializer
) or Class (of type
Class
); if value of different
type is returned, a runtime exception may be thrown by caller.
findSerializer
in class AnnotationIntrospector
public Class<?> findSerializationType(Annotated a)
AnnotationIntrospector
findSerializationType
in class AnnotationIntrospector
public JsonSerialize.Inclusion findSerializationInclusion(Annotated a, JsonSerialize.Inclusion defValue)
findSerializationInclusion
in class AnnotationIntrospector
public JsonSerialize.Typing findSerializationTyping(Annotated a)
AnnotationIntrospector
findSerializationTyping
in class AnnotationIntrospector
public Class<?>[] findSerializationViews(Annotated a)
AnnotationIntrospector
findSerializationViews
in class AnnotationIntrospector
a
- Annotated serializable property (field or getter method)
Object.class
)public Boolean findGetterAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findGetterAutoDetection
in class AnnotationIntrospector
public Boolean findIsGetterAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findIsGetterAutoDetection
in class AnnotationIntrospector
public String[] findSerializationPropertyOrder(AnnotatedClass ac)
AnnotationIntrospector
findSerializationPropertyOrder
in class AnnotationIntrospector
public Boolean findSerializationSortAlphabetically(AnnotatedClass ac)
AnnotationIntrospector
findSerializationSortAlphabetically
in class AnnotationIntrospector
public String findGettablePropertyName(AnnotatedMethod am)
AnnotationIntrospector
findGettablePropertyName
in class AnnotationIntrospector
public boolean hasAsValueAnnotation(AnnotatedMethod am)
AnnotationIntrospector
hasAsValueAnnotation
in class AnnotationIntrospector
protected boolean isInvisible(AnnotatedField f)
f
- The field.
protected boolean isInvisible(AnnotatedMethod m)
m
- The method.
public String findSerializablePropertyName(AnnotatedField af)
AnnotationIntrospector
findSerializablePropertyName
in class AnnotationIntrospector
public JsonDeserializer<?> findDeserializer(Annotated am)
AnnotationIntrospector
JsonDeserializer
) or Class (of type
Class
); if value of different
type is returned, a runtime exception may be thrown by caller.
findDeserializer
in class AnnotationIntrospector
public Class<KeyDeserializer> findKeyDeserializer(Annotated am)
AnnotationIntrospector
Map
property.
Type of definition is either instance (of type
JsonDeserializer
) or Class (of type
Class
); if value of different
type is returned, a runtime exception may be thrown by caller.
findKeyDeserializer
in class AnnotationIntrospector
public Class<JsonDeserializer<?>> findContentDeserializer(Annotated am)
AnnotationIntrospector
Collection
, array
or
Map
property.
Type of definition is either instance (of type
JsonDeserializer
) or Class (of type
Class
); if value of different
type is returned, a runtime exception may be thrown by caller.
findContentDeserializer
in class AnnotationIntrospector
public Class<?> findDeserializationType(Annotated am)
AnnotationIntrospector
findDeserializationType
in class AnnotationIntrospector
public Class<?> findDeserializationKeyType(Annotated am)
AnnotationIntrospector
Map
types.
findDeserializationKeyType
in class AnnotationIntrospector
public Class<?> findDeserializationContentType(Annotated am)
AnnotationIntrospector
findDeserializationContentType
in class AnnotationIntrospector
public Boolean findSetterAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findSetterAutoDetection
in class AnnotationIntrospector
public Boolean findCreatorAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findCreatorAutoDetection
in class AnnotationIntrospector
public String findSettablePropertyName(AnnotatedMethod am)
AnnotationIntrospector
findSettablePropertyName
in class AnnotationIntrospector
public boolean hasAnySetterAnnotation(AnnotatedMethod am)
AnnotationIntrospector
hasAnySetterAnnotation
in class AnnotationIntrospector
public boolean hasCreatorAnnotation(Annotated am)
AnnotationIntrospector
hasCreatorAnnotation
in class AnnotationIntrospector
public String findDeserializablePropertyName(AnnotatedField af)
AnnotationIntrospector
findDeserializablePropertyName
in class AnnotationIntrospector
public String findPropertyNameForParam(AnnotatedParameter param)
AnnotationIntrospector
findPropertyNameForParam
in class AnnotationIntrospector
protected <A extends Annotation> A findAnnotation(Class<A> annotationClass, Annotated annotated, boolean includePackage, boolean includeClass, boolean includeSuperclasses)
annotationClass
- the annotation class.annotated
- The annotated element.includePackage
- Whether the annotation can be found on the package of the annotated element.includeClass
- Whether the annotation can be found on the class of the annotated element.includeSuperclasses
- Whether the annotation can be found on any superclasses of the class of the annotated element.
protected boolean isPropertiesAccessible(Annotated ac)
ac
- The annotated class.
protected XmlAccessType findAccessType(Annotated ac)
XmlAccessType
annotation 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.
protected boolean isFieldsAccessible(Annotated ac)
ac
- The annotated class.
protected PropertyDescriptor findPropertyDescriptor(AnnotatedMethod m)
m
- The method.
protected String findJaxbSpecifiedPropertyName(AnnotatedMethod am)
am
- The annotated method.
protected String findJaxbPropertyName(AnnotatedElement ae, Class<?> aeType, String defaultName)
ae
- The annotated element.aeType
- The type of the annotated element.defaultName
- The default name if nothing is specified.
protected XmlAdapter<Object,Object> findAdapter(Annotated am)
am
- The annotated element.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |