• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.fasterxml.jackson.databind.cfg;
2 
3 import com.fasterxml.jackson.databind.type.LogicalType;
4 
5 /**
6  * Set of input types (which mostly match one of
7  * {@link com.fasterxml.jackson.core.JsonToken} types) used for
8  * configuring {@link CoercionAction}s to take when reading
9  * input into target types (specific type or {@link LogicalType}).
10  * Contains both physical input shapes (which match one of
11  * {@link com.fasterxml.jackson.core.JsonToken} types) and a few
12  * logical input shapes ("empty" variants).
13  *<p>
14  * Note that {@code null} input shape is explicitly not included as
15  * its configuration is distinct from other types.
16  *
17  * @since 2.12
18  */
19 public enum CoercionInputShape
20 {
21     // Physical types
22 
23     /**
24      * Shape of Array values from input (token sequence from
25      * {@link com.fasterxml.jackson.core.JsonToken#START_ARRAY} to
26      * {@link com.fasterxml.jackson.core.JsonToken#END_ARRAY})
27      */
28     Array,
29 
30     /**
31      * Shape of Object values from input (token sequence from
32      * {@link com.fasterxml.jackson.core.JsonToken#START_OBJECT} to
33      * {@link com.fasterxml.jackson.core.JsonToken#END_OBJECT})
34      */
35     Object,
36 
37     /**
38      * Shape of integral (non-floating point) numeric values from input (token
39      * {@link com.fasterxml.jackson.core.JsonToken#VALUE_NUMBER_INT})
40      */
41     Integer,
42 
43     /**
44      * Shape of floating point (non-integral) numeric values from input (token
45      * {@link com.fasterxml.jackson.core.JsonToken#VALUE_NUMBER_FLOAT})
46      */
47     Float,
48 
49     /**
50      * Shape of boolean values from input (tokens
51      * {@link com.fasterxml.jackson.core.JsonToken#VALUE_TRUE} and
52      * {@link com.fasterxml.jackson.core.JsonToken#VALUE_FALSE})
53      */
54     Boolean,
55 
56     /**
57      * Shape of string values from input (tokens
58      * {@link com.fasterxml.jackson.core.JsonToken#VALUE_STRING})
59      */
60     String,
61 
62     /**
63      * Shape of binary data values from input, if expressed natively
64      * by underlying format (many
65      * textual formats, including JSON, do not have such shape); if so
66      * generally seen as {@link com.fasterxml.jackson.core.JsonToken#VALUE_EMBEDDED_OBJECT}.
67      */
68     Binary,
69 
70     // Logical types
71 
72     /**
73      * Special case of Array values with no actual content (sequence of 2 tokens:
74      * {@link com.fasterxml.jackson.core.JsonToken#START_ARRAY},
75      * {@link com.fasterxml.jackson.core.JsonToken#END_ARRAY}):
76      * usually used to allow special coercion into "empty" or {@code null} target type.
77      */
78     EmptyArray,
79 
80     /**
81      * Special case of Object values with no actual content (sequence of 2 tokens:
82      * {@link com.fasterxml.jackson.core.JsonToken#START_OBJECT},
83      * {@link com.fasterxml.jackson.core.JsonToken#END_OBJECT}):
84      * usually used to allow special coercion into "empty" or {@code null} target type.
85      */
86     EmptyObject,
87 
88     /**
89      * Special case for String values with no content (or, if allowed by format or specific
90      * configuration, also "blank" String, that is, all-whitespace content).
91      * usually used to allow special coercion into "empty" or {@code null} target type.
92      */
93     EmptyString
94 
95     ;
96 }
97