Enum Class WritableTypeId.Inclusion
- All Implemented Interfaces:
Serializable
,Comparable<WritableTypeId.Inclusion>
,java.lang.constant.Constable
- Enclosing class:
- WritableTypeId
NOTE: in most cases this only matters with formats that do NOT have native type id capabilities, and require type id to be included within regular data (whether exposed as Java properties or not). Formats with native types usually use native type id functionality regardless, unless overridden by a feature to use "non-native" type inclusion.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionInclusion as a property within Object to write, but logically as separate metadata that is not exposed as payload to caller: that is, does not match any of visible properties value object has.Inclusion as a property within "parent" Object of value Object to write.Inclusion as a "regular" property within Object to write; this implies that its value should come from regular POJO property on serialization, and be deserialized into such property.Inclusion as wrapper Array (1st element type id, 2nd element value).Inclusion as wrapper Object that has one key/value pair where type id is the key for typed value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static WritableTypeId.Inclusion
Returns the enum constant of this class with the specified name.static WritableTypeId.Inclusion[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
WRAPPER_ARRAY
Inclusion as wrapper Array (1st element type id, 2nd element value).Corresponds to
JsonTypeInfo.As.WRAPPER_ARRAY
. -
WRAPPER_OBJECT
Inclusion as wrapper Object that has one key/value pair where type id is the key for typed value.Corresponds to
JsonTypeInfo.As.WRAPPER_OBJECT
. -
METADATA_PROPERTY
Inclusion as a property within Object to write, but logically as separate metadata that is not exposed as payload to caller: that is, does not match any of visible properties value object has.NOTE: if shape of typed value to write is NOT Object, will instead use
WRAPPER_ARRAY
inclusion.Corresponds to
JsonTypeInfo.As.PROPERTY
. -
PAYLOAD_PROPERTY
Inclusion as a "regular" property within Object to write; this implies that its value should come from regular POJO property on serialization, and be deserialized into such property. This handling, however, is up to databinding.Regarding handling, type id is ONLY written as native type id; if no native type ids available, caller is assumed to handle output some other way. This is different from
METADATA_PROPERTY
.NOTE: if shape of typed value to write is NOT Object, will instead use
WRAPPER_ARRAY
inclusion.Corresponds to
JsonTypeInfo.As.EXISTING_PROPERTY
. -
PARENT_PROPERTY
Inclusion as a property within "parent" Object of value Object to write. This typically requires slightly convoluted processing in which property that contains type id is actually written after typed value object itself is written.
Note that it is illegal to call write method if the current (parent) write context is not Object: no coercion is done for other inclusion types (unlike with otherxxx_PROPERTY
choices. This also means that root values MAY NOT use this type id inclusion mechanism (as they have no parent context).Corresponds to
JsonTypeInfo.As.EXTERNAL_PROPERTY
.
-
-
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
-
requiresObjectContext
public boolean requiresObjectContext()
-