Class AnnotatedClass
- java.lang.Object
-
- com.fasterxml.jackson.databind.introspect.Annotated
-
- com.fasterxml.jackson.databind.introspect.AnnotatedClass
-
- All Implemented Interfaces:
TypeResolutionContext
public final class AnnotatedClass extends Annotated implements TypeResolutionContext
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnnotatedClass.Creators-
Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.introspect.TypeResolutionContext
TypeResolutionContext.Basic, TypeResolutionContext.Empty
-
-
Field Summary
Fields Modifier and Type Field Description protected AnnotationIntrospector_annotationIntrospectorFilter used to determine which annotations to gather; used to optimize things so that unnecessary annotations are ignored.protected TypeBindings_bindingsType bindings to use for members of_class.protected java.lang.Class<?>_classClass for which annotations apply, and that owns other components (constructors, methods)protected Annotations_classAnnotationsCombined list of Jackson annotations that the class has, including inheritable ones from super classes and interfacesprotected boolean_collectAnnotationsFlag that indicates whether (fulll) annotation resolution should occur: starting with 2.11 is disabled for JDK container types.protected AnnotatedClass.Creators_creatorsprotected java.util.List<AnnotatedField>_fieldsMember fields of interest: ones that are either public, or have at least one annotation.protected AnnotatedMethodMap_memberMethodsMember methods of interest; for now ones with 0 or 1 arguments (just optimization, since others won't be used now)protected ClassIntrospector.MixInResolver_mixInResolverObject 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_nonStaticInnerClassLazily determined property to see if this is a non-static inner class.protected java.lang.Class<?>_primaryMixInPrimary mix-in class; one to use for the annotated class itself.protected java.util.List<JavaType>_superTypesOrdered set of super classes and interfaces of the class itself: included in order of precedenceprotected JavaType_typeprotected TypeFactory_typeFactory
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Iterable<java.lang.annotation.Annotation>annotations()Deprecated.static AnnotatedClassconstruct(JavaType type, MapperConfig<?> config)Deprecated.Since 2.9, use methods inAnnotatedClassResolverinstead.static AnnotatedClassconstruct(JavaType type, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)Deprecated.Since 2.9, use methods inAnnotatedClassResolverinstead.static AnnotatedClassconstructWithoutSuperTypes(java.lang.Class<?> raw, MapperConfig<?> config)Deprecated.Since 2.9, use methods inAnnotatedClassResolverinstead.static AnnotatedClassconstructWithoutSuperTypes(java.lang.Class<?> raw, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)Deprecated.Since 2.9, use methods inAnnotatedClassResolverinstead.booleanequals(java.lang.Object o)java.lang.Iterable<AnnotatedField>fields()AnnotatedMethodfindMethod(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>
AgetAnnotation(java.lang.Class<A> acls)AnnotationsgetAnnotations()java.util.List<AnnotatedConstructor>getConstructors()AnnotatedConstructorgetDefaultConstructor()java.util.List<AnnotatedMethod>getFactoryMethods()intgetFieldCount()intgetMemberMethodCount()intgetModifiers()java.lang.StringgetName()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; usegetFactoryMethods()instead.JavaTypegetType()Full generic type of the annotated element; definition of what exactly this means depends on sub-class.booleanhasAnnotation(java.lang.Class<?> acls)booleanhasAnnotations()inthashCode()booleanhasOneOf(java.lang.Class<? extends java.lang.annotation.Annotation>[] annoClasses)booleanisNonStaticInnerClass()java.lang.Iterable<AnnotatedMethod>memberMethods()JavaTyperesolveType(java.lang.reflect.Type type)java.lang.StringtoString()
-
-
-
Field Detail
-
_type
protected final JavaType _type
- Since:
- 2.7
-
_class
protected final java.lang.Class<?> _class
Class for which annotations apply, and that owns other components (constructors, methods)
-
_bindings
protected final TypeBindings _bindings
Type bindings to use for members of_class.- Since:
- 2.7
-
_superTypes
protected final java.util.List<JavaType> _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.
-
_typeFactory
protected final TypeFactory _typeFactory
- Since:
- 2.7
-
_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 java.lang.Class<?> _primaryMixIn
Primary mix-in class; one to use for the annotated class itself. Can be null.
-
_collectAnnotations
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
-
_classAnnotations
protected final Annotations _classAnnotations
Combined list of Jackson annotations that the class has, including inheritable ones from super classes and interfaces
-
_creators
protected AnnotatedClass.Creators _creators
- Since:
- 2.9
-
_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 java.util.List<AnnotatedField> _fields
Member fields of interest: ones that are either public, or have at least one annotation.
-
_nonStaticInnerClass
protected transient java.lang.Boolean _nonStaticInnerClass
Lazily determined property to see if this is a non-static inner class.- Since:
- 2.8.7
-
-
Method Detail
-
construct
@Deprecated public static AnnotatedClass construct(JavaType type, MapperConfig<?> config)
Deprecated.Since 2.9, use methods inAnnotatedClassResolverinstead.
-
construct
@Deprecated public static AnnotatedClass construct(JavaType type, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)
Deprecated.Since 2.9, use methods inAnnotatedClassResolverinstead.
-
constructWithoutSuperTypes
@Deprecated public static AnnotatedClass constructWithoutSuperTypes(java.lang.Class<?> raw, MapperConfig<?> config)
Deprecated.Since 2.9, use methods inAnnotatedClassResolverinstead.Method similar toconstruct(com.fasterxml.jackson.databind.JavaType, com.fasterxml.jackson.databind.cfg.MapperConfig<?>), but that will NOT include information from supertypes; only class itself and any direct mix-ins it may have.
-
constructWithoutSuperTypes
@Deprecated public static AnnotatedClass constructWithoutSuperTypes(java.lang.Class<?> raw, MapperConfig<?> config, ClassIntrospector.MixInResolver mir)
Deprecated.Since 2.9, use methods inAnnotatedClassResolverinstead.
-
resolveType
public JavaType resolveType(java.lang.reflect.Type type)
- Specified by:
resolveTypein interfaceTypeResolutionContext
-
getAnnotated
public java.lang.Class<?> getAnnotated()
Description copied from class:AnnotatedMethod 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:
getAnnotatedin classAnnotated
-
getModifiers
public int getModifiers()
- Specified by:
getModifiersin classAnnotated
-
getAnnotation
public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> acls)
- Specified by:
getAnnotationin classAnnotated
-
hasAnnotation
public boolean hasAnnotation(java.lang.Class<?> acls)
- Specified by:
hasAnnotationin classAnnotated
-
hasOneOf
public boolean hasOneOf(java.lang.Class<? extends java.lang.annotation.Annotation>[] annoClasses)
-
getRawType
public java.lang.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:
getRawTypein classAnnotated
-
annotations
@Deprecated public java.lang.Iterable<java.lang.annotation.Annotation> annotations()
Deprecated.Description copied from class:AnnotatedAccessor that can be used to iterate over all the annotations associated with annotated component.- Specified by:
annotationsin classAnnotated
-
getType
public JavaType getType()
Description copied from class:AnnotatedFull generic type of the annotated element; definition of what exactly this means depends on sub-class.
-
getAnnotations
public Annotations getAnnotations()
-
hasAnnotations
public boolean hasAnnotations()
-
getDefaultConstructor
public AnnotatedConstructor getDefaultConstructor()
-
getConstructors
public java.util.List<AnnotatedConstructor> getConstructors()
-
getFactoryMethods
public java.util.List<AnnotatedMethod> getFactoryMethods()
- Since:
- 2.9
-
getStaticMethods
@Deprecated public java.util.List<AnnotatedMethod> getStaticMethods()
Deprecated.Since 2.9; usegetFactoryMethods()instead.
-
memberMethods
public java.lang.Iterable<AnnotatedMethod> memberMethods()
-
getMemberMethodCount
public int getMemberMethodCount()
-
findMethod
public AnnotatedMethod findMethod(java.lang.String name, java.lang.Class<?>[] paramTypes)
-
getFieldCount
public int getFieldCount()
-
fields
public java.lang.Iterable<AnnotatedField> fields()
-
isNonStaticInnerClass
public boolean isNonStaticInnerClass()
- Since:
- 2.9
-
-