Class AnnotatedField
- java.lang.Object
-
- com.fasterxml.jackson.databind.introspect.Annotated
-
- com.fasterxml.jackson.databind.introspect.AnnotatedMember
-
- com.fasterxml.jackson.databind.introspect.AnnotatedField
-
- All Implemented Interfaces:
Serializable
public final class AnnotatedField extends AnnotatedMember implements Serializable
Object that represents non-static (and usually non-transient/volatile) fields of a class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Field_fieldActualFieldused for access.protected com.fasterxml.jackson.databind.introspect.AnnotatedField.Serialization_serializationTemporary field required for JDK serialization support-
Fields inherited from class com.fasterxml.jackson.databind.introspect.AnnotatedMember
_annotations, _typeContext
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAnnotatedField(com.fasterxml.jackson.databind.introspect.AnnotatedField.Serialization ser)Method used for JDK serialization supportAnnotatedField(TypeResolutionContext contextClass, Field field, AnnotationMap annMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object o)FieldgetAnnotated()Method that can be used to find actual JDK element that this instance represents.intgetAnnotationCount()Class<?>getDeclaringClass()Actual physical class in which this memmber was declared.TypegetGenericType()Deprecated.MembergetMember()intgetModifiers()StringgetName()Class<?>getRawType()"Raw" type (type-erased class) of the annotated element; definition of what exactly this means depends on sub-class.JavaTypegetType()Full generic type of the annotated element; definition of what exactly this means depends on sub-class.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.inthashCode()booleanisTransient()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.StringtoString()AnnotatedFieldwithAnnotations(AnnotationMap ann)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.AnnotatedMember
annotations, fixAccess, getAllAnnotations, getAnnotation, getFullName, getTypeContext, hasAnnotation, hasOneOf
-
-
-
-
Field Detail
-
_field
protected final transient Field _field
ActualFieldused for access.Transient since it cannot be persisted directly using JDK serialization
-
_serialization
protected com.fasterxml.jackson.databind.introspect.AnnotatedField.Serialization _serialization
Temporary field required for JDK serialization support
-
-
Constructor Detail
-
AnnotatedField
public AnnotatedField(TypeResolutionContext contextClass, Field field, AnnotationMap annMap)
-
AnnotatedField
protected AnnotatedField(com.fasterxml.jackson.databind.introspect.AnnotatedField.Serialization ser)
Method used for JDK serialization support
-
-
Method Detail
-
withAnnotations
public AnnotatedField withAnnotations(AnnotationMap ann)
Description copied from class:AnnotatedMemberFluent factory method that will construct a new instance that uses specified instance annotations instead of currently configured ones.- Specified by:
withAnnotationsin classAnnotatedMember
-
getAnnotated
public Field getAnnotated()
Description copied from class:AnnotatedMethod 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:
getAnnotatedin classAnnotated
-
getModifiers
public int getModifiers()
- Specified by:
getModifiersin classAnnotated
-
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:
getRawTypein classAnnotated
-
getGenericType
@Deprecated public Type getGenericType()
Deprecated.Description copied from class:AnnotatedJDK declared generic type of the annotated element; definition of what exactly this means depends on sub-class. Note that such type cannot be reliably resolved withoutTypeResolutionContext, and as a result use of this method was deprecated in Jackson 2.7: seeAnnotated.getType()for replacement.- Overrides:
getGenericTypein classAnnotated
-
getType
public JavaType getType()
Description copied from class:AnnotatedFull generic type of the annotated element; definition of what exactly this means depends on sub-class.
-
getDeclaringClass
public Class<?> getDeclaringClass()
Description copied from class:AnnotatedMemberActual physical class in which this memmber was declared.- Specified by:
getDeclaringClassin classAnnotatedMember
-
getMember
public Member getMember()
- Specified by:
getMemberin classAnnotatedMember
-
setValue
public void setValue(Object pojo, Object value) throws IllegalArgumentException
Description copied from class:AnnotatedMemberOptional 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)
- Specified by:
setValuein classAnnotatedMember- Throws:
IllegalArgumentException
-
getValue
public Object getValue(Object pojo) throws IllegalArgumentException
Description copied from class:AnnotatedMemberOptional 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)
- Specified by:
getValuein classAnnotatedMember- Throws:
IllegalArgumentException
-
getAnnotationCount
public int getAnnotationCount()
-
isTransient
public boolean isTransient()
- Since:
- 2.6
-
-