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


Nested Class Summary
static class AnnotatedClass.FactoryMethodFilter
          Filter used to only include methods that have signature that is compatible with "factory" methods: are static, take a single argument, and returns something.
 
Method Summary
protected  AnnotationMap _collectRelevantAnnotations(Annotation[] anns)
           
protected  AnnotatedConstructor _constructConstructor(Constructor<?> ctor)
           
protected  AnnotatedField _constructField(Field f)
           
protected  AnnotatedMethod _constructMethod(Method m)
           
protected  boolean _isIncludableMethod(Method m)
           
static AnnotatedClass construct(Class<?> cls, AnnotationIntrospector aintr)
          Factory method that instantiates an instance.
 Iterable<AnnotatedField> fields()
           
 AnnotatedMethod findMethod(String name, Class<?>[] paramTypes)
           
 Class<?> getAnnotated()
           
<A extends Annotation>
A
getAnnotation(Class<A> acls)
           
 AnnotatedConstructor getDefaultConstructor()
           
 int getFieldCount()
           
 int getMemberMethodCount()
           
 int getModifiers()
           
 String getName()
           
 List<AnnotatedConstructor> getSingleArgConstructors()
           
 List<AnnotatedMethod> getSingleArgStaticMethods()
           
 Class<?> getType()
          Method used with annotated things that have class type.
 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()
          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)
           
 String toString()
           
 
Methods inherited from class org.codehaus.jackson.map.introspect.Annotated
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)
Factory method that instantiates an instance. Returned instance will only be initialized with class annotations, but not with any method information.


resolveClassAnnotations

protected void resolveClassAnnotations()
Initialization method that will recursively collect Jackson annotations for this class and all super classes and interfaces.


resolveCreators

public void resolveCreators(boolean includeAll)
Initialization method that will find out all constructors and potential static factory methods the class has.

Parameters:
includeAll - If true, includes all creator methods; if false, will only include the no-arguments "default" constructor

resolveMemberMethods

public void resolveMemberMethods(MethodFilter methodFilter)

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.


_constructMethod

protected AnnotatedMethod _constructMethod(Method m)

_constructConstructor

protected AnnotatedConstructor _constructConstructor(Constructor<?> ctor)

_constructField

protected AnnotatedField _constructField(Field f)

_collectRelevantAnnotations

protected AnnotationMap _collectRelevantAnnotations(Annotation[] anns)

_isIncludableMethod

protected boolean _isIncludableMethod(Method m)

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

getType

public Class<?> getType()
Description copied from class: Annotated
Method used with annotated things that have class type.

Specified by:
getType in class Annotated

getDefaultConstructor

public AnnotatedConstructor getDefaultConstructor()

getSingleArgConstructors

public List<AnnotatedConstructor> getSingleArgConstructors()

getSingleArgStaticMethods

public List<AnnotatedMethod> getSingleArgStaticMethods()

memberMethods

public Iterable<AnnotatedMethod> memberMethods()

getMemberMethodCount

public int getMemberMethodCount()

findMethod

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

getFieldCount

public int getFieldCount()

fields

public Iterable<AnnotatedField> fields()

toString

public String toString()
Overrides:
toString in class Object