Top Inners Fields Constructors Methods
com.fasterxml.jackson.databind.introspect

public final Class AnnotatedClass

extends Annotated
implements TypeResolutionContext
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.introspect.TypeResolutionContext
Imports
java.lang.annotation.Annotation, java.lang.reflect.*, java.util.*, com.fasterxml.jackson.databind.AnnotationIntrospector, .JavaType, com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.introspect.ClassIntrospector.MixInResolver, com.fasterxml.jackson.databind.type.TypeBindings, .TypeFactory, com.fasterxml.jackson.databind.util.Annotations, .ClassUtil

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
protected final AnnotationIntrospector
_annotationIntrospector

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

protected final TypeBindings
_bindings

Type bindings to use for members of _class.

protected final Class<?>
_class

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

protected final Annotations
_classAnnotations

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

protected final boolean
_collectAnnotations

Flag that indicates whether (fulll) annotation resolution should occur: starting with 2.11 is disabled for JDK container types.

protected AnnotatedClass.Creators
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 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").

protected transient Boolean
_nonStaticInnerClass

Lazily determined property to see if this is a non-static inner class.

protected final Class<?>
_primaryMixIn

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

protected final List<JavaType>
_superTypes

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

protected final JavaType
protected final TypeFactory
private static final AnnotatedClass.Creators

Constructor Summary

AccessConstructor and Description
pack-priv
AnnotatedClass(JavaType
Fully resolved type; may be `null`, but ONLY if no member fields or methods are to be accessed
type
,
Class<?>
Type-erased class; pass if no `type` needed or available
rawType
,
List<JavaType> superTypes, Class<?> primaryMixIn, Annotations classAnnotations, TypeBindings bindings, AnnotationIntrospector aintr, ClassIntrospector.MixInResolver mir, TypeFactory tf, boolean collectAnnotations)

Constructor will not do any initializations, to allow for configuring instances differently depending on use cases

pack-priv
AnnotatedClass(JavaType type, Class<?> rawType, List<JavaType> superTypes, Class<?> primaryMixIn, Annotations classAnnotations, TypeBindings bindings, AnnotationIntrospector aintr, ClassIntrospector.MixInResolver mir, TypeFactory tf)

Deprecated
pack-priv
AnnotatedClass(Class<?> rawType)

Constructor (only) used for creating primordial simple types (during bootstrapping) and array type placeholders where no fields or methods are needed.

Method Summary

Modifier and TypeMethod and Description
private final AnnotatedClass.Creators
private final List<AnnotatedField>
private final AnnotatedMethodMap
public Iterable<Annotation>
annotations()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.annotations.

Deprecated
Accessor that can be used to iterate over all the annotations associated with annotated component.
public static AnnotatedClass
construct(JavaType type, MapperConfig<?> config)

Deprecated Since 2.9, use methods in AnnotatedClassResolver instead.
public static AnnotatedClass
construct(JavaType type, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)

Deprecated Since 2.9, use methods in AnnotatedClassResolver instead.
public static AnnotatedClass
constructWithoutSuperTypes(Class<?> raw, MapperConfig<?> config)

Deprecated Since 2.9, use methods in AnnotatedClassResolver instead.
Method similar to construct, but that will NOT include information from supertypes; only class itself and any direct mix-ins it may have.
public static AnnotatedClass
constructWithoutSuperTypes(Class<?> raw, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)

Deprecated Since 2.9, use methods in AnnotatedClassResolver instead.
public boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.equals.

Indicates whether some other object is "equal to" this one.
public Iterable<AnnotatedField>
public AnnotatedMethod
findMethod(String name, Class<?>[] paramTypes)

public Class<?>
getAnnotated()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.getAnnotated.

Method that can be used to find actual JDK element that this instance represents.
public <A extends Annotation> A
public Annotations
public List<AnnotatedConstructor>
public AnnotatedConstructor
public List<AnnotatedMethod>
public int
public int
public int
public String
public Class<?>
getRawType()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.getRawType.

"Raw" type (type-erased class) of the annotated element; definition of what exactly this means depends on sub-class.
public List<AnnotatedMethod>
getStaticMethods()

Deprecated Since 2.9; use getFactoryMethods instead.
public JavaType
getType()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.getType.

