Package org.codehaus.jackson.annotate
Enum Class JsonTypeInfo.As
- All Implemented Interfaces:
Serializable
,Comparable<JsonTypeInfo.As>
,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 ConstantsEnum ConstantDescriptionInclusion 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 choice can only be used for properties, not for types (classes). Trying to use it for classes will result in inclusion strategy of basicPROPERTY
instead.- Since:
- 1.9
-
-
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
-