File tree 5 files changed +28
-8
lines changed
main/java/com/fasterxml/jackson/databind/node
test/java/com/fasterxml/jackson/databind/node
5 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ Project: jackson-databind
21
21
#2204 : Add `JsonNode.isEmpty()` as convenience alias
22
22
#2217 : Suboptimal memory allocation in `TextNode.getBinaryValue()`
23
23
(reported by Christoph B)
24
+ #2223 : Add `missingNode()` method in `JsonNodeFactory`
24
25
25
26
2.9.8 (15 -Dec-2018 )
26
27
Original file line number Diff line number Diff line change @@ -52,11 +52,26 @@ protected ContainerNode(JsonNodeFactory nc) {
52
52
53
53
/*
54
54
/**********************************************************
55
- /* JsonNodeCreator implementation, just dispatch to
56
- /* the real creator
55
+ /* JsonNodeCreator implementation, Enumerated/singleton types
57
56
/**********************************************************
58
57
*/
59
58
59
+ @ Override
60
+ public final BooleanNode booleanNode (boolean v ) { return _nodeFactory .booleanNode (v ); }
61
+
62
+ public JsonNode missingNode () {
63
+ return _nodeFactory .missingNode ();
64
+ }
65
+
66
+ @ Override
67
+ public final NullNode nullNode () { return _nodeFactory .nullNode (); }
68
+
69
+ /*
70
+ /**********************************************************
71
+ /* JsonNodeCreator implementation, just dispatch to real creator
72
+ /**********************************************************
73
+ */
74
+
60
75
/**
61
76
* Factory method that constructs and returns an empty {@link ArrayNode}
62
77
* Construction is done using registered {@link JsonNodeFactory}.
@@ -79,12 +94,6 @@ protected ContainerNode(JsonNodeFactory nc) {
79
94
@ Override
80
95
public final ObjectNode objectNode () { return _nodeFactory .objectNode (); }
81
96
82
- @ Override
83
- public final NullNode nullNode () { return _nodeFactory .nullNode (); }
84
-
85
- @ Override
86
- public final BooleanNode booleanNode (boolean v ) { return _nodeFactory .booleanNode (v ); }
87
-
88
97
@ Override
89
98
public final NumericNode numberNode (byte v ) { return _nodeFactory .numberNode (v ); }
90
99
@ Override
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ public interface JsonNodeCreator
19
19
public ValueNode booleanNode (boolean v );
20
20
public ValueNode nullNode ();
21
21
22
+ // Not yet in 2.10, will be added in 3.0
23
+ // public JsonNode missingNode();
24
+
22
25
// Numeric types
23
26
24
27
public ValueNode numberNode (byte v );
Original file line number Diff line number Diff line change 3
3
import java .math .BigDecimal ;
4
4
import java .math .BigInteger ;
5
5
6
+ import com .fasterxml .jackson .databind .JsonNode ;
6
7
import com .fasterxml .jackson .databind .util .RawValue ;
7
8
8
9
/**
@@ -108,6 +109,10 @@ public BooleanNode booleanNode(boolean v) {
108
109
@ Override
109
110
public NullNode nullNode () { return NullNode .getInstance (); }
110
111
112
+ public JsonNode missingNode () {
113
+ return MissingNode .getInstance ();
114
+ }
115
+
111
116
/*
112
117
/**********************************************************
113
118
/* Factory methods for numeric values
Original file line number Diff line number Diff line change @@ -33,5 +33,7 @@ public void testSimpleCreation()
33
33
assertTrue (f .numberNode ((BigDecimal ) null ).isNull ());
34
34
35
35
assertTrue (f .numberNode ((BigInteger ) null ).isNull ());
36
+
37
+ assertTrue (f .missingNode ().isMissingNode ());
36
38
}
37
39
}
You can’t perform that action at this time.
0 commit comments