Full generic type of the annotated element; definition of what exactly this means depends on sub-class.
public boolean
public boolean
public int
hashCode()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.hashCode.

Returns a hash code value for the object.
public boolean
public boolean
public Iterable<AnnotatedMethod>
public JavaType
public String
toString()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.toString.

Returns a string representation of the object.
Inherited from com.fasterxml.jackson.databind.introspect.Annotated:
isPublic

Field Detail

_annotationIntrospectorback to summary
protected final AnnotationIntrospector _annotationIntrospector

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

_bindingsback to summary
protected final TypeBindings _bindings

Type bindings to use for members of _class.

Since
2.7
_classback to summary
protected final Class<?> _class

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

_classAnnotationsback to summary
protected final Annotations _classAnnotations

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

_collectAnnotationsback to summary
protected final boolean _collectAnnotations

Flag that indicates whether (fulll) annotation resolution should occur: starting with 2.11 is disabled for JDK container types.

Since
2.11
_creatorsback to summary
protected AnnotatedClass.Creators _creators
Since
2.9
_fieldsback to summary
protected List<AnnotatedField> _fields

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

_memberMethodsback to summary
protected AnnotatedMethodMap _memberMethods

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

_mixInResolverback to summary
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").

_nonStaticInnerClassback to summary
protected transient Boolean _nonStaticInnerClass

Lazily determined property to see if this is a non-static inner class.

Since
2.8.7
_primaryMixInback to summary
protected final Class<?> _primaryMixIn

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

_superTypesback to summary
protected final List<JavaType> _superTypes

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

_typeback to summary
protected final JavaType _type
Since
2.7
_typeFactoryback to summary
protected final TypeFactory _typeFactory
Since
2.7
NO_CREATORSback to summary
private static final AnnotatedClass.Creators NO_CREATORS

Constructor Detail

AnnotatedClassback to summary
pack-priv AnnotatedClass(JavaType type, Class<?> rawType, List<JavaType> superTypes, Class<?> primaryMixIn, Annotations classAnnotations, TypeBindings bindings, AnnotationIntrospector aintr, ClassIntrospector.MixInResolver mir, TypeFactory tf, boolean collectAnnotations)

Constructor will not do any initializations, to allow for configuring instances differently depending on use cases

Parameters
type:JavaType

Fully resolved type; may be `null`, but ONLY if no member fields or methods are to be accessed

rawType:Class<?>

Type-erased class; pass if no `type` needed or available

AnnotatedClassback to summary
pack-priv AnnotatedClass(JavaType type, Class<?> rawType, List<JavaType> superTypes, Class<?> primaryMixIn, Annotations classAnnotations, TypeBindings bindings, AnnotationIntrospector aintr, ClassIntrospector.MixInResolver mir, TypeFactory tf)

Deprecated

Annotations
@Deprecated
AnnotatedClassback to summary
pack-priv AnnotatedClass(Class<?> rawType)

Constructor (only) used for creating primordial simple types (during bootstrapping) and array type placeholders where no fields or methods are needed.

Since
2.9

Method Detail

_creatorsback to summary
private final AnnotatedClass.Creators _creators()
_fieldsback to summary
private final List<AnnotatedField> _fields()
_methodsback to summary
private final AnnotatedMethodMap _methods()
annotationsback to summary
public Iterable<Annotation> annotations()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.annotations.

Doc from com.fasterxml.jackson.databind.introspect.Annotated.annotations.

Deprecated

Accessor that can be used to iterate over all the annotations associated with annotated component.

Annotations
@Override
@Deprecated
constructback to summary
public static AnnotatedClass construct(JavaType type, MapperConfig<?> config)

Deprecated

Since 2.9, use methods in AnnotatedClassResolver instead.

Annotations
@Deprecated
constructback to summary
public static AnnotatedClass construct(JavaType type, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)

Deprecated

Since 2.9, use methods in AnnotatedClassResolver instead.

Annotations
@Deprecated
constructWithoutSuperTypesback to summary
public static AnnotatedClass constructWithoutSuperTypes(Class<?> raw, MapperConfig<?> config)

Deprecated

Since 2.9, use methods in AnnotatedClassResolver instead.

