Class AnnotatedClass
java.lang.Object
org.codehaus.jackson.map.introspect.Annotated
org.codehaus.jackson.map.introspect.AnnotatedClass
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnnotationIntrospector
Filter used to determine which annotations to gather; used to optimize things so that unnecessary annotations are ignored.protected final Class<?>
Class for which annotations apply, and that owns other components (constructors, methods)protected AnnotationMap
Combined list of Jackson annotations that the class has, including inheritable ones from super classes and interfacesprotected List<AnnotatedConstructor>
Single argument constructors the class has, if any.protected List<AnnotatedMethod>
Single argument static methods that might be usable as factory methodsprotected AnnotatedConstructor
Default constructor of the annotated class, if it has one.protected List<AnnotatedField>
Member fields of interest: ones that are either public, or have at least one annotation.protected AnnotatedMethodMap
Member methods of interest; for now ones with 0 or 1 arguments (just optimization, since others won't be used now)protected final ClassIntrospector.MixInResolver
Object that knows mapping of mix-in classes (ones that contain annotations to add) with their target classes (ones that get these additional annotations "mixed in").protected final Class<?>
Primary mix-in class; one to use for the annotated class itself.Ordered set of super classes and interfaces of the class itself: included in order of precedence -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_addClassMixIns
(AnnotationMap annotations, Class<?> toMask) Helper method for adding any mix-in annotations specified class might have.protected void
_addClassMixIns
(AnnotationMap annotations, Class<?> toMask, Class<?> mixin) protected void
_addConstructorMixIns
(Class<?> mixin) protected void
_addFactoryMixIns
(Class<?> mixin) protected void
_addFieldMixIns
(Class<?> targetClass, Class<?> mixInCls, Map<String, AnnotatedField> fields) Method called to add field mix-ins from given mix-in class (and its fields) into already collected actual fields (from introspected classes and their super-classes)protected void
_addFields
(Map<String, AnnotatedField> fields, Class<?> c) protected void
_addMemberMethods
(Class<?> cls, MethodFilter methodFilter, AnnotatedMethodMap methods, Class<?> mixInCls, AnnotatedMethodMap mixIns) protected void
_addMethodMixIns
(Class<?> targetClass, MethodFilter methodFilter, AnnotatedMethodMap methods, Class<?> mixInCls, AnnotatedMethodMap mixIns) protected void
_addMixOvers
(Constructor<?> mixin, AnnotatedConstructor target, boolean addParamAnnotations) protected void
_addMixOvers
(Method mixin, AnnotatedMethod target, boolean addParamAnnotations) protected void
_addMixUnders
(Method src, AnnotatedMethod target) Method that will add annotations from specified source method to target method, but only if target does not yet have them.protected AnnotationMap
protected AnnotationMap[]
_collectRelevantAnnotations
(Annotation[][] anns) protected AnnotatedConstructor
_constructConstructor
(Constructor<?> ctor, boolean defaultCtor) protected AnnotatedMethod
protected AnnotatedField
protected AnnotatedMethod
protected boolean
_isIncludableMethod
(Method m, MethodFilter filter) static AnnotatedClass
construct
(Class<?> cls, AnnotationIntrospector aintr, ClassIntrospector.MixInResolver mir) Factory method that instantiates an instance.static AnnotatedClass
constructWithoutSuperTypes
(Class<?> cls, AnnotationIntrospector aintr, ClassIntrospector.MixInResolver mir) Method similar toconstruct(java.lang.Class<?>, org.codehaus.jackson.map.AnnotationIntrospector, org.codehaus.jackson.map.ClassIntrospector.MixInResolver)
, but that will NOT include information from supertypes; only class itself and any direct mix-ins it may have.fields()
findMethod
(String name, Class<?>[] paramTypes) protected AnnotationMap
Class<?>
Method that can be used to find actual JDK element that this instance represents.<A extends Annotation>
AgetAnnotation
(Class<A> acls) int
Full generic type of the annotated element; definition of what exactly this means depends on sub-class.int
int
getName()
Class<?>
"Raw" type (type-erased class) of the annotated element; definition of what exactly this means depends on sub-class.boolean
void
Initialization method that will recursively collect Jackson annotations for this class and all super classes and interfaces.void
resolveCreators
(boolean includeAll) Initialization method that will find out all constructors and potential static factory methods the class has.void
Method that will collect all member (non-static) fields that are either public, or have at least a single annotation associated with them.void
resolveFields
(boolean collectIgnored) Deprecated.void
resolveMemberMethods
(MethodFilter methodFilter) Method for resolving member method information: aggregating all non-static methods and combining annotations (to implement method-annotation inheritance)void
resolveMemberMethods
(MethodFilter methodFilter, boolean collectIgnored) Deprecated.toString()
Fluent factory method that will construct a new instance that uses specified instance annotations instead of currently configured ones.Methods inherited from class org.codehaus.jackson.map.introspect.Annotated
getType, hasAnnotation, isPublic, withFallBackAnnotationsFrom
-
Field Details
-
_class
Class for which annotations apply, and that owns other components (constructors, methods) -
_superTypes
Ordered set of super classes and interfaces of the class itself: included in order of precedence -
_annotationIntrospector
Filter used to determine which annotations to gather; used to optimize things so that unnecessary annotations are ignored. -
_mixInResolver
Object that knows mapping of mix-in classes (ones that contain annotations to add) with their target classes (ones that get these additional annotations "mixed in"). -
_primaryMixIn
Primary mix-in class; one to use for the annotated class itself. Can be null. -
_classAnnotations
Combined list of Jackson annotations that the class has, including inheritable ones from super classes and interfaces -
_defaultConstructor
Default constructor of the annotated class, if it has one. -
_constructors
Single argument constructors the class has, if any. -
_creatorMethods
Single argument static methods that might be usable as factory methods -
_memberMethods
Member methods of interest; for now ones with 0 or 1 arguments (just optimization, since others won't be used now) -
_fields
Member fields of interest: ones that are either public, or have at least one annotation.
-
-
Method Details
-
withAnnotations
Description copied from class:Annotated
Fluent factory method that will construct a new instance that uses specified instance annotations instead of currently configured ones.- Specified by:
withAnnotations
in classAnnotated
-
construct
public static AnnotatedClass construct(Class<?> cls, AnnotationIntrospector aintr, ClassIntrospector.MixInResolver mir) Factory method that instantiates an instance. Returned instance will only be initialized with class annotations, but not with any method information. -
constructWithoutSuperTypes
public static AnnotatedClass constructWithoutSuperTypes(Class<?> cls, AnnotationIntrospector aintr, ClassIntrospector.MixInResolver mir) Method similar toconstruct(java.lang.Class<?>, org.codehaus.jackson.map.AnnotationIntrospector, org.codehaus.jackson.map.ClassIntrospector.MixInResolver)
, but that will NOT include information from supertypes; only class itself and any direct mix-ins it may have. -
getAnnotated
Description copied from class:Annotated
Method that can be used to find actual JDK element that this instance represents. It is non-null, except for method/constructor parameters which do not have a JDK counterpart.- Specified by:
getAnnotated
in classAnnotated
-
getModifiers
public int getModifiers()- Specified by:
getModifiers
in classAnnotated
-
getName
-
getAnnotation
- Specified by:
getAnnotation
in classAnnotated
-
getGenericType
Description copied from class:Annotated
Full generic type of the annotated element; definition of what exactly this means depends on sub-class.- Specified by:
getGenericType
in classAnnotated
-
getRawType
Description copied from class:Annotated
"Raw" type (type-erased class) of the annotated element; definition of what exactly this means depends on sub-class.- Specified by:
getRawType
in classAnnotated
-
getAllAnnotations
- Specified by:
getAllAnnotations
in classAnnotated
-
getAnnotations
- Returns:
- 1.7
-
hasAnnotations
public boolean hasAnnotations() -
getDefaultConstructor
-
getConstructors
-
getStaticMethods
-
memberMethods
-
getMemberMethodCount
public int getMemberMethodCount() -
findMethod
-
getFieldCount
public int getFieldCount() -
fields
-
resolveClassAnnotations
public void resolveClassAnnotations()Initialization method that will recursively collect Jackson annotations for this class and all super classes and interfaces.Starting with 1.2, it will also apply mix-in annotations, as per [JACKSON-76]
-
resolveCreators
public void resolveCreators(boolean includeAll) Initialization method that will find out all constructors and potential static factory methods the class has.Starting with 1.2, it will also apply mix-in annotations, as per [JACKSON-76]
- Parameters:
includeAll
- If true, includes all creator methods; if false, will only include the no-arguments "default" constructor
-
resolveMemberMethods
Method for resolving member method information: aggregating all non-static methods and combining annotations (to implement method-annotation inheritance)- Parameters:
methodFilter
- Filter used to determine which methods to include- Since:
- 1.9
-
resolveFields
public void resolveFields()Method that will collect all member (non-static) fields that are either public, or have at least a single annotation associated with them.- Since:
- 1.9
-
resolveMemberMethods
Deprecated.- Since:
- 1.9 Use version without arguments
-
resolveFields
Deprecated.- Since:
- 1.9 Use version without arguments
-
_addClassMixIns
Helper method for adding any mix-in annotations specified class might have. -
_addClassMixIns
-
_addConstructorMixIns
-
_addFactoryMixIns
-
_addMemberMethods
protected void _addMemberMethods(Class<?> cls, MethodFilter methodFilter, AnnotatedMethodMap methods, Class<?> mixInCls, AnnotatedMethodMap mixIns) -
_addMethodMixIns
protected void _addMethodMixIns(Class<?> targetClass, MethodFilter methodFilter, AnnotatedMethodMap methods, Class<?> mixInCls, AnnotatedMethodMap mixIns) -
_addFields
-
_addFieldMixIns
protected void _addFieldMixIns(Class<?> targetClass, Class<?> mixInCls, Map<String, AnnotatedField> fields) Method called to add field mix-ins from given mix-in class (and its fields) into already collected actual fields (from introspected classes and their super-classes) -
_constructMethod
-
_constructConstructor
-
_constructCreatorMethod
-
_constructField
-
_collectRelevantAnnotations
-
_collectRelevantAnnotations
-
_isIncludableMethod
-
_addMixOvers
protected void _addMixOvers(Constructor<?> mixin, AnnotatedConstructor target, boolean addParamAnnotations) - Parameters:
addParamAnnotations
- Whether parameter annotations are to be added as well
-
_addMixOvers
- Parameters:
addParamAnnotations
- Whether parameter annotations are to be added as well
-
_addMixUnders
Method that will add annotations from specified source method to target method, but only if target does not yet have them. -
toString
-