Class ExternalTypeHandler
java.lang.Object
org.codehaus.jackson.map.deser.impl.ExternalTypeHandler
Helper class that is used to flatten JSON structure when using
"external type id" (see
JsonTypeInfo.As.EXTERNAL_PROPERTY
).
This is needed to store temporary state and buffer tokens, as the structure is
rearranged a bit so that actual type deserializer can resolve type and
finalize deserialization.- Since:
- 1.9
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
ExternalTypeHandler
(org.codehaus.jackson.map.deser.impl.ExternalTypeHandler.ExtTypedProperty[] properties, HashMap<String, Integer> nameToPropertyIndex, String[] typeIds, TokenBuffer[] tokens) -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
_deserialize
(JsonParser jp, DeserializationContext ctxt, Object bean, int index) complete
(JsonParser jp, DeserializationContext ctxt, Object bean) boolean
handleToken
(JsonParser jp, DeserializationContext ctxt, String propName, Object bean) Method called to ask handler to handleboolean
handleTypePropertyValue
(JsonParser jp, DeserializationContext ctxt, String propName, Object bean) Method called to see if given property/value pair is an external type id; and if so handle it.start()
-
Constructor Details
-
ExternalTypeHandler
protected ExternalTypeHandler(org.codehaus.jackson.map.deser.impl.ExternalTypeHandler.ExtTypedProperty[] properties, HashMap<String, Integer> nameToPropertyIndex, String[] typeIds, TokenBuffer[] tokens) -
ExternalTypeHandler
-
-
Method Details
-
start
-
handleTypePropertyValue
public boolean handleTypePropertyValue(JsonParser jp, DeserializationContext ctxt, String propName, Object bean) throws IOException, JsonProcessingException Method called to see if given property/value pair is an external type id; and if so handle it. This is only to be called in case containing POJO has similarly named property as the external type id; otherwisehandleToken(org.codehaus.jackson.JsonParser, org.codehaus.jackson.map.DeserializationContext, java.lang.String, java.lang.Object)
should be called instead.- Throws:
IOException
JsonProcessingException
-
handleToken
public boolean handleToken(JsonParser jp, DeserializationContext ctxt, String propName, Object bean) throws IOException, JsonProcessingException Method called to ask handler to handle- Throws:
IOException
JsonProcessingException
-
complete
public Object complete(JsonParser jp, DeserializationContext ctxt, Object bean) throws IOException, JsonProcessingException - Throws:
IOException
JsonProcessingException
-
_deserialize
protected final void _deserialize(JsonParser jp, DeserializationContext ctxt, Object bean, int index) throws IOException, JsonProcessingException - Throws:
IOException
JsonProcessingException
-