Enum Class JsonTypeInfo.As
java.lang.Object
java.lang.Enum<JsonTypeInfo.As>
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.annotation.JsonTypeInfo.As
- All Implemented Interfaces:
Serializable
,Comparable<JsonTypeInfo.As>
,java.lang.constant.Constable
- Enclosing class:
- JsonTypeInfo
Definition of standard type inclusion mechanisms for type metadata.
Used for standard metadata types, except for
JsonTypeInfo.Id.NONE
.
May or may not be used for custom types (JsonTypeInfo.Id.CUSTOM
).-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionInclusion mechanism similar toPROPERTY
with respect to deserialization; but one that is produced by a "regular" accessible property during serialization.Inclusion mechanism similar toPROPERTY
, except that property is included one-level higher in hierarchy, i.e.Inclusion mechanism that uses a single configurable property, included along with actual data (POJO properties) as a separate meta-property.Inclusion mechanism that wraps typed JSON value (POJO serialized as JSON) in a 2-element JSON array: first element is the serialized type identifier, and second element the serialized POJO as JSON Object.Inclusion mechanism that wraps typed JSON value (POJO serialized as JSON) in a JSON Object that has a single entry, where field name is serialized type identifier, and value is the actual JSON value. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonTypeInfo.As
Returns the enum constant of this class with the specified name.static JsonTypeInfo.As[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PROPERTY
Inclusion mechanism that uses a single configurable property, included along with actual data (POJO properties) as a separate meta-property.Default choice for inclusion.
-
WRAPPER_OBJECT
Inclusion mechanism that wraps typed JSON value (POJO serialized as JSON) in a JSON Object that has a single entry, where field name is serialized type identifier, and value is the actual JSON value.Note: can only be used if type information can be serialized as String. This is true for standard type metadata types, but not necessarily for custom types.
-
WRAPPER_ARRAY
Inclusion mechanism that wraps typed JSON value (POJO serialized as JSON) in a 2-element JSON array: first element is the serialized type identifier, and second element the serialized POJO as JSON Object. -
EXTERNAL_PROPERTY
Inclusion mechanism similar toPROPERTY
, except that property is included one-level higher in hierarchy, i.e. as sibling property at same level as JSON Object to type. Note that this mechanism can only be used for properties, not for types (classes). Trying to use it for classes will result in inclusion strategy of basicPROPERTY
instead.Note also that this mechanism can not be used for container values (arrays,
Collection
s,Map
s); it only works for scalar and POJO values. -
EXISTING_PROPERTY
Inclusion mechanism similar toPROPERTY
with respect to deserialization; but one that is produced by a "regular" accessible property during serialization. This means thatTypeSerializer
will do nothing, and expects a property with defined name to be output using some other mechanism (like default POJO property serialization, or custom serializer).Note that this behavior is quite similar to that of using
JsonTypeId
annotation; except that hereTypeSerializer
is basically suppressed; whereas withJsonTypeId
, output of regular property is suppressed. This mostly matters with respect to output order; this choice is the only way to ensure specific placement of type id during serialization.- Since:
- 2.3.0 but databind only since 2.5.0.
-
-
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
-