org.codehaus.jackson.map.introspect
Class AnnotatedClass

java.lang.Object
  extended by org.codehaus.jackson.map.introspect.Annotated
      extended by org.codehaus.jackson.map.introspect.AnnotatedClass

public final class AnnotatedClass
extends Annotated


Method Summary
protected  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<?> mixin, 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(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 mixin, AnnotatedMethod target)
           
protected  AnnotationMap _collectRelevantAnnotations(Annotation[] anns)
           
protected  AnnotationMap[] _collectRelevantAnnotations(Annotation[][] anns)
           
protected  AnnotatedConstructor _constructConstructor(Constructor<?> ctor, boolean defaultCtor)
           
protected  AnnotatedMethod _constructCreatorMethod(Method m)
           
protected  AnnotatedField _constructField(Field f)
           
protected  AnnotatedMethod _constructMethod(Method m)
           
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 to construct(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.
 Iterable<AnnotatedField> fields()
           
 AnnotatedMethod findMethod(String name, Class<?>[] paramTypes)
           
 Class<?> getAnnotated()
           
<A extends Annotation>
A
getAnnotation(Class<A> acls)
           
 List<AnnotatedConstructor> getConstructors()
           
 AnnotatedConstructor getDefaultConstructor()
           
 int getFieldCount()
           
 Type getGenericType()
          Full generic type of the annotated element; definition of what exactly this means depends on sub-class.
 int getMemberMethodCount()
           
 int getModifiers()
           
 String getName()
           
 Class<?> getRawType()
          "Raw" type (type-erased class) of the annotated element; definition of what exactly this means depends on sub-class.
 List<AnnotatedMethod> getStaticMethods()
           
 boolean hasAnnotations()
           
 Iterable<AnnotatedField> ignoredFields()
           
 Iterable<AnnotatedMethod> ignoredMemberMethods()
           
 Iterable<AnnotatedMethod> memberMethods()
           
protected  void resolveClassAnnotations()
          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 resolveFields(boolean collectIgnored)
          Method that will collect all member (non-static) fields that are either public, or have at least a single annotation associated with them.
 void resolveMemberMethods(MethodFilter methodFilter, boolean collectIgnored)
           
 String toString()
           
 
Methods inherited from class org.codehaus.jackson.map.introspect.Annotated
getType, hasAnnotation, isPublic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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 to construct(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

public Class<?> getAnnotated()
Specified by:
getAnnotated in class Annotated

getModifiers

public int getModifiers()
Specified by:
getModifiers in class Annotated

getName

public String getName()
Specified by:
getName in class Annotated

getAnnotation

public <A extends Annotation> A getAnnotation(Class<A> acls)
Specified by:
getAnnotation in class Annotated

getGenericType

public Type 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 class Annotated

getRawType

public Class<?> 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 class Annotated

hasAnnotations

public boolean hasAnnotations()

getDefaultConstructor

public AnnotatedConstructor getDefaultConstructor()

getConstructors

public List<AnnotatedConstructor> getConstructors()

getStaticMethods

public List<AnnotatedMethod> getStaticMethods()

memberMethods

public Iterable<AnnotatedMethod> memberMethods()

ignoredMemberMethods

public Iterable<AnnotatedMethod> ignoredMemberMethods()

getMemberMethodCount

public int getMemberMethodCount()

findMethod

public AnnotatedMethod findMethod(String name,
                                  Class<?>[] paramTypes)

getFieldCount

public int getFieldCount()

fields

public Iterable<AnnotatedField> fields()

ignoredFields

public Iterable<AnnotatedField> ignoredFields()

resolveClassAnnotations

protected 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]


_addClassMixIns

protected void _addClassMixIns(AnnotationMap annotations,
                               Class<?> toMask)
Helper method for adding any mix-in annotations specified class might have.


_addClassMixIns

protected void _addClassMixIns(AnnotationMap annotations,
                               Class<?> toMask,
                               Class<?> mixin)

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

_addConstructorMixIns

protected void _addConstructorMixIns(Class<?> mixin)

_addFactoryMixIns

protected void _addFactoryMixIns(Class<?> mixin)

resolveMemberMethods

public void resolveMemberMethods(MethodFilter methodFilter,
                                 boolean collectIgnored)
Parameters:
collectIgnored - Whether to collect list of ignored methods for later retrieval

_addMemberMethods

protected void _addMemberMethods(Class<?> cls,
                                 MethodFilter methodFilter,
                                 AnnotatedMethodMap methods,
                                 Class<?> mixInCls,
                                 AnnotatedMethodMap mixIns)

_addMethodMixIns

protected void _addMethodMixIns(MethodFilter methodFilter,
                                AnnotatedMethodMap methods,
                                Class<?> mixInCls,
                                AnnotatedMethodMap mixIns)

resolveFields

public void resolveFields(boolean collectIgnored)
Method that will collect all member (non-static) fields that are either public, or have at least a single annotation associated with them.

Parameters:
collectIgnored - Whether to collect list of ignored methods for later retrieval

_addFields

protected void _addFields(Map<String,AnnotatedField> fields,
                          Class<?> c)

_addFieldMixIns

protected void _addFieldMixIns(Class<?> mixin,
                               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

protected AnnotatedMethod _constructMethod(Method m)

_constructConstructor

protected AnnotatedConstructor _constructConstructor(Constructor<?> ctor,
                                                     boolean defaultCtor)

_constructCreatorMethod

protected AnnotatedMethod _constructCreatorMethod(Method m)

_constructField

protected AnnotatedField _constructField(Field f)

_collectRelevantAnnotations

protected AnnotationMap[] _collectRelevantAnnotations(Annotation[][] anns)

_collectRelevantAnnotations

protected AnnotationMap _collectRelevantAnnotations(Annotation[] anns)

_isIncludableMethod

protected boolean _isIncludableMethod(Method m,
                                      MethodFilter filter)

_addMixOvers

protected void _addMixOvers(Constructor<?> mixin,
                            AnnotatedConstructor target,
                            boolean addParamAnnotations)
Parameters:
addParamAnnotations - Whether parameter annotations are to be added as well

_addMixOvers

protected void _addMixOvers(Method mixin,
                            AnnotatedMethod target,
                            boolean addParamAnnotations)
Parameters:
addParamAnnotations - Whether parameter annotations are to be added as well

_addMixUnders

protected void _addMixUnders(Method mixin,
                             AnnotatedMethod target)

toString

public String toString()
Overrides:
toString in class Object