|
||||||||||
| 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 because there isn't an equivalent element name for a JSON object.
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 |
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. |
|
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.) |
|
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). |
|
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 AnnotationIntrospectorann - The annotation.
public String findNamespace(Annotated ann)
AnnotationIntrospector
findNamespace in class AnnotationIntrospectorpublic Boolean findCachability(AnnotatedClass ac)
AnnotationIntrospectorCurrently only used with deserializers, to determine whether provider should cache instances, and if no annotations are found, assumes non-cachable instances.
findCachability in class AnnotationIntrospectorpublic Boolean findFieldAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findFieldAutoDetection in class AnnotationIntrospectorpublic String findRootName(AnnotatedClass ac)
AnnotationIntrospector
findRootName in class AnnotationIntrospectorpublic boolean isIgnorableMethod(AnnotatedMethod m)
AnnotationIntrospectorNote 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 AnnotationIntrospectorpublic boolean isIgnorableConstructor(AnnotatedConstructor c)
isIgnorableConstructor in class AnnotationIntrospectorpublic boolean isIgnorableField(AnnotatedField f)
AnnotationIntrospector
isIgnorableField in class AnnotationIntrospectorpublic JsonSerializer<?> findSerializer(Annotated am)
AnnotationIntrospectorJsonSerializer) or Class (of type
Class); if value of different
type is returned, a runtime exception may be thrown by caller.
findSerializer in class AnnotationIntrospectorpublic Class<?> findSerializationType(Annotated a)
AnnotationIntrospector
findSerializationType in class AnnotationIntrospector
public JsonSerialize.Inclusion findSerializationInclusion(Annotated a,
JsonSerialize.Inclusion defValue)
findSerializationInclusion in class AnnotationIntrospectorpublic JsonSerialize.Typing findSerializationTyping(Annotated a)
AnnotationIntrospector
findSerializationTyping in class AnnotationIntrospectorpublic Boolean findGetterAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findGetterAutoDetection in class AnnotationIntrospectorpublic Boolean findIsGetterAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findIsGetterAutoDetection in class AnnotationIntrospectorpublic String findGettablePropertyName(AnnotatedMethod am)
AnnotationIntrospector
findGettablePropertyName in class AnnotationIntrospectorpublic boolean hasAsValueAnnotation(AnnotatedMethod am)
AnnotationIntrospector
hasAsValueAnnotation in class AnnotationIntrospectorpublic 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 AnnotationIntrospectorprotected boolean isInvisible(AnnotatedField f)
f - The field.
protected boolean isInvisible(AnnotatedMethod m)
m - The method.
public String findSerializablePropertyName(AnnotatedField af)
AnnotationIntrospector
findSerializablePropertyName in class AnnotationIntrospectorpublic JsonDeserializer<?> findDeserializer(Annotated am)
AnnotationIntrospectorJsonDeserializer) or Class (of type
Class); if value of different
type is returned, a runtime exception may be thrown by caller.
findDeserializer in class AnnotationIntrospectorpublic Class<KeyDeserializer> findKeyDeserializer(Annotated am)
AnnotationIntrospectorMap 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 AnnotationIntrospectorpublic Class<JsonDeserializer<?>> findContentDeserializer(Annotated am)
AnnotationIntrospectorCollection, 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 AnnotationIntrospectorpublic Class<?> findDeserializationType(Annotated am)
AnnotationIntrospector
findDeserializationType in class AnnotationIntrospectorpublic Class<?> findDeserializationKeyType(Annotated am)
AnnotationIntrospectorMap types.
findDeserializationKeyType in class AnnotationIntrospectorpublic Class<?> findDeserializationContentType(Annotated am)
AnnotationIntrospector
findDeserializationContentType in class AnnotationIntrospectorpublic Boolean findSetterAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findSetterAutoDetection in class AnnotationIntrospectorpublic Boolean findCreatorAutoDetection(AnnotatedClass ac)
AnnotationIntrospector
findCreatorAutoDetection in class AnnotationIntrospectorpublic String findSettablePropertyName(AnnotatedMethod am)
AnnotationIntrospector
findSettablePropertyName in class AnnotationIntrospectorpublic boolean hasAnySetterAnnotation(AnnotatedMethod am)
AnnotationIntrospector
hasAnySetterAnnotation in class AnnotationIntrospectorpublic boolean hasCreatorAnnotation(Annotated am)
AnnotationIntrospector
hasCreatorAnnotation in class AnnotationIntrospectorpublic String findDeserializablePropertyName(AnnotatedField af)
AnnotationIntrospector
findDeserializablePropertyName in class AnnotationIntrospectorpublic 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 | ||||||||||