aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/fasterxml/jackson/databind/cfg/CoercionInputShape.java
blob: 1bd2c2588bb305f72b2b5a99422a2e9c19dd8e1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package com.fasterxml.jackson.databind.cfg;

import com.fasterxml.jackson.databind.type.LogicalType;

/**
 * Set of input types (which mostly match one of
 * {@link com.fasterxml.jackson.core.JsonToken} types) used for
 * configuring {@link CoercionAction}s to take when reading
 * input into target types (specific type or {@link LogicalType}).
 * Contains both physical input shapes (which match one of
 * {@link com.fasterxml.jackson.core.JsonToken} types) and a few
 * logical input shapes ("empty" variants).
 *<p>
 * Note that {@code null} input shape is explicitly not included as
 * its configuration is distinct from other types.
 *
 * @since 2.12
 */
public enum CoercionInputShape
{
    // Physical types

    /**
     * Shape of Array values from input (token sequence from
     * {@link com.fasterxml.jackson.core.JsonToken#START_ARRAY} to
     * {@link com.fasterxml.jackson.core.JsonToken#END_ARRAY})
     */
    Array,

    /**
     * Shape of Object values from input (token sequence from
     * {@link com.fasterxml.jackson.core.JsonToken#START_OBJECT} to
     * {@link com.fasterxml.jackson.core.JsonToken#END_OBJECT})
     */
    Object,

    /**
     * Shape of integral (non-floating point) numeric values from input (token
     * {@link com.fasterxml.jackson.core.JsonToken#VALUE_NUMBER_INT})
     */
    Integer,

    /**
     * Shape of floating point (non-integral) numeric values from input (token
     * {@link com.fasterxml.jackson.core.JsonToken#VALUE_NUMBER_FLOAT})
     */
    Float,

    /**
     * Shape of boolean values from input (tokens
     * {@link com.fasterxml.jackson.core.JsonToken#VALUE_TRUE} and
     * {@link com.fasterxml.jackson.core.JsonToken#VALUE_FALSE})
     */
    Boolean,

    /**
     * Shape of string values from input (tokens
     * {@link com.fasterxml.jackson.core.JsonToken#VALUE_STRING})
     */
    String,

    /**
     * Shape of binary data values from input, if expressed natively
     * by underlying format (many
     * textual formats, including JSON, do not have such shape); if so
     * generally seen as {@link com.fasterxml.jackson.core.JsonToken#VALUE_EMBEDDED_OBJECT}.
     */
    Binary,

    // Logical types

    /**
     * Special case of Array values with no actual content (sequence of 2 tokens:
     * {@link com.fasterxml.jackson.core.JsonToken#START_ARRAY},
     * {@link com.fasterxml.jackson.core.JsonToken#END_ARRAY}):
     * usually used to allow special coercion into "empty" or {@code null} target type.
     */
    EmptyArray,

    /**
     * Special case of Object values with no actual content (sequence of 2 tokens:
     * {@link com.fasterxml.jackson.core.JsonToken#START_OBJECT},
     * {@link com.fasterxml.jackson.core.JsonToken#END_OBJECT}):
     * usually used to allow special coercion into "empty" or {@code null} target type.
     */
    EmptyObject,
    
    /**
     * Special case for String values with no content (or, if allowed by format or specific
     * configuration, also "blank" String, that is, all-whitespace content).
     * usually used to allow special coercion into "empty" or {@code null} target type.
     */
    EmptyString

    ;
}