public enum PropertyAccessor extends Enum<PropertyAccessor>
JsonAutoDetect
apply to.
In addition to method types (GETTER/IS_GETTER, SETTER, CREATOR) 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.
Enum Constant and Description |
---|
ALL
This pseudo-type indicates that all accessors are affected.
|
CREATOR
Creators are constructors and (static) factory methods used to
construct POJO instances for deserialization
|
FIELD
Field refers to fields of regular Java objects.
|
GETTER
Getters are methods used to get a POJO field value for serialization,
or, under certain conditions also for de-serialization.
|
IS_GETTER
"Is getters" are getter-like methods that are named "isXxx"
(instead of "getXxx" for getters) and return boolean value
(either primitive, or
Boolean ). |
NONE
This pseudo-type indicates that none of accessors if affected.
|
SETTER
Setters are methods used to set a POJO value for deserialization.
|
Modifier and Type | Method and Description |
---|---|
boolean |
creatorEnabled() |
boolean |
fieldEnabled() |
boolean |
getterEnabled() |
boolean |
isGetterEnabled() |
boolean |
setterEnabled() |
static PropertyAccessor |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PropertyAccessor[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PropertyAccessor GETTER
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}.
public static final PropertyAccessor SETTER
public static final PropertyAccessor CREATOR
public static final PropertyAccessor FIELD
public static final PropertyAccessor IS_GETTER
Boolean
).public static final PropertyAccessor NONE
public static final PropertyAccessor ALL
public static PropertyAccessor[] values()
for (PropertyAccessor c : PropertyAccessor.values()) System.out.println(c);
public static PropertyAccessor valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean creatorEnabled()
public boolean getterEnabled()
public boolean isGetterEnabled()
public boolean setterEnabled()
public boolean fieldEnabled()
Copyright © 2008–2018 FasterXML. All rights reserved.