public class JsonNodeDeserializer extends StdDeserializer<T>
JsonNode
from any
JSON content, using appropriate JsonNode
type.JsonDeserializer.None
_valueClass
Modifier | Constructor and Description |
---|---|
protected |
JsonNodeDeserializer() |
Modifier and Type | Method and Description |
---|---|
protected void |
_handleDuplicateField(com.fasterxml.jackson.core.JsonParser jp,
DeserializationContext ctxt,
JsonNodeFactory nodeFactory,
String fieldName,
ObjectNode objectNode,
JsonNode oldValue,
JsonNode newValue)
Method called when there is a duplicate value for a field.
|
protected void |
_handleDuplicateField(String fieldName,
ObjectNode objectNode,
JsonNode oldValue,
JsonNode newValue)
Deprecated.
Since 2.3, use the overloaded variant
|
protected void |
_reportProblem(com.fasterxml.jackson.core.JsonParser jp,
String msg) |
JsonNode |
deserialize(com.fasterxml.jackson.core.JsonParser jp,
DeserializationContext ctxt)
Implementation that will produce types of any JSON nodes; not just one
deserializer is registered to handle (in case of more specialized handler).
|
protected JsonNode |
deserializeAny(com.fasterxml.jackson.core.JsonParser jp,
DeserializationContext ctxt,
JsonNodeFactory nodeFactory) |
protected ArrayNode |
deserializeArray(com.fasterxml.jackson.core.JsonParser jp,
DeserializationContext ctxt,
JsonNodeFactory nodeFactory) |
protected ObjectNode |
deserializeObject(com.fasterxml.jackson.core.JsonParser jp,
DeserializationContext ctxt,
JsonNodeFactory nodeFactory) |
Object |
deserializeWithType(com.fasterxml.jackson.core.JsonParser jp,
DeserializationContext ctxt,
TypeDeserializer typeDeserializer)
Base implementation that does not assume specific type
inclusion mechanism.
|
static JsonDeserializer<? extends JsonNode> |
getDeserializer(Class<?> nodeClass)
Factory method for accessing deserializer for specific node type
|
JsonNode |
getNullValue()
Method that can be called to determine value to be used for
representing null values (values deserialized when JSON token
is
JsonToken.VALUE_NULL ). |
_hasTextualNull, _parseBoolean, _parseBooleanFromNumber, _parseBooleanPrimitive, _parseByte, _parseDate, _parseDouble, _parseDoublePrimitive, _parseFloat, _parseFloatPrimitive, _parseInteger, _parseIntPrimitive, _parseLong, _parseLongPrimitive, _parseShort, _parseShortPrimitive, _parseString, findConvertingContentDeserializer, findDeserializer, getValueClass, getValueType, handledType, handleUnknownProperty, isDefaultDeserializer, isDefaultKeyDeserializer, parseDouble
deserialize, findBackReference, getDelegatee, getEmptyValue, getKnownPropertyNames, getObjectIdReader, isCachable, replaceDelegatee, unwrappingDeserializer
public static JsonDeserializer<? extends JsonNode> getDeserializer(Class<?> nodeClass)
public JsonNode getNullValue()
JsonDeserializer
JsonToken.VALUE_NULL
). Usually this is simply
Java null, but for some types (especially primitives) it may be
necessary to use non-null values.
Note that deserializers are allowed to call this just once and then reuse returned value; that is, method is not guaranteed to be called once for each conversion.
Default implementation simply returns null.
getNullValue
in class JsonDeserializer<JsonNode>
public JsonNode deserialize(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
deserialize
in class JsonDeserializer<JsonNode>
jp
- Parsed used for reading JSON contentctxt
- Context that can be used to access information about
this deserialization activity.IOException
com.fasterxml.jackson.core.JsonProcessingException
public Object deserializeWithType(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
StdDeserializer
deserializeWithType
in class StdDeserializer<T extends JsonNode>
typeDeserializer
- Deserializer to use for handling type informationIOException
com.fasterxml.jackson.core.JsonProcessingException
protected void _reportProblem(com.fasterxml.jackson.core.JsonParser jp, String msg) throws JsonMappingException
JsonMappingException
@Deprecated protected void _handleDuplicateField(String fieldName, ObjectNode objectNode, JsonNode oldValue, JsonNode newValue) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingException
protected void _handleDuplicateField(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt, JsonNodeFactory nodeFactory, String fieldName, ObjectNode objectNode, JsonNode oldValue, JsonNode newValue) throws com.fasterxml.jackson.core.JsonProcessingException
fieldName
- Name of the field for which duplicate value was foundobjectNode
- Object node that contains valuesoldValue
- Value that existed for the object node before newValue
was addednewValue
- Newly added value just added to the object nodecom.fasterxml.jackson.core.JsonProcessingException
protected final ObjectNode deserializeObject(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt, JsonNodeFactory nodeFactory) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
IOException
com.fasterxml.jackson.core.JsonProcessingException
protected final ArrayNode deserializeArray(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt, JsonNodeFactory nodeFactory) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
IOException
com.fasterxml.jackson.core.JsonProcessingException
protected final JsonNode deserializeAny(com.fasterxml.jackson.core.JsonParser jp, DeserializationContext ctxt, JsonNodeFactory nodeFactory) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
IOException
com.fasterxml.jackson.core.JsonProcessingException
Copyright © 2012-2013 FasterXML. All Rights Reserved.