com.fasterxml.jackson.databind.introspect

## Class AnnotatedClass

- java.lang.Object
- - com.fasterxml.jackson.databind.introspect.Annotated
  - - com.fasterxml.jackson.databind.introspect.AnnotatedClass

    public final class AnnotatedClass
    extends Annotated

### Field Summary

Fields
`protected AnnotationIntrospector` `_annotationIntrospector` Filter used to determine which annotations to gather; used to optimize things so that unnecessary annotations are ignored.
`protected Class<?>` `_class` Class for which annotations apply, and that owns other components (constructors, methods)
`protected AnnotationMap` `_classAnnotations` Combined list of Jackson annotations that the class has, including inheritable ones from super classes and interfaces
`protected List<AnnotatedConstructor>` `_constructors` Single argument constructors the class has, if any.
`protected List<AnnotatedMethod>` `_creatorMethods` Single argument static methods that might be usable as factory methods
`protected boolean` `_creatorsResolved` Flag to indicate whether creator information has been resolved or not.
`protected AnnotatedConstructor` `_defaultConstructor` Default constructor of the annotated class, if it has one.
`protected List<AnnotatedField>` `_fields` Member fields of interest: ones that are either public, or have at least one annotation.
`protected AnnotatedMethodMap` `_memberMethods` Member methods of interest; for now ones with 0 or 1 arguments (just optimization, since others won't be used now)
`protected ClassIntrospector.MixInResolver` `_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 Class<?>` `_primaryMixIn` Primary mix-in class; one to use for the annotated class itself.
`protected List<Class<?>>` `_superTypes` Ordered set of super classes and interfaces of the class itself: included in order of precedence

### Method Summary

Methods
`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<?> 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` `_addMemberMethods(Class<?> cls, AnnotatedMethodMap methods, Class<?> mixInCls, AnnotatedMethodMap mixIns)`
`protected void` `_addMethodMixIns(Class<?> targetClass, 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` `_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 Map<String,AnnotatedField>` `_findFields(Class<?> c, Map<String,AnnotatedField> fields)`
`protected boolean` `_isIncludableMemberMethod(Method m)`
`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<?>, com.fasterxml.jackson.databind.AnnotationIntrospector, com.fasterxml.jackson.databind.introspect.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)`
`protected AnnotationMap` `getAllAnnotations()`
`Class<?>` `getAnnotated()` Method that can be used to find actual JDK element that this instance represents.
`<A extends Annotation> A` `getAnnotation(Class<A> acls)`
`Annotations` `getAnnotations()`
`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<AnnotatedMethod>` `memberMethods()`
`String` `toString()`
`AnnotatedClass` `withAnnotations(AnnotationMap ann)` Fluent factory method that will construct a new instance that uses specified instance annotations instead of currently configured ones.

### Methods inherited from class com.fasterxml.jackson.databind.introspect.Annotated

`getType, hasAnnotation, isPublic, withFallBackAnnotationsFrom`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### _class

    protected final Class<?> _class

Class for which annotations apply, and that owns other components (constructors, methods)

#### _superTypes

    protected final List<Class<?>> _superTypes

Ordered set of super classes and interfaces of the class itself: included in order of precedence

#### _annotationIntrospector

    protected final AnnotationIntrospector _annotationIntrospector

Filter used to determine which annotations to gather; used to optimize things so that unnecessary annotations are ignored.

#### _mixInResolver

    protected final ClassIntrospector.MixInResolver _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

    protected final Class<?> _primaryMixIn

Primary mix-in class; one to use for the annotated class itself. Can be null.

#### _classAnnotations

    protected AnnotationMap _classAnnotations

Combined list of Jackson annotations that the class has, including inheritable ones from super classes and interfaces

#### _creatorsResolved

    protected boolean _creatorsResolved

Flag to indicate whether creator information has been resolved or not.

#### _defaultConstructor

    protected AnnotatedConstructor _defaultConstructor

Default constructor of the annotated class, if it has one.

#### _constructors

    protected List<AnnotatedConstructor> _constructors

Single argument constructors the class has, if any.

#### _creatorMethods

    protected List<AnnotatedMethod> _creatorMethods

Single argument static methods that might be usable as factory methods

#### _memberMethods

    protected AnnotatedMethodMap _memberMethods

Member methods of interest; for now ones with 0 or 1 arguments (just optimization, since others won't be used now)

#### _fields

    protected List<AnnotatedField> _fields

Member fields of interest: ones that are either public, or have at least one annotation.

### Method Detail

#### withAnnotations

    public AnnotatedClass withAnnotations(AnnotationMap ann)

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 class `Annotated`

#### 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<?>, com.fasterxml.jackson.databind.AnnotationIntrospector, com.fasterxml.jackson.databind.introspect.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()

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 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`

#### getAllAnnotations

    protected AnnotationMap getAllAnnotations()

Specified by:
  `getAllAnnotations` in class `Annotated`

#### getAnnotations

    public Annotations getAnnotations()

#### hasAnnotations

    public boolean hasAnnotations()

#### getDefaultConstructor

    public AnnotatedConstructor getDefaultConstructor()

#### getConstructors

    public List<AnnotatedConstructor> getConstructors()

#### getStaticMethods

    public List<AnnotatedMethod> getStaticMethods()

#### 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()

#### _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)

#### _addConstructorMixIns

    protected void _addConstructorMixIns(Class<?> mixin)

#### _addFactoryMixIns

    protected void _addFactoryMixIns(Class<?> mixin)

#### _addMemberMethods

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

#### _addMethodMixIns

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

#### _findFields

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

#### _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

    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)

#### _isIncludableMemberMethod

    protected boolean _isIncludableMemberMethod(Method m)

#### _collectRelevantAnnotations

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

#### _collectRelevantAnnotations

    protected AnnotationMap _collectRelevantAnnotations(Annotation[] anns)

#### _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 src,
                     AnnotatedMethod target)

Method that will add annotations from specified source method to target method, but only if target does not yet have them.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`