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 Modifier and Type Field Description protected AnnotationMap_annotationsprotected TypeResolutionContext_typeContextContext object needed for resolving generic type associated with this member (method parameter or return value, or field type).
-
Constructor Summary
Constructors Modifier Constructor Description protectedAnnotatedMember(AnnotatedMember base)Copy-constructor.protectedAnnotatedMember(TypeResolutionContext ctxt, AnnotationMap annotations)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Iterable<Annotation>annotations()Deprecated.voidfixAccess(boolean force)Method that can be called to modify access rights, by callingAccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)on the underlying annotated element.AnnotationMapgetAllAnnotations()NOTE: promoted in 2.9 from `Annotated` up<A extends Annotation>
AgetAnnotation(Class<A> acls)abstract Class<?>getDeclaringClass()Actual physical class in which this memmber was declared.StringgetFullName()abstract MembergetMember()TypeResolutionContextgetTypeContext()Deprecated.Since 2.9abstract ObjectgetValue(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.booleanhasAnnotation(Class<?> acls)booleanhasOneOf(Class<? extends Annotation>[] annoClasses)abstract voidsetValue(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.abstract AnnotatedwithAnnotations(AnnotationMap fallback)Fluent factory method that will construct a new instance that uses specified instance annotations instead of currently configured ones.-
Methods inherited from class com.fasterxml.jackson.databind.introspect.Annotated
equals, getAnnotated, getGenericType, getModifiers, getName, getRawType, getType, getType, hashCode, isPublic, toString
-
-
-
-
Field Detail
-
_typeContext
protected final transient TypeResolutionContext _typeContext
Context object needed for resolving generic type associated with this member (method parameter or return value, or field type).- Since:
- 2.7
-
_annotations
protected final transient AnnotationMap _annotations
-
-
Constructor Detail
-
AnnotatedMember
protected AnnotatedMember(TypeResolutionContext ctxt, AnnotationMap annotations)
-
AnnotatedMember
protected AnnotatedMember(AnnotatedMember base)
Copy-constructor.- Since:
- 2.5
-
-
Method Detail
-
withAnnotations
public abstract Annotated withAnnotations(AnnotationMap fallback)
Fluent factory method that will construct a new instance that uses specified instance annotations instead of currently configured ones.- Since:
- 2.9 (promoted from `Annotated`)
-
getDeclaringClass
public abstract Class<?> getDeclaringClass()
Actual physical class in which this memmber was declared.
-
getMember
public abstract Member getMember()
-
getFullName
public String getFullName()
-
getTypeContext
@Deprecated public TypeResolutionContext getTypeContext()
Deprecated.Since 2.9Accessor forTypeResolutionContextthat is used for resolving full generic type of this member.- Since:
- 2.7
-
getAnnotation
public final <A extends Annotation> A getAnnotation(Class<A> acls)
- Specified by:
getAnnotationin classAnnotated
-
hasAnnotation
public final boolean hasAnnotation(Class<?> acls)
- Specified by:
hasAnnotationin classAnnotated
-
hasOneOf
public boolean hasOneOf(Class<? extends Annotation>[] annoClasses)
-
annotations
@Deprecated public Iterable<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
-
getAllAnnotations
public AnnotationMap getAllAnnotations()
NOTE: promoted in 2.9 from `Annotated` up
-
fixAccess
public final void fixAccess(boolean force)
Method that can be called to modify access rights, by callingAccessibleObject.setAccessible(java.lang.reflect.AccessibleObject[], boolean)on the underlying annotated element.Note that caller should verify that
MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERSis enabled before calling this method; as well as passforceflag appropriately.- Since:
- 2.7
-
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)
-
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)
-
-