com.fasterxml.jackson.databind.introspect

## Class AnnotatedMember

- java.lang.Object
- - com.fasterxml.jackson.databind.introspect.Annotated
  - - com.fasterxml.jackson.databind.introspect.AnnotatedMember

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  AnnotatedField, AnnotatedParameter, AnnotatedWithParams, VirtualAnnotatedMember

    public abstract class AnnotatedMember
    extends Annotated
    implements Serializable

Intermediate base class for annotated entities that are members of a class; fields, methods and constructors. This is a superset of things that can represent logical properties as it contains constructors in addition to fields and methods.

See Also:
  Serialized Form

### Field Summary

Fields
`protected AnnotationMap` `_annotations`
`protected 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.

### Constructor Summary

Constructors
`protected` `AnnotatedMember(AnnotatedClass ctxt, AnnotationMap annotations)`
`protected` `AnnotatedMember(AnnotatedMember base)` Copy-constructor.

### Method Summary

Methods
`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.
`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.
`Iterable<Annotation>` `annotations()` Accessor that can be used to iterate over all the annotations associated with annotated component.
`void` `fixAccess()` Method that can be called to modify access rights, by calling `AccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)` on the underlying annotated element.
`protected AnnotationMap` `getAllAnnotations()` Internal helper method used to access annotation information; not exposed to developers since instances are mutable.
`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.
`abstract Class<?>` `getDeclaringClass()` Actual physical class in which this memmber was declared.
`abstract Member` `getMember()`
`abstract Object` `getValue(Object pojo)` Optional method that can be used to access the value of this member on given object, if this is a supported operation for member type.
`abstract void` `setValue(Object pojo, Object value)` Optional method that can be used to assign value of this member on given object, if this is a supported operation for member type.

### Methods inherited from class com.fasterxml.jackson.databind.introspect.Annotated

`equals, getAnnotated, getAnnotation, getGenericType, getModifiers, getName, getRawType, getType, hasAnnotation, hashCode, isPublic, toString, withAnnotations, withFallBackAnnotationsFrom`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### 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

### Constructor Detail

#### AnnotatedMember

    protected AnnotatedMember(AnnotatedClass ctxt,
                   AnnotationMap annotations)

#### AnnotatedMember

    protected AnnotatedMember(AnnotatedMember base)

Copy-constructor.

Since:
  2.5

### 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.

#### fixAccess

    public final void fixAccess()

Method that can be called to modify access rights, by calling `AccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)` on the underlying annotated element.

#### setValue

    public abstract void setValue(Object pojo,
                Object value)
                           throws UnsupportedOperationException,
                                  IllegalArgumentException

Optional method that can be used to assign value of this member on given object, if this is a supported operation for member type.

This is implemented for fields and single-argument member methods; but not for constructor parameters or other types of methods (like static methods)

Throws:
  `UnsupportedOperationException`
  `IllegalArgumentException`

#### getValue

    public abstract Object getValue(Object pojo)
                             throws UnsupportedOperationException,
                                    IllegalArgumentException

Optional method that can be used to access the value of this member on given object, if this is a supported operation for member type.

This is implemented for fields and no-argument member methods; but not for constructor parameters or other types of methods (like static methods)

Throws:
  `UnsupportedOperationException`
  `IllegalArgumentException`