| Modifier and Type | Class and Description |
|---|---|
| public static class | CoreXMLDeserializers.
Combo-deserializer that supports deserialization of somewhat optional
javax.xml types |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final DatatypeFactory | _dataTypeFactory
Data type factories are thread-safe after instantiation (and configuration, if any); and since instantiation (esp. |
| protected static final QName | |
| protected static final int | |
| protected static final int | |
| protected static final int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method 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. Implements com. 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. 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. |
| _dataTypeFactory | back to summary |
|---|---|
| pack-priv static final DatatypeFactory _dataTypeFactory Data type factories are thread-safe after instantiation (and configuration, if any); and since instantiation (esp. implementation introspection) can be expensive we better reuse the instance. | |
| EMPTY_QNAME | back to summary |
|---|---|
| protected static final QName EMPTY_QNAME | |
| TYPE_DURATION | back to summary |
|---|---|
| protected static final int TYPE_DURATION | |
| TYPE_G_CALENDAR | back to summary |
|---|---|
| protected static final int TYPE_G_CALENDAR | |
| TYPE_QNAME | back to summary |
|---|---|
| protected static final int TYPE_QNAME | |
| CoreXMLDeserializers | back to summary |
|---|---|
| public CoreXMLDeserializers() | |
| findBeanDeserializer | back to summary |
|---|---|
| public JsonDeserializer Overrides com. Implements com. Doc from com. 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)
| |
| hasDeserializerFor | back to summary |
|---|---|
| public boolean hasDeserializerFor(DeserializationConfig config, Class<?> valueType) Overrides default com. Doc from com. 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.
| |
QName, Duration and XMLGregorianCalendar.
Combined into a single class to eliminate bunch of one-off implementation
classes, to reduce resulting jar size (mostly).
| Modifier and Type | Field and Description |
|---|---|
| protected final int | |
| private static final long |
| Modifier and Type | Method and Description |
|---|---|
| protected Object | _deserialize(String value, DeserializationContext ctxt)
Implements abstract com. Main method from trying to deserialize actual value from non-empty String. |
| protected Object | |
| protected XMLGregorianCalendar | |
| public Object | deserialize(JsonParser
Parser used for reading JSON content p, DeserializationContext Context that can be used to access information about
this deserialization activity. ctxt)Overrides com. Method that can be called to ask implementation to deserialize JSON content into the value type this serializer handles. |
| _kind | back to summary |
|---|---|
| protected final int _kind | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| Std | back to summary |
|---|---|
| public Std(Class<?> raw, int kind) | |
| _deserialize | back to summary |
|---|---|
| protected Object _deserialize(String value, DeserializationContext ctxt) throws IOException Implements abstract com. Doc from com. Main method from trying to deserialize actual value from non-empty String.
| |
| _deserializeFromEmptyString | back to summary |
|---|---|
| protected Object _deserializeFromEmptyString(DeserializationContext ctxt) throws IOException Overrides com.
| |
| _gregorianFromDate | back to summary |
|---|---|
| protected XMLGregorianCalendar _gregorianFromDate(DeserializationContext ctxt, Date d) | |
| deserialize | back to summary |
|---|---|
| public Object deserialize(JsonParser p, DeserializationContext ctxt) throws IOException Overrides 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)
| |