public static enum JsonTypeInfo.Id extends Enum<JsonTypeInfo.Id>
枚举常量和说明 |
---|
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.
|
限定符和类型 | 方法和说明 |
---|---|
String |
getDefaultPropertyName() |
static JsonTypeInfo.Id |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static JsonTypeInfo.Id[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final JsonTypeInfo.Id NONE
Note: no TypeIdResolver
is constructed if this value is used.
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
- 要返回的枚举常量的名称。如果该枚举类型没有带有指定名称的常量,
- 则抛出 IllegalArgumentException如果参数为空值,
- 则抛出 NullPointerExceptionpublic String getDefaultPropertyName()