org.codehaus.jackson.map
Class DeserializationContext

java.lang.Object
  extended by org.codehaus.jackson.map.DeserializationContext
Direct Known Subclasses:
StdDeserializationContext

public abstract class DeserializationContext
extends Object

Context for deserialization process. Used to allow passing in configuration settings and reusable temporary objects (scrap arrays, containers).


Field Summary
protected  DeserializationConfig _config
           
 
Constructor Summary
protected DeserializationContext(DeserializationConfig config)
           
 
Method Summary
abstract  Calendar constructCalendar(Date d)
           
abstract  ArrayBuilders getArrayBuilders()
          Method for accessing object useful for building arrays of primitive types (such as int[]).
 Base64Variant getBase64Variant()
           
 DeserializationConfig getConfig()
           
abstract  JsonParser getParser()
          Accessor for getting access to the underlying JSON parser used for deserialization.
abstract  JsonMappingException instantiationException(Class<?> instClass, Exception e)
          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  Date parseDate(String dateStr)
           
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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_config

protected final DeserializationConfig _config
Constructor Detail

DeserializationContext

protected DeserializationContext(DeserializationConfig config)
Method Detail

getConfig

public DeserializationConfig getConfig()

isEnabled

public boolean isEnabled(DeserializationConfig.Feature feat)
Convenience method for checking whether specified on/off feature is enabled


getBase64Variant

public Base64Variant getBase64Variant()

getParser

public abstract JsonParser getParser()
Accessor for getting access to the underlying JSON parser used for deserialization.


leaseObjectBuffer

public abstract ObjectBuffer leaseObjectBuffer()
Method that can be used to get access to a reusable ObjectBuffer, useful for efficiently constructing Object arrays and Lists. Note that leased buffers should be returned once deserializer is done, to allow for reuse during same round of deserialization.


returnObjectBuffer

public abstract void returnObjectBuffer(ObjectBuffer buf)
Method to call to return object buffer previously leased with leaseObjectBuffer().

Parameters:
buf - Returned object buffer

getArrayBuilders

public abstract ArrayBuilders getArrayBuilders()
Method for accessing object useful for building arrays of primitive types (such as int[]).


parseDate

public abstract Date parseDate(String dateStr)
                        throws IllegalArgumentException
Throws:
IllegalArgumentException

constructCalendar

public abstract Calendar constructCalendar(Date d)

mappingException

public abstract JsonMappingException mappingException(Class<?> targetClass)
Helper method for constructing generic mapping exception for specified type


instantiationException

public abstract JsonMappingException instantiationException(Class<?> instClass,
                                                            Exception e)
Helper method for constructing instantiation exception for specified type, to indicate problem with physically constructing instance of specified class (missing constructor, exception from constructor)


weirdStringException

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


weirdNumberException

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


weirdKeyException

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


unknownFieldException

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

Parameters:
instanceOrClass - Either value being populated (if one has been instantiated), or Class that indicates type that would be (or have been) instantiated