Top Description Inners Fields Constructors Methods
com.fasterxml.jackson.databind.ext

public Class CoreXMLDeserializers

extends Base
Class Inheritance
Imports
java.io.IOException, java.util.*, javax.xml.datatype.*, javax.xml.namespace.QName, com.fasterxml.jackson.core.*, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.deser.Deserializers, com.fasterxml.jackson.databind.deser.std.FromStringDeserializer

Container deserializers that handle "core" XML types: ones included in standard JDK 1.5. Types are directly needed by JAXB, but may be unavailable on some limited platforms; hence separate out from basic deserializer factory.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CoreXMLDeserializers.Std

Combo-deserializer that supports deserialization of somewhat optional javax.xml types QName, Duration and XMLGregorianCalendar.

Field Summary

Modifier and TypeField and Description
pack-priv static final DatatypeFactory
_dataTypeFactory

Data type factories are thread-safe after instantiation (and configuration, if any); and since instantion (esp.

protected static final int
protected static final int
protected static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public JsonDeserializer<?>
findBeanDeserializer(JavaType
Bean type to deserialize
type
,
DeserializationConfig
Configuration in effect
config
,
BeanDescription
Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers
beanDesc
)

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findBeanDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findBeanDeserializer.

Method called to locate deserializer for specified value type which does not belong to any other category (not an Enum, Collection, Map, Array, reference value or tree node)
public boolean
hasDeserializerFor(DeserializationConfig config, Class<?> valueType)

Overrides default com.fasterxml.jackson.databind.deser.Deserializers.hasDeserializerFor.

Method that may be called to check whether this deserializer provider would provide deserializer for values of given type, without attempting to construct (and possibly fail in some cases) actual deserializer.
Inherited from com.fasterxml.jackson.databind.deser.Deserializers.Base:
findArrayDeserializerfindCollectionDeserializerfindCollectionLikeDeserializerfindEnumDeserializerfindMapDeserializerfindMapLikeDeserializerfindReferenceDeserializerfindTreeNodeDeserializer

Field Detail

_dataTypeFactoryback to summary
pack-priv static final DatatypeFactory _dataTypeFactory

Data type factories are thread-safe after instantiation (and configuration, if any); and since instantion (esp. implementation introspection) can be expensive we better reuse the instance.

TYPE_DURATIONback to summary
protected static final int TYPE_DURATION
TYPE_G_CALENDARback to summary
protected static final int TYPE_G_CALENDAR
TYPE_QNAMEback to summary
protected static final int TYPE_QNAME

Constructor Detail

CoreXMLDeserializersback to summary
public CoreXMLDeserializers()

Method Detail

findBeanDeserializerback to summary
public JsonDeserializer<?> findBeanDeserializer(JavaType type, DeserializationConfig config, BeanDescription beanDesc)

Overrides com.fasterxml.jackson.databind.deser.Deserializers.Base.findBeanDeserializer.

Implements com.fasterxml.jackson.databind.deser.Deserializers.findBeanDeserializer.

Doc from com.fasterxml.jackson.databind.deser.Deserializers.findBeanDeserializer.

Method called to locate deserializer for specified value type which does not belong to any other category (not an Enum, Collection, Map, Array, reference value or tree node)

Parameters
type:JavaType

Bean type to deserialize

config:DeserializationConfig

Configuration in effect

beanDesc:BeanDescription

Definition of the enumeration type that contains class annotations and other information typically needed for building deserializers

Returns:JsonDeserializer<?>

Deserializer to use for the type; or null if this provider does not know how to construct it

Annotations
@Override
hasDeserializerForback to summary
public boolean hasDeserializerFor(DeserializationConfig config, Class<?> valueType)

Overrides default com.fasterxml.jackson.databind.deser.Deserializers.hasDeserializerFor.

Doc from com.fasterxml.jackson.databind.deser.Deserializers.hasDeserializerFor.

Method that may be called to check whether this deserializer provider would provide deserializer for values of given type, without attempting to construct (and possibly fail in some cases) actual deserializer. Mostly needed to support validation of polymorphic type ids.

Note

implementations should take care NOT to claim supporting types that they do not recognize as this could to incorrect assumption of safe support by caller.

Method added in Jackson 2.13 now that Java 8 default implementations are available for use with interface definitions.

Annotations
@Override
com.fasterxml.jackson.databind.ext back to summary

public Class CoreXMLDeserializers.Std

extends FromStringDeserializer<Object>
Class Inheritance

Combo-deserializer that supports deserialization of somewhat optional javax.xml types QName, Duration and XMLGregorianCalendar. Combined into a single class to eliminate bunch of one-off implementation classes, to reduce resulting jar size (mostly).
Since
2.4

Field Summary

Modifier and TypeField and Description
protected final int
private static final long

Constructor Summary

AccessConstructor and Description
public
Std(Class<?> raw, int kind)

Method Summary

Modifier and TypeMethod and Description
protected Object
_deserialize(String value, DeserializationContext ctxt)

Implements abstract com.fasterxml.jackson.databind.deser.std.FromStringDeserializer._deserialize.

Main method from trying to deserialize actual value from non-empty String.
protected XMLGregorianCalendar
public Object
deserialize(JsonParser
Parsed used for reading JSON content
p
,
DeserializationContext
Context that can be used to access information about this deserialization activity.
ctxt
)

Overrides com.fasterxml.jackson.databind.deser.std.FromStringDeserializer.deserialize.

Method that can be called to ask implementation to deserialize JSON content into the value type this serializer handles.
Inherited from com.fasterxml.jackson.databind.deser.std.FromStringDeserializer:
_deserializeEmbedded_deserializeFromEmptyString_deserializeFromEmptyString_deserializeFromEmptyStringDefault_deserializeFromOther_shouldTrimfindDeserializerlogicalTypetypes

Field Detail

_kindback to summary
protected final int _kind
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer.serialVersionUID.

Constructor Detail

Stdback to summary
public Std(Class<?> raw, int kind)

Method Detail

_deserializeback to summary
protected Object _deserialize(String value, DeserializationContext ctxt) throws IOException

Implements abstract com.fasterxml.jackson.databind.deser.std.FromStringDeserializer._deserialize.

Doc from com.fasterxml.jackson.databind.deser.std.FromStringDeserializer._deserialize.

Main method from trying to deserialize actual value from non-empty String.

Annotations
@Override
_gregorianFromDateback to summary
protected XMLGregorianCalendar _gregorianFromDate(DeserializationContext ctxt, Date d)
deserializeback to summary
public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException

Overrides com.fasterxml.jackson.databind.deser.std.FromStringDeserializer.deserialize.

Doc from com.fasterxml.jackson.databind.JsonDeserializer.deserialize.

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).

Note that this method is never called for JSON null literal, and thus deserializers need (and should) not check for it.

Parameters
p:JsonParser

Parsed used for reading JSON content

ctxt:DeserializationContext

Context that can be used to access information about this deserialization activity.

Returns:Object

Deserialized value

Annotations
@Override