|
3 | 3 | import java.math.BigDecimal;
|
4 | 4 | import java.math.BigInteger;
|
5 | 5 |
|
| 6 | +import com.fasterxml.jackson.databind.util.RawValue; |
| 7 | + |
6 | 8 | /**
|
7 | 9 | * Interface that defines common "creator" functionality implemented
|
8 | 10 | * both by {@link JsonNodeFactory} and {@link ContainerNode} (that is,
|
@@ -34,13 +36,29 @@ public interface JsonNodeCreator
|
34 | 36 | public ValueNode numberNode(Double value);
|
35 | 37 | public ValueNode numberNode(BigDecimal v);
|
36 | 38 |
|
37 |
| - // Textual nodes, other value (non-structured) nodes |
| 39 | + // Textual nodes |
38 | 40 |
|
39 | 41 | public ValueNode textNode(String text);
|
| 42 | + |
| 43 | + // Other value (non-structured) nodes |
| 44 | + |
40 | 45 | public ValueNode binaryNode(byte[] data);
|
41 | 46 | public ValueNode binaryNode(byte[] data, int offset, int length);
|
42 | 47 | public ValueNode pojoNode(Object pojo);
|
43 | 48 |
|
| 49 | + /** |
| 50 | + * Factory method to use for adding "raw values"; pre-encoded values |
| 51 | + * that are included exactly as-is when node is serialized. |
| 52 | + * This may be used, for example, to include fully serialized JSON |
| 53 | + * sub-trees. |
| 54 | + * Note that the concept may not work with all backends, and since |
| 55 | + * no translation of any kinds is done it will not work when converting |
| 56 | + * between data formats. |
| 57 | + * |
| 58 | + * @since 2.6 |
| 59 | + */ |
| 60 | + public ValueNode rawValueNode(RawValue value); |
| 61 | + |
44 | 62 | // Structured nodes:
|
45 | 63 | // (bit unkosher, due to forward references... but has to do for now)
|
46 | 64 |
|
|
0 commit comments