Method similar to construct, but that will NOT include information from supertypes; only class itself and any direct mix-ins it may have.

Annotations
@Deprecated
constructWithoutSuperTypesback to summary
public static AnnotatedClass constructWithoutSuperTypes(Class<?> raw, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)

Deprecated

Since 2.9, use methods in AnnotatedClassResolver instead.

Annotations
@Deprecated
equalsback to summary
public boolean equals(Object o)

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
fieldsback to summary
public Iterable<AnnotatedField> fields()
findMethodback to summary
public AnnotatedMethod findMethod(String name, Class<?>[] paramTypes)
getAnnotatedback to summary
public Class<?> getAnnotated()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.getAnnotated.

Doc from com.fasterxml.jackson.databind.introspect.Annotated.getAnnotated.

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.

Annotations
@Override
getAnnotationback to summary
public <A extends Annotation> A getAnnotation(Class<A> acls)

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.getAnnotation.

Annotations
@Override
getAnnotationsback to summary
public Annotations getAnnotations()
getConstructorsback to summary
public List<AnnotatedConstructor> getConstructors()
getDefaultConstructorback to summary
public AnnotatedConstructor getDefaultConstructor()
getFactoryMethodsback to summary
public List<AnnotatedMethod> getFactoryMethods()
Since
2.9
getFieldCountback to summary
public int getFieldCount()
getMemberMethodCountback to summary
public int getMemberMethodCount()
getModifiersback to summary
public int getModifiers()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.getModifiers.

Annotations
@Override
getNameback to summary
public String getName()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.getName.

Annotations
@Override
getRawTypeback to summary
public Class<?> getRawType()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.getRawType.

Doc from com.fasterxml.jackson.databind.introspect.Annotated.getRawType.

"Raw" type (type-erased class) of the annotated element; definition of what exactly this means depends on sub-class.

Annotations
@Override
getStaticMethodsback to summary
public List<AnnotatedMethod> getStaticMethods()

Deprecated

Since 2.9; use getFactoryMethods instead.

Annotations
@Deprecated
getTypeback to summary
public JavaType getType()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.getType.

Doc from com.fasterxml.jackson.databind.introspect.Annotated.getType.

Full generic type of the annotated element; definition of what exactly this means depends on sub-class.

Annotations
@Override
hasAnnotationback to summary
public boolean hasAnnotation(Class<?> acls)

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.hasAnnotation.

Annotations
@Override
hasAnnotationsback to summary
public boolean hasAnnotations()
hashCodeback to summary
public int hashCode()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
hasOneOfback to summary
public boolean hasOneOf(Class<? extends Annotation>[] annoClasses)

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.hasOneOf.

Annotations
@Override
isNonStaticInnerClassback to summary
public boolean isNonStaticInnerClass()
Since
2.9
memberMethodsback to summary
public Iterable<AnnotatedMethod> memberMethods()
resolveTypeback to summary
public JavaType resolveType(Type type)

Implements com.fasterxml.jackson.databind.introspect.TypeResolutionContext.resolveType.

Annotations
@Override
toStringback to summary
public String toString()

Implements abstract com.fasterxml.jackson.databind.introspect.Annotated.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
com.fasterxml.jackson.databind.introspect back to summary

public final Class AnnotatedClass.Creators

extends Object
Class Inheritance
  • java.lang.Object
  • com.fasterxml.jackson.databind.introspect.AnnotatedClass.Creators

Field Summary

Modifier and TypeField and Description
public final List<AnnotatedConstructor>
constructors

Single argument constructors the class has, if any.

public final List<AnnotatedMethod>
creatorMethods

Single argument static methods that might be usable as factory methods

public final AnnotatedConstructor
defaultConstructor

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

constructorsback to summary
public final List<AnnotatedConstructor> constructors

Single argument constructors the class has, if any.

creatorMethodsback to summary
public final List<AnnotatedMethod> creatorMethods

Single argument static methods that might be usable as factory methods

defaultConstructorback to summary
public final AnnotatedConstructor defaultConstructor

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

Constructor Detail

Creatorsback to summary
public Creators(AnnotatedConstructor defCtor, List<AnnotatedConstructor> ctors, List<AnnotatedMethod> ctorMethods)