Package org.codehaus.jackson.map
Enum ObjectMapper.DefaultTyping
- java.lang.Object
-
- java.lang.Enum<ObjectMapper.DefaultTyping>
-
- org.codehaus.jackson.map.ObjectMapper.DefaultTyping
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ObjectMapper.DefaultTyping>
- Enclosing class:
- ObjectMapper
public static enum ObjectMapper.DefaultTyping extends java.lang.Enum<ObjectMapper.DefaultTyping>
Enumeration used withObjectMapper.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.- Since:
- 1.5
-
-
Enum Constant Summary
Enum Constants Enum Constant Description JAVA_LANG_OBJECT
This value means that only properties that haveObject
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 byOBJECT_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 ofObject
or an abstract type (abstract class or interface).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectMapper.DefaultTyping
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ObjectMapper.DefaultTyping[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
JAVA_LANG_OBJECT
public static final ObjectMapper.DefaultTyping JAVA_LANG_OBJECT
This value means that only properties that haveObject
as declared type (including generic types without explicit type) will use default typing.
-
OBJECT_AND_NON_CONCRETE
public static final ObjectMapper.DefaultTyping OBJECT_AND_NON_CONCRETE
Value that means that default typing will be used for properties with declared type ofObject
or an abstract type (abstract class or interface). Note that this does not include array types.
-
NON_CONCRETE_AND_ARRAYS
public static final ObjectMapper.DefaultTyping NON_CONCRETE_AND_ARRAYS
Value that means that default typing will be used for all types covered byOBJECT_AND_NON_CONCRETE
plus all array types for them.
-
NON_FINAL
public static final ObjectMapper.DefaultTyping 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.
-
-
Method Detail
-
values
public static ObjectMapper.DefaultTyping[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ObjectMapper.DefaultTyping c : ObjectMapper.DefaultTyping.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ObjectMapper.DefaultTyping valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-