Additional top-level class in compilation unit: BaseNodeDeserializer.
JsonNode from any
JSON content, using appropriate JsonNode type.
Rewritten in Jackson 2.13 to avoid recursion and allow handling of very deeply nested structures.
| 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 JsonDeserializer | _createWithMerge(boolean mergeArrays, boolean mergeObjects)
Implements abstract com.
|
| public JsonNode | deserialize(JsonParser
Parser used for reading JSON content p, DeserializationContext Context that can be used to access information about
this deserialization activity. ctxt)Implements abstract com. 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 com. Overrides default com. Overridden variant to ensure that absent values are NOT coerced into
|
| public static JsonDeserializer | |
| public JsonNode | getNullValue(DeserializationContext ctxt)
Overrides com. Implements com. 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 com. 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 JsonDeserializer Implements abstract com.
| |
| deserialize | back to summary |
|---|---|
| public JsonNode deserialize(JsonParser p, DeserializationContext ctxt) throws IOException Implements abstract com. 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 com. Overrides default com. Overridden variant to ensure that absent values are NOT coerced into
| |
| getDeserializer | back to summary |
|---|---|
| public static JsonDeserializer Factory method for accessing deserializer for specific node type | |
| getNullValue | back to summary |
|---|---|
| public JsonNode getNullValue(DeserializationContext ctxt) Overrides com. Implements com. Doc from com. 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 com. Doc from com. 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. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | ArrayDeserializer(JsonNodeDeserializer.
|
| Modifier and Type | Method and Description |
|---|---|
| protected JsonDeserializer | _createWithMerge(boolean mergeArrays, boolean mergeObjects)
Implements abstract com.
|
| public ArrayNode | deserialize(JsonParser
Parser used for reading JSON content p, DeserializationContext Context that can be used to access information about
this deserialization activity. ctxt)Implements abstract com. 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 com. Variant needed to support both root-level |
| public static JsonNodeDeserializer. |
| _instance | back to summary |
|---|---|
| protected static final JsonNodeDeserializer. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| ArrayDeserializer | back to summary |
|---|---|
| protected ArrayDeserializer() | |
| ArrayDeserializer | back to summary |
|---|---|
| protected ArrayDeserializer(JsonNodeDeserializer. | |
| _createWithMerge | back to summary |
|---|---|
| protected JsonDeserializer Implements abstract com.
| |
| deserialize | back to summary |
|---|---|
| public ArrayNode deserialize(JsonParser p, DeserializationContext ctxt) throws IOException Implements abstract com. Doc from com. 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 IOException Overrides com. 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. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | ObjectDeserializer(JsonNodeDeserializer.
|
| Modifier and Type | Method and Description |
|---|---|
| protected JsonDeserializer | _createWithMerge(boolean mergeArrays, boolean mergeObjects)
Implements abstract com.
|
| public ObjectNode | deserialize(JsonParser
Parser used for reading JSON content p, DeserializationContext Context that can be used to access information about
this deserialization activity. ctxt)Implements abstract com. 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 com. Variant needed to support both root-level `updateValue()` and merging. |
| public static JsonNodeDeserializer. |
| _instance | back to summary |
|---|---|
| protected static final JsonNodeDeserializer. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| ObjectDeserializer | back to summary |
|---|---|
| protected ObjectDeserializer() | |
| ObjectDeserializer | back to summary |
|---|---|
| protected ObjectDeserializer(JsonNodeDeserializer. | |
| _createWithMerge | back to summary |
|---|---|
| protected JsonDeserializer Implements abstract com.
| |
| deserialize | back to summary |
|---|---|
| public ObjectNode deserialize(JsonParser p, DeserializationContext ctxt) throws IOException Implements abstract com. Doc from com. 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 IOException Overrides com. Variant needed to support both root-level `updateValue()` and merging.
| |
| getInstance | back to summary |
|---|---|
| public static JsonNodeDeserializer. | |