public final class AnnotatedClass extends Annotated implements TypeResolutionContext
Modifier and Type | Class and Description |
---|---|
static class |
AnnotatedClass.Creators |
TypeResolutionContext.Basic
Modifier and Type | Field and Description |
---|---|
protected AnnotationIntrospector |
_annotationIntrospector
Filter used to determine which annotations to gather; used
to optimize things so that unnecessary annotations are
ignored.
|
protected TypeBindings |
_bindings
Type bindings to use for members of
_class . |
protected java.lang.Class<?> |
_class
Class for which annotations apply, and that owns other
components (constructors, methods)
|
protected Annotations |
_classAnnotations
Combined list of Jackson annotations that the class has,
including inheritable ones from super classes and interfaces
|
protected AnnotatedClass.Creators |
_creators |
protected java.util.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 java.lang.Boolean |
_nonStaticInnerClass
Lazily determined property to see if this is a non-static inner
class.
|
protected java.lang.Class<?> |
_primaryMixIn
Primary mix-in class; one to use for the annotated class
itself.
|
protected java.util.List<JavaType> |
_superTypes
Ordered set of super classes and interfaces of the
class itself: included in order of precedence
|
protected JavaType |
_type |
protected TypeFactory |
_typeFactory |
private static AnnotatedClass.Creators |
NO_CREATORS |
Constructor and Description |
---|
AnnotatedClass(java.lang.Class<?> rawType)
Constructor (only) used for creating primordial simple types (during bootstrapping)
and array type placeholders where no fields or methods are needed.
|
AnnotatedClass(JavaType type,
java.lang.Class<?> rawType,
java.util.List<JavaType> superTypes,
java.lang.Class<?> primaryMixIn,
Annotations classAnnotations,
TypeBindings bindings,
AnnotationIntrospector aintr,
ClassIntrospector.MixInResolver mir,
TypeFactory tf)
Constructor will not do any initializations, to allow for
configuring instances differently depending on use cases
|
Modifier and Type | Method and Description |
---|---|
private AnnotatedClass.Creators |
_creators() |
private java.util.List<AnnotatedField> |
_fields() |
private AnnotatedMethodMap |
_methods() |
java.lang.Iterable<java.lang.annotation.Annotation> |
annotations()
Deprecated.
|
static AnnotatedClass |
construct(JavaType type,
MapperConfig<?> config)
Deprecated.
Since 2.9, use methods in
AnnotatedClassResolver instead. |
static AnnotatedClass |
construct(JavaType type,
MapperConfig<?> config,
ClassIntrospector.MixInResolver mir)
Deprecated.
Since 2.9, use methods in
AnnotatedClassResolver instead. |
static AnnotatedClass |
constructWithoutSuperTypes(java.lang.Class<?> raw,
MapperConfig<?> config)
Deprecated.
Since 2.9, use methods in
AnnotatedClassResolver instead. |
static AnnotatedClass |
constructWithoutSuperTypes(java.lang.Class<?> raw,
MapperConfig<?> config,
ClassIntrospector.MixInResolver mir)
Deprecated.
Since 2.9, use methods in
AnnotatedClassResolver instead. |
boolean |
equals(java.lang.Object o) |
java.lang.Iterable<AnnotatedField> |
fields() |
AnnotatedMethod |
findMethod(java.lang.String name,
java.lang.Class<?>[] paramTypes) |
java.lang.Class<?> |
getAnnotated()
Method that can be used to find actual JDK element that this instance
represents.
|
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> acls) |
Annotations |
getAnnotations() |
java.util.List<AnnotatedConstructor> |
getConstructors() |
AnnotatedConstructor |
getDefaultConstructor() |
java.util.List<AnnotatedMethod> |
getFactoryMethods() |
int |
getFieldCount() |
int |
getMemberMethodCount() |
int |
getModifiers() |
java.lang.String |
getName() |
java.lang.Class<?> |
getRawType()
"Raw" type (type-erased class) of the annotated element; definition
of what exactly this means depends on sub-class.
|
java.util.List<AnnotatedMethod> |
getStaticMethods()
Deprecated.
Since 2.9; use
getFactoryMethods() instead. |
JavaType |
getType()
Full generic type of the annotated element; definition
of what exactly this means depends on sub-class.
|
boolean |
hasAnnotation(java.lang.Class<?> acls) |
boolean |
hasAnnotations() |
int |
hashCode() |
boolean |
hasOneOf(java.lang.Class<? extends java.lang.annotation.Annotation>[] annoClasses) |
boolean |
isNonStaticInnerClass() |
java.lang.Iterable<AnnotatedMethod> |
memberMethods() |
JavaType |
resolveType(java.lang.reflect.Type type) |
java.lang.String |
toString() |
getGenericType, getType, isPublic
private static final AnnotatedClass.Creators NO_CREATORS
protected final JavaType _type
protected final java.lang.Class<?> _class
protected final TypeBindings _bindings
_class
.protected final java.util.List<JavaType> _superTypes
protected final AnnotationIntrospector _annotationIntrospector
protected final TypeFactory _typeFactory
protected final ClassIntrospector.MixInResolver _mixInResolver
protected final java.lang.Class<?> _primaryMixIn
protected final Annotations _classAnnotations
protected AnnotatedClass.Creators _creators
protected AnnotatedMethodMap _memberMethods
protected java.util.List<AnnotatedField> _fields
protected transient java.lang.Boolean _nonStaticInnerClass
AnnotatedClass(JavaType type, java.lang.Class<?> rawType, java.util.List<JavaType> superTypes, java.lang.Class<?> primaryMixIn, Annotations classAnnotations, TypeBindings bindings, AnnotationIntrospector aintr, ClassIntrospector.MixInResolver mir, TypeFactory tf)
type
- Fully resolved type; may be `null`, but ONLY if no member fields or
methods are to be accessedrawType
- Type-erased class; pass if no `type` needed or availableAnnotatedClass(java.lang.Class<?> rawType)
@Deprecated public static AnnotatedClass construct(JavaType type, MapperConfig<?> config)
AnnotatedClassResolver
instead.@Deprecated public static AnnotatedClass construct(JavaType type, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)
AnnotatedClassResolver
instead.@Deprecated public static AnnotatedClass constructWithoutSuperTypes(java.lang.Class<?> raw, MapperConfig<?> config)
AnnotatedClassResolver
instead.@Deprecated public static AnnotatedClass constructWithoutSuperTypes(java.lang.Class<?> raw, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)
AnnotatedClassResolver
instead.public JavaType resolveType(java.lang.reflect.Type type)
resolveType
in interface TypeResolutionContext
public java.lang.Class<?> getAnnotated()
Annotated
getAnnotated
in class Annotated
public int getModifiers()
getModifiers
in class Annotated
public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> acls)
getAnnotation
in class Annotated
public boolean hasAnnotation(java.lang.Class<?> acls)
hasAnnotation
in class Annotated
public boolean hasOneOf(java.lang.Class<? extends java.lang.annotation.Annotation>[] annoClasses)
public java.lang.Class<?> getRawType()
Annotated
getRawType
in class Annotated
@Deprecated public java.lang.Iterable<java.lang.annotation.Annotation> annotations()
Annotated
annotations
in class Annotated
public JavaType getType()
Annotated
public Annotations getAnnotations()
public boolean hasAnnotations()
public AnnotatedConstructor getDefaultConstructor()
public java.util.List<AnnotatedConstructor> getConstructors()
public java.util.List<AnnotatedMethod> getFactoryMethods()
@Deprecated public java.util.List<AnnotatedMethod> getStaticMethods()
getFactoryMethods()
instead.public java.lang.Iterable<AnnotatedMethod> memberMethods()
public int getMemberMethodCount()
public AnnotatedMethod findMethod(java.lang.String name, java.lang.Class<?>[] paramTypes)
public int getFieldCount()
public java.lang.Iterable<AnnotatedField> fields()
public boolean isNonStaticInnerClass()
private final java.util.List<AnnotatedField> _fields()
private final AnnotatedMethodMap _methods()
private final AnnotatedClass.Creators _creators()