Class AnnotatedClass

java.lang.Object
tools.jackson.databind.introspect.Annotated
tools.jackson.databind.introspect.AnnotatedClass
All Implemented Interfaces:
TypeResolutionContext

public final class AnnotatedClass extends Annotated implements TypeResolutionContext
  • Field Details

    • _config

      protected final MapperConfig<?> _config
    • _type

      protected final JavaType _type
      Resolved Java type for which information is collected: also works as context for resolving possible generic type of accessors declared in this type.
    • _class

      protected final Class<?> _class
      Type erased Class matching _type.
    • _bindings

      protected final TypeBindings _bindings
      Type bindings to use for members of _class.
    • _superTypes

      protected final List<JavaType> _superTypes
      Ordered set of super classes and interfaces of the class itself: included in order of precedence of annotations inherited (starting with immediate super-interfaces, recursively, and then super-class, its super-interfaces, and so forth.
      NOTE: does NOT include Object.
    • _mixInResolver

      protected final 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.
    • _collectAnnotations

      protected final boolean _collectAnnotations
      Flag that indicates whether (full) annotation resolution should occur: is disabled for all JDK types.
    • _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
    • _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.
    • _nonStaticInnerClass

      protected transient Boolean _nonStaticInnerClass
      Lazily determined property to see if this is a non-static inner class.
  • Method Details

    • resolveType

      public JavaType resolveType(Type type)
      Specified by:
      resolveType in interface TypeResolutionContext
    • 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
    • hasAnnotation

      public boolean hasAnnotation(Class<? extends Annotation> acls)
      Specified by:
      hasAnnotation in class Annotated
    • hasOneOf

      public boolean hasOneOf(Class<? extends Annotation>[] annoClasses)
      Specified by:
      hasOneOf in class Annotated
    • annotations

      public Stream<Annotation> annotations()
      Specified by:
      annotations 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
    • getType

      public JavaType getType()
      Description copied from class: Annotated
      Full generic type of the annotated element; definition of what exactly this means depends on sub-class.
      Specified by:
      getType in class Annotated
    • getAnnotations

      public Annotations getAnnotations()
    • hasAnnotations

      public boolean hasAnnotations()
    • getDefaultConstructor

      public AnnotatedConstructor getDefaultConstructor()
    • getConstructors

      public List<AnnotatedConstructor> getConstructors()
    • getFactoryMethods

      public List<AnnotatedMethod> getFactoryMethods()
    • 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()
    • isNonStaticInnerClass

      public boolean isNonStaticInnerClass()
    • getSuperTypes

      public List<JavaType> getSuperTypes()
      Accessor for super-types of class (or interface) represented by this AnnotatedClass, excluding Object.
      Returns:
      List of super-types in decreasing precedence, the order in which annotations are inherited from super types (first immediate super interfaces and their super interfaces; then immediate super class and its super interfaces, super class, and so on).
      Since:
      3.2
    • toString

      public String toString()
      Specified by:
      toString in class Annotated
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class Annotated
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in class Annotated