public abstract class AnnotatedMember extends Annotated implements Serializable
Modifier and Type | Field and Description |
---|---|
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.
|
Modifier | Constructor and Description |
---|---|
protected |
AnnotatedMember(AnnotatedClass ctxt,
AnnotationMap annotations) |
protected |
AnnotatedMember(AnnotatedMember base)
Copy-constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
equals, getAnnotated, getAnnotation, getGenericType, getModifiers, getName, getRawType, getType, hasAnnotation, hashCode, isPublic, toString, withAnnotations, withFallBackAnnotationsFrom
protected final transient AnnotatedClass _context
protected final transient AnnotationMap _annotations
protected AnnotatedMember(AnnotatedClass ctxt, AnnotationMap annotations)
protected AnnotatedMember(AnnotatedMember base)
public abstract Class<?> getDeclaringClass()
getContextClass()
returns;
"owner" may be a sub-type of "declaring class".public abstract Member getMember()
public AnnotatedClass getContextClass()
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.
public Iterable<Annotation> annotations()
Annotated
annotations
in class Annotated
protected AnnotationMap getAllAnnotations()
Annotated
getAllAnnotations
in class Annotated
public final boolean addOrOverride(Annotation a)
public final boolean addIfNotPresent(Annotation a)
public final void fixAccess()
AccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)
on
the underlying annotated element.public abstract void setValue(Object pojo, Object value) throws UnsupportedOperationException, IllegalArgumentException
This is implemented for fields and single-argument member methods; but not for constructor parameters or other types of methods (like static methods)
public abstract Object getValue(Object pojo) throws UnsupportedOperationException, IllegalArgumentException
This is implemented for fields and no-argument member methods; but not for constructor parameters or other types of methods (like static methods)
Copyright © 2008–2018 FasterXML. All rights reserved.