JsonNode from any
JSON content, using appropriate JsonNode type.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | JsonNodeDeserializer.
Implementation used when declared type is specifically |
| pack-priv static class | JsonNodeDeserializer.
Implementation used when declared type is specifically |
| Modifier and Type | Field and Description |
|---|---|
| private static final JsonNodeDeserializer |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected BaseNodeDeserializer | _createWithMerge(boolean mergeArrays, boolean mergeObjects)
Implements abstract tools.
|
| public JsonNode | deserialize(JsonParser p, DeserializationContext ctxt)
Implements abstract tools. Implementation that will produce types of any JSON nodes; not just one deserializer is registered to handle (in case of more specialized handler). |
| public Object | getAbsentValue(DeserializationContext ctxt)
Overrides tools. Overrides default tools. Overridden variant to ensure that absent values are NOT coerced into
|
| public static BaseNodeDeserializer | |
| public JsonNode | getNullValue(DeserializationContext ctxt)
Overrides tools. Implements tools. Method that can be called to determine value to be used for
representing null values (values deserialized when JSON token
is |
| public Boolean | supportsUpdate(DeserializationConfig config)
Overrides tools. Introspection method that may be called to see whether deserializer supports update of an existing value (aka "merging") or not. |
| instance | back to summary |
|---|---|
| private static final JsonNodeDeserializer instance Singleton instance of generic deserializer for | |
| JsonNodeDeserializer | back to summary |
|---|---|
| protected JsonNodeDeserializer() | |
| JsonNodeDeserializer | back to summary |
|---|---|
| protected JsonNodeDeserializer(JsonNodeDeserializer base, boolean mergeArrays, boolean mergeObjects) | |
| _createWithMerge | back to summary |
|---|---|
| protected BaseNodeDeserializer Implements abstract tools.
| |
| deserialize | back to summary |
|---|---|
| public JsonNode deserialize(JsonParser p, DeserializationContext ctxt) throws JacksonException Implements abstract tools. Implementation that will produce types of any JSON nodes; not just one deserializer is registered to handle (in case of more specialized handler). Overridden by typed sub-classes for more thorough checking
| |
| getAbsentValue | back to summary |
|---|---|
| public Object getAbsentValue(DeserializationContext ctxt) Overrides tools. Overrides default tools. Overridden variant to ensure that absent values are NOT coerced into
| |
| getDeserializer | back to summary |
|---|---|
| public static BaseNodeDeserializer Factory method for accessing deserializer for specific node type | |
| getNullValue | back to summary |
|---|---|
| public JsonNode getNullValue(DeserializationContext ctxt) Overrides tools. Implements tools. Doc from tools. Method that can be called to determine value to be used for
representing null values (values deserialized when JSON token
is
This method may be called once, or multiple times, depending on what
Default implementation simply returns null.
| |
| supportsUpdate | back to summary |
|---|---|
| public Boolean supportsUpdate(DeserializationConfig config) Overrides tools. Doc from tools. Introspection method that may be called to see whether deserializer supports
update of an existing value (aka "merging") or not. Return value should either
be
Information gathered is typically used to either prevent merging update for
property (either by skipping, if based on global defaults; or by exception during
deserializer construction if explicit attempt made) if
Default implementation returns
| |
ArrayNode.
| Modifier and Type | Field and Description |
|---|---|
| protected static final JsonNodeDeserializer. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | ArrayDeserializer(JsonNodeDeserializer.
|
| Modifier and Type | Method and Description |
|---|---|
| protected BaseNodeDeserializer | _createWithMerge(boolean mergeArrays, boolean mergeObjects)
Implements abstract tools.
|
| public ArrayNode | deserialize(JsonParser p, DeserializationContext ctxt)
Implements abstract tools. Method that can be called to ask implementation to deserialize JSON content into the value type this serializer handles. |
| public ArrayNode | deserialize(JsonParser p, DeserializationContext ctxt, ArrayNode arrayNode)
Overrides tools. Variant needed to support both root-level |
| public static JsonNodeDeserializer. |
| _instance | back to summary |
|---|---|
| protected static final JsonNodeDeserializer. | |
| ArrayDeserializer | back to summary |
|---|---|
| protected ArrayDeserializer() | |
| ArrayDeserializer | back to summary |
|---|---|
| protected ArrayDeserializer(JsonNodeDeserializer. | |
| _createWithMerge | back to summary |
|---|---|
| protected BaseNodeDeserializer Implements abstract tools.
| |
| deserialize | back to summary |
|---|---|
| public ArrayNode deserialize(JsonParser p, DeserializationContext ctxt) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to deserialize JSON content into the value type this serializer handles. Returned instance is to be constructed by method itself. Pre-condition for this method is that the parser points to the first event that is part of value to deserializer (and which is never JSON 'null' literal, more on this below): for simple types it may be the only value; and for structured types the Object start marker or a FIELD_NAME. The two possible input conditions for structured types result from polymorphism via fields. In the ordinary case, Jackson calls this method when it has encountered an OBJECT_START, and the method implementation must advance to the next token to see the first field name. If the application configures polymorphism via a field, then the object looks like the following.
{
"@class": "class name",
...
}
Jackson consumes the two tokens (the @class field name
and its value) in order to learn the class and select the deserializer.
Thus, the stream is pointing to the FIELD_NAME for the first field
after the @class. Thus, if you want your method to work correctly
both with and without polymorphism, you must begin your method with:
if (p.currentToken() == JsonToken.START_OBJECT) {
p.nextToken();
}
This results in the stream pointing to the field name, so that
the two conditions align.
Post-condition is that the parser will point to the last event that is part of deserialized value (or in case deserialization fails, event that was not recognized or usable, which may be the same event as the one it pointed to upon call).
Handling null values (JsonToken.VALUE_NULL)
| |
| deserialize | back to summary |
|---|---|
| public ArrayNode deserialize(JsonParser p, DeserializationContext ctxt, ArrayNode arrayNode) throws JacksonException Overrides tools. Variant needed to support both root-level
| |
| getInstance | back to summary |
|---|---|
| public static JsonNodeDeserializer. | |
ObjectNode.
| Modifier and Type | Field and Description |
|---|---|
| protected static final JsonNodeDeserializer. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | ObjectDeserializer(JsonNodeDeserializer.
|
| Modifier and Type | Method and Description |
|---|---|
| protected BaseNodeDeserializer | _createWithMerge(boolean mergeArrays, boolean mergeObjects)
Implements abstract tools.
|
| public ObjectNode | deserialize(JsonParser p, DeserializationContext ctxt)
Implements abstract tools. Method that can be called to ask implementation to deserialize JSON content into the value type this serializer handles. |
| public ObjectNode | deserialize(JsonParser p, DeserializationContext ctxt, ObjectNode node)
Overrides tools. Variant needed to support both root-level `updateValue()` and merging. |
| public static JsonNodeDeserializer. |
| _instance | back to summary |
|---|---|
| protected static final JsonNodeDeserializer. | |
| ObjectDeserializer | back to summary |
|---|---|
| protected ObjectDeserializer() | |
| ObjectDeserializer | back to summary |
|---|---|
| protected ObjectDeserializer(JsonNodeDeserializer. | |
| _createWithMerge | back to summary |
|---|---|
| protected BaseNodeDeserializer Implements abstract tools.
| |
| deserialize | back to summary |
|---|---|
| public ObjectNode deserialize(JsonParser p, DeserializationContext ctxt) throws JacksonException Implements abstract tools. Doc from tools. Method that can be called to ask implementation to deserialize JSON content into the value type this serializer handles. Returned instance is to be constructed by method itself. Pre-condition for this method is that the parser points to the first event that is part of value to deserializer (and which is never JSON 'null' literal, more on this below): for simple types it may be the only value; and for structured types the Object start marker or a FIELD_NAME. The two possible input conditions for structured types result from polymorphism via fields. In the ordinary case, Jackson calls this method when it has encountered an OBJECT_START, and the method implementation must advance to the next token to see the first field name. If the application configures polymorphism via a field, then the object looks like the following.
{
"@class": "class name",
...
}
Jackson consumes the two tokens (the @class field name
and its value) in order to learn the class and select the deserializer.
Thus, the stream is pointing to the FIELD_NAME for the first field
after the @class. Thus, if you want your method to work correctly
both with and without polymorphism, you must begin your method with:
if (p.currentToken() == JsonToken.START_OBJECT) {
p.nextToken();
}
This results in the stream pointing to the field name, so that
the two conditions align.
Post-condition is that the parser will point to the last event that is part of deserialized value (or in case deserialization fails, event that was not recognized or usable, which may be the same event as the one it pointed to upon call).
Handling null values (JsonToken.VALUE_NULL)
| |
| deserialize | back to summary |
|---|---|
| public ObjectNode deserialize(JsonParser p, DeserializationContext ctxt, ObjectNode node) throws JacksonException Overrides tools. Variant needed to support both root-level `updateValue()` and merging.
| |
| getInstance | back to summary |
|---|---|
| public static JsonNodeDeserializer. | |