public static enum ObjectMapper.DefaultTyping extends Enum<ObjectMapper.DefaultTyping>
ObjectMapper.enableDefaultTyping()
to specify what kind of types (classes) default typing should
be used for. It will only be used if no explicit type information
is found, but this enumeration further limits subset of those
types.枚举常量和说明 |
---|
JAVA_LANG_OBJECT
This value means that only properties that have
Object as declared type (including
generic types without explicit type) will use default
typing. |
NON_CONCRETE_AND_ARRAYS
Value that means that default typing will be used for
all types covered by
OBJECT_AND_NON_CONCRETE
plus all array types for them. |
NON_FINAL
Value that means that default typing will be used for
all non-final types, with exception of small number of
"natural" types (String, Boolean, Integer, Double), which
can be correctly inferred from JSON; as well as for
all arrays of non-final types.
|
OBJECT_AND_NON_CONCRETE
Value that means that default typing will be used for
properties with declared type of
Object
or an abstract type (abstract class or interface). |
public static final ObjectMapper.DefaultTyping JAVA_LANG_OBJECT
Object
as declared type (including
generic types without explicit type) will use default
typing.public static final ObjectMapper.DefaultTyping OBJECT_AND_NON_CONCRETE
Object
or an abstract type (abstract class or interface).
Note that this does not include array types.public static final ObjectMapper.DefaultTyping NON_CONCRETE_AND_ARRAYS
OBJECT_AND_NON_CONCRETE
plus all array types for them.public static final ObjectMapper.DefaultTyping NON_FINAL
public static ObjectMapper.DefaultTyping[] values()
for (ObjectMapper.DefaultTyping c : ObjectMapper.DefaultTyping.values()) System.out.println(c);
public static ObjectMapper.DefaultTyping valueOf(String name)
name
- 要返回的枚举常量的名称。如果该枚举类型没有带有指定名称的常量,
- 则抛出 IllegalArgumentException如果参数为空值,
- 则抛出 NullPointerException