|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.map.DeserializationContext
public abstract class DeserializationContext
Context for deserialization process. Used to allow passing in configuration settings and reusable temporary objects (scrap arrays, containers).
Field Summary | |
---|---|
protected DeserializationConfig |
_config
|
protected int |
_featureFlags
|
Constructor Summary | |
---|---|
protected |
DeserializationContext(DeserializationConfig config)
|
Method Summary | |
---|---|
abstract Calendar |
constructCalendar(Date d)
Convenience method for constructing Calendar instance set to specified time, to be modified and used by caller. |
JavaType |
constructType(Class<?> cls)
|
abstract Object |
findInjectableValue(Object valueId,
BeanProperty forProperty,
Object beanInstance)
|
abstract ArrayBuilders |
getArrayBuilders()
Method for accessing object useful for building arrays of primitive types (such as int[]). |
Base64Variant |
getBase64Variant()
Convenience method for accessing the default Base64 encoding used for decoding base64 encoded binary content. |
DeserializationConfig |
getConfig()
Method for accessing configuration setting object for currently active deserialization. |
DeserializerProvider |
getDeserializerProvider()
Returns provider that can be used for dynamically locating other deserializers during runtime. |
JsonNodeFactory |
getNodeFactory()
|
abstract JsonParser |
getParser()
Accessor for getting access to the underlying JSON parser used for deserialization. |
TypeFactory |
getTypeFactory()
|
abstract boolean |
handleUnknownProperty(JsonParser jp,
JsonDeserializer<?> deser,
Object instanceOrClass,
String propName)
Method deserializers can call to inform configured DeserializationProblemHandler s
of an unrecognized property. |
abstract JsonMappingException |
instantiationException(Class<?> instClass,
String msg)
|
abstract JsonMappingException |
instantiationException(Class<?> instClass,
Throwable t)
Helper method for constructing instantiation exception for specified type, to indicate problem with physically constructing instance of specified class (missing constructor, exception from constructor) |
boolean |
isEnabled(DeserializationConfig.Feature feat)
Convenience method for checking whether specified on/off feature is enabled |
abstract ObjectBuffer |
leaseObjectBuffer()
Method that can be used to get access to a reusable ObjectBuffer, useful for efficiently constructing Object arrays and Lists. |
abstract JsonMappingException |
mappingException(Class<?> targetClass)
Helper method for constructing generic mapping exception for specified type |
abstract JsonMappingException |
mappingException(Class<?> targetClass,
JsonToken t)
|
JsonMappingException |
mappingException(String message)
Helper method for constructing generic mapping exception with specified message and current location information |
abstract Date |
parseDate(String dateStr)
Convenience method for parsing a Date from given String, using currently configured date format (accessed using MapperConfig.getDateFormat() ). |
abstract void |
returnObjectBuffer(ObjectBuffer buf)
Method to call to return object buffer previously leased with leaseObjectBuffer() . |
abstract JsonMappingException |
unknownFieldException(Object instanceOrClass,
String fieldName)
Helper method for constructing exception to indicate that JSON Object field name did not map to a known property of type being deserialized. |
abstract JsonMappingException |
unknownTypeException(JavaType baseType,
String id)
Helper method for constructing exception to indicate that given type id (parsed from JSON) could not be converted to a Java type. |
abstract JsonMappingException |
weirdKeyException(Class<?> keyClass,
String keyValue,
String msg)
Helper method for constructing exception to indicate that given JSON Object field name was not in format to be able to deserialize specified key type. |
abstract JsonMappingException |
weirdNumberException(Class<?> instClass,
String msg)
Helper method for constructing exception to indicate that input JSON Number was not suitable for deserializing into given type. |
abstract JsonMappingException |
weirdStringException(Class<?> instClass,
String msg)
Helper method for constructing exception to indicate that input JSON String was not in recognized format for deserializing into given type. |
abstract JsonMappingException |
wrongTokenException(JsonParser jp,
JsonToken expToken,
String msg)
Helper method for indicating that the current token was expected to be another token. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final DeserializationConfig _config
protected final int _featureFlags
Constructor Detail |
---|
protected DeserializationContext(DeserializationConfig config)
Method Detail |
---|
public DeserializationConfig getConfig()
public DeserializerProvider getDeserializerProvider()
public boolean isEnabled(DeserializationConfig.Feature feat)
public Base64Variant getBase64Variant()
getConfig().getBase64Variant();
public abstract JsonParser getParser()
public final JsonNodeFactory getNodeFactory()
public JavaType constructType(Class<?> cls)
public TypeFactory getTypeFactory()
public abstract Object findInjectableValue(Object valueId, BeanProperty forProperty, Object beanInstance)
public abstract ObjectBuffer leaseObjectBuffer()
public abstract void returnObjectBuffer(ObjectBuffer buf)
leaseObjectBuffer()
.
buf
- Returned object bufferpublic abstract ArrayBuilders getArrayBuilders()
public abstract Date parseDate(String dateStr) throws IllegalArgumentException
MapperConfig.getDateFormat()
).
Implementation will handle thread-safety issues related to date formats such that first time this method is called, date format is cloned, and cloned instance will be retained for use during this deserialization round.
IllegalArgumentException
public abstract Calendar constructCalendar(Date d)
public abstract boolean handleUnknownProperty(JsonParser jp, JsonDeserializer<?> deser, Object instanceOrClass, String propName) throws IOException, JsonProcessingException
DeserializationProblemHandler
s
of an unrecognized property.
IOException
JsonProcessingException
public abstract JsonMappingException mappingException(Class<?> targetClass)
public abstract JsonMappingException mappingException(Class<?> targetClass, JsonToken t)
public JsonMappingException mappingException(String message)
public abstract JsonMappingException instantiationException(Class<?> instClass, Throwable t)
public abstract JsonMappingException instantiationException(Class<?> instClass, String msg)
public abstract JsonMappingException weirdStringException(Class<?> instClass, String msg)
public abstract JsonMappingException weirdNumberException(Class<?> instClass, String msg)
public abstract JsonMappingException weirdKeyException(Class<?> keyClass, String keyValue, String msg)
public abstract JsonMappingException wrongTokenException(JsonParser jp, JsonToken expToken, String msg)
public abstract JsonMappingException unknownFieldException(Object instanceOrClass, String fieldName)
instanceOrClass
- Either value being populated (if one has been
instantiated), or Class that indicates type that would be (or
have been) instantiatedpublic abstract JsonMappingException unknownTypeException(JavaType baseType, String id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |