public static enum JsonTypeInfo.Id extends Enum<JsonTypeInfo.Id>
Enum Constant and Description |
---|
CLASS
Means that fully-qualified Java class name is used as the type identifier.
|
CUSTOM
Means that typing mechanism uses customized handling, with possibly
custom configuration.
|
MINIMAL_CLASS
Means that Java class name with minimal path is used as the type identifier.
|
NAME
Means that logical type name is used as type information; name will then need
to be separately resolved to actual concrete type (Class).
|
NONE
This means that no explicit type metadata is included, and typing is
purely done using contextual information possibly augmented with other
annotations.
|
Modifier and Type | Method and Description |
---|---|
String |
getDefaultPropertyName() |
static JsonTypeInfo.Id |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JsonTypeInfo.Id[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JsonTypeInfo.Id NONE
public static final JsonTypeInfo.Id CLASS
public static final JsonTypeInfo.Id MINIMAL_CLASS
If all related classes are in the same Java package, this option can reduce
amount of type information overhead, especially for small types.
However, please note that using this alternative is inherently risky since it
assumes that the
supertype can be reliably detected. Given that it is based on declared type
(since ultimate supertype, java.lang.Object
would not be very
useful reference point), this may not always work as expected.
public static final JsonTypeInfo.Id NAME
public static final JsonTypeInfo.Id CUSTOM
public static JsonTypeInfo.Id[] values()
for (JsonTypeInfo.Id c : JsonTypeInfo.Id.values()) System.out.println(c);
public static JsonTypeInfo.Id 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 String getDefaultPropertyName()
Copyright © 2008–2019 FasterXML. All rights reserved.