Package com.fasterxml.jackson.annotation
Enum Class PropertyAccessor
- All Implemented Interfaces:
Serializable
,Comparable<PropertyAccessor>
,Constable
Enumeration used to define kinds of elements (called "property accessors")
that annotations like
JsonAutoDetect
apply to.
In addition to method types (GETTER/IS_GETTER, SETTER, CREATOR, SCALAR_CONSTRUCTOR) and the
field type (FIELD), 2 pseudo-types
are defined for convenience: ALWAYS
and NONE
. These
can be used to indicate, all or none of available method types (respectively),
for use by annotations that takes JsonMethod
argument.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis pseudo-type indicates that all accessors are affected.Creators are constructors and (static) factory methods used to construct POJO instances for deserialization, not including single-scalar-argument constructors (for whichSCALAR_CONSTRUCTOR
is used).Field refers to fields of regular Java objects.Getters are methods used to get a POJO field value for serialization, or, under certain conditions also for de-serialization."Is getters" are getter-like methods that are named "isXxx" (instead of "getXxx" for getters) and return boolean value (either primitive, orBoolean
).This pseudo-type indicates that none of accessors if affected.Scalar constructors are special case creators: constructors that take just one scalar argument of one typesint
,long
,boolean
,double
orString
.Setters are methods used to set a POJO value for deserialization. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
boolean
boolean
static PropertyAccessor
Returns the enum constant of this class with the specified name.static PropertyAccessor[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GETTER
Getters are methods used to get a POJO field value for serialization, or, under certain conditions also for de-serialization. Latter can be used for effectively setting Collection or Map values in absence of setters, if returned value is not a copy but actual value of the logical property.Since version 1.3, this does NOT include "is getters" (methods that return boolean and named 'isXxx' for property 'xxx'); instead,
IS_GETTER
is used. -
SETTER
Setters are methods used to set a POJO value for deserialization. -
FIELD
Field refers to fields of regular Java objects. Although they are not really methods, addition of optional field-discovery in version 1.1 meant that there was need to enable/disable their auto-detection, and this is the place to add it in. -
IS_GETTER
"Is getters" are getter-like methods that are named "isXxx" (instead of "getXxx" for getters) and return boolean value (either primitive, orBoolean
). -
CREATOR
Creators are constructors and (static) factory methods used to construct POJO instances for deserialization, not including single-scalar-argument constructors (for whichSCALAR_CONSTRUCTOR
is used). -
SCALAR_CONSTRUCTOR
Scalar constructors are special case creators: constructors that take just one scalar argument of one typesint
,long
,boolean
,double
orString
.- Since:
- 3.0
-
NONE
This pseudo-type indicates that none of accessors if affected. -
ALL
This pseudo-type indicates that all accessors are affected.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
creatorEnabled
public boolean creatorEnabled() -
scalarConstructorEnabled
public boolean scalarConstructorEnabled() -
getterEnabled
public boolean getterEnabled() -
isGetterEnabled
public boolean isGetterEnabled() -
setterEnabled
public boolean setterEnabled() -
fieldEnabled
public boolean fieldEnabled()
-