Package com.fasterxml.jackson.annotation
Enum Class JsonFormat.Shape
- All Implemented Interfaces:
Serializable
,Comparable<JsonFormat.Shape>
,Constable
- Enclosing class:
- JsonFormat
Value enumeration used for indicating preferred Shape; translates
loosely to JSON types, with some extra values to indicate less precise
choices (i.e. allowing one of multiple actual shapes)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMarker enum value that indicates "whatever" choice, meaning that annotation does NOT specify shape to use.Value that indicates that (JSON) Array type should be used.Value that indicates that Binary type (native, if format supports it; encoding using Base64 if only textual types supported) should be used.Value that indicates that (JSON) boolean type (true, false) should be used.Marker enum value that indicates the "default" choice for given datatype; for example, JSON String forString
, or JSON Number for Java numbers.Value that indicates that a numeric (JSON) type should be used (but does not specify whether integer or floating-point representation should be used)Value that indicates that floating-point numeric type should be usedValue that indicates that integer number type should be used (and notNUMBER_FLOAT
).Value that indicates that (JSON) Object type should be used.Marker enum value that indicates not only shape ofOBJECT
but further handling as POJO, where applicable.Value that indicates that (JSON) String type should be used. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static boolean
isNumeric
(JsonFormat.Shape shapeOrNull) boolean
static boolean
isStructured
(JsonFormat.Shape shapeOrNull) static JsonFormat.Shape
Returns the enum constant of this class with the specified name.static JsonFormat.Shape[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BINARY
Value that indicates that Binary type (native, if format supports it; encoding using Base64 if only textual types supported) should be used. -
BOOLEAN
Value that indicates that (JSON) boolean type (true, false) should be used. -
NUMBER
Value that indicates that a numeric (JSON) type should be used (but does not specify whether integer or floating-point representation should be used) -
NUMBER_FLOAT
Value that indicates that floating-point numeric type should be used -
NUMBER_INT
Value that indicates that integer number type should be used (and notNUMBER_FLOAT
). -
STRING
Value that indicates that (JSON) String type should be used. -
SCALAR
-
ARRAY
Value that indicates that (JSON) Array type should be used. -
OBJECT
Value that indicates that (JSON) Object type should be used. -
ANY
Marker enum value that indicates "whatever" choice, meaning that annotation does NOT specify shape to use. Note that this is different fromNATURAL
, which specifically instructs use of the "natural" shape for datatype. -
NATURAL
-
POJO
Marker enum value that indicates not only shape ofOBJECT
but further handling as POJO, where applicable. Mostly makes difference at Java Object level when distinguishing handling betweenMap
and POJO types.- Since:
- 3.0
-
-
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
-
isNumeric
public boolean isNumeric() -
isNumeric
- Since:
- 3.0
-
isStructured
public boolean isStructured() -
isStructured
- Since:
- 3.0
-