com.fasterxml.jackson.databind.introspect

Class AnnotatedMember

    • Field Detail

      • _context

        protected final transient AnnotatedClass _context
        Class that was resolved to produce this member instance; either class that declared the member, or one of its subtypes that inherited it.
        Since:
        2.5
      • _annotations

        protected final transient AnnotationMap _annotations
    • Method Detail

      • getDeclaringClass

        public abstract Class<?> getDeclaringClass()
        Actual physical class in which this memmber was declared. Note that this may be different from what getContextClass() returns; "owner" may be a sub-type of "declaring class".
      • getMember

        public abstract Member getMember()
      • getContextClass

        public AnnotatedClass getContextClass()
        Accessor for AnnotatedClass that was the type that was resolved and that contains this member: this is either the Class in which member was declared, or one of its super types. If distinction between result type, and actual class in which declaration was found matters, you can compare return value to that of getDeclaringClass(). The main use for this accessor is (usually) to access class annotations.

        Also note that owner property is NOT (JDK-)serialized; this should usually not matter, but means that while it is accessible during construction of various (de)serializers, it may not be available on per-call basis, if (but only if) ObjectMapper (etc) has been serialized/deserialized.

        Since:
        2.5
      • annotations

        public Iterable<Annotation> annotations()
        Description copied from class: Annotated
        Accessor that can be used to iterate over all the annotations associated with annotated component.
        Specified by:
        annotations in class Annotated
      • getAllAnnotations

        protected AnnotationMap getAllAnnotations()
        Description copied from class: Annotated
        Internal helper method used to access annotation information; not exposed to developers since instances are mutable.
        Specified by:
        getAllAnnotations in class Annotated
      • addOrOverride

        public final boolean addOrOverride(Annotation a)
        Method called to override an annotation, usually due to a mix-in annotation masking or overriding an annotation 'real' constructor has.
      • addIfNotPresent

        public final boolean addIfNotPresent(Annotation a)
        Method called to augment annotations, by adding specified annotation if and only if it is not yet present in the annotation map we have.

Copyright © 2014–2015 FasterXML. All rights reserved.