Package com.fasterxml.jackson.annotation
Enum Class JsonProperty.Access
- All Implemented Interfaces:
Serializable
,Comparable<JsonProperty.Access>
,Constable
- Enclosing class:
- JsonProperty
Various options for
JsonProperty.access()
property, specifying how property
may be accessed during serialization ("read") and deserialization ("write")
(note that the direction of read and write is from perspective of the property,
not from external data format: this may be confusing in some contexts).
Note that while this annotation modifies access to annotated property,
its effects may be further overridden by JsonIgnore
property:
if both annotations are present on an accessors, JsonIgnore
has precedence over this property.
This annotation property is, however, preferred over use of "split"
JsonIgnore
/JsonProperty
combination.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAccess setting which means that visibility rules are to be used to automatically determine read- and/or write-access of this property.Access setting that means that the property may only be read for serialization (value accessed via "getter" Method, or read from Field) but not written (set) during deserialization.Access setting that means that the property will be accessed for both serialization (writing out values as external representation) and deserialization (reading values from external representation), regardless of visibility rules.Access setting that means that the property may only be written (set) as part of deserialization (using "setter" method, or assigning to Field, or passed as Creator argument) but will not be read (get) for serialization, that is, the value of the property is not included in serialization. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonProperty.Access
Returns the enum constant of this class with the specified name.static JsonProperty.Access[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
Access setting which means that visibility rules are to be used to automatically determine read- and/or write-access of this property. -
READ_ONLY
Access setting that means that the property may only be read for serialization (value accessed via "getter" Method, or read from Field) but not written (set) during deserialization. Put another way, this would reflect "read-only POJO", in which value contained may be read but not written/set. -
WRITE_ONLY
Access setting that means that the property may only be written (set) as part of deserialization (using "setter" method, or assigning to Field, or passed as Creator argument) but will not be read (get) for serialization, that is, the value of the property is not included in serialization. -
READ_WRITE
Access setting that means that the property will be accessed for both serialization (writing out values as external representation) and deserialization (reading values from external representation), regardless of visibility rules.
-
-
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
-