org.codehaus.jackson.map.deser
Class StdDeserializer<T>

java.lang.Object
  extended by org.codehaus.jackson.map.JsonDeserializer<T>
      extended by org.codehaus.jackson.map.deser.StdDeserializer<T>
Direct Known Subclasses:
ArrayDeserializer, BeanDeserializer, CollectionDeserializer, DateDeserializer, EnumDeserializer, EnumMapDeserializer, EnumSetDeserializer, FromStringDeserializer, JsonNodeDeserializer, MapDeserializer, StdDeserializer.BigDecimalDeserializer, StdDeserializer.BigIntegerDeserializer, StdDeserializer.CalendarDeserializer, StdDeserializer.ClassDeserializer, StdDeserializer.NumberDeserializer, StdDeserializer.PrimitiveOrWrapperDeserializer, StdDeserializer.SqlDateDeserializer, StdDeserializer.StackTraceElementDeserializer, StdDeserializer.StringDeserializer, UntypedObjectDeserializer

public abstract class StdDeserializer<T>
extends JsonDeserializer<T>

Base class for common deserializers. Contains shared base functionality for dealing with primitive values, such as (re)parsing from String.


Nested Class Summary
static class StdDeserializer.BigDecimalDeserializer
           
static class StdDeserializer.BigIntegerDeserializer
          This is bit trickier to implement efficiently, while avoiding overflow problems.
static class StdDeserializer.BooleanDeserializer
           
static class StdDeserializer.ByteDeserializer
           
static class StdDeserializer.CalendarDeserializer
           
static class StdDeserializer.CharacterDeserializer
           
static class StdDeserializer.ClassDeserializer
           
static class StdDeserializer.DoubleDeserializer
           
static class StdDeserializer.FloatDeserializer
           
static class StdDeserializer.IntegerDeserializer
           
static class StdDeserializer.LongDeserializer
           
static class StdDeserializer.NumberDeserializer
          For type Number.class, we can just rely on type mappings that plain JsonParser.getNumberValue() returns.
protected static class StdDeserializer.PrimitiveOrWrapperDeserializer<T>
           
static class StdDeserializer.ShortDeserializer
           
static class StdDeserializer.SqlDateDeserializer
          Compared to plain old Date, SQL version is easier to deal with: mostly because it is more limited.
static class StdDeserializer.StackTraceElementDeserializer
           
static class StdDeserializer.StringDeserializer
           
 
Nested classes/interfaces inherited from class org.codehaus.jackson.map.JsonDeserializer
JsonDeserializer.None
 
Constructor Summary
protected StdDeserializer(Class<?> vc)
           
 
Method Summary
protected  boolean _parseBoolean(JsonParser jp, DeserializationContext ctxt)
           
protected  Date _parseDate(JsonParser jp, DeserializationContext ctxt)
           
protected  double _parseDouble(JsonParser jp, DeserializationContext ctxt)
           
protected  float _parseFloat(JsonParser jp, DeserializationContext ctxt)
           
protected  int _parseInt(JsonParser jp, DeserializationContext ctxt)
           
protected  long _parseLong(JsonParser jp, DeserializationContext ctxt)
           
protected  short _parseShort(JsonParser jp, DeserializationContext ctxt)
           
protected  JsonDeserializer<Object> findDeserializer(DeserializationConfig config, DeserializerProvider provider, JavaType type, String propertyName, Map<JavaType,JsonDeserializer<Object>> seen)
          Helper method used to locate deserializers for properties the bean itself contains.
 Class<?> getValueClass()
           
 JavaType getValueType()
           
protected  void handleUnknownProperty(DeserializationContext ctxt, Object instanceOrClass, String propName)
          Method called to deal with a property that did not map to a known Bean property.
protected  void reportUnknownProperty(DeserializationContext ctxt, Object instanceOrClass, String fieldName)
           
 
Methods inherited from class org.codehaus.jackson.map.JsonDeserializer
deserialize, deserialize, getNullValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StdDeserializer

protected StdDeserializer(Class<?> vc)
Method Detail

getValueClass

public Class<?> getValueClass()

getValueType

public JavaType getValueType()

_parseBoolean

protected final boolean _parseBoolean(JsonParser jp,
                                      DeserializationContext ctxt)
                               throws IOException,
                                      JsonProcessingException
Throws:
IOException
JsonProcessingException

_parseShort

protected final short _parseShort(JsonParser jp,
                                  DeserializationContext ctxt)
                           throws IOException,
                                  JsonProcessingException
Throws:
IOException
JsonProcessingException

_parseInt

protected final int _parseInt(JsonParser jp,
                              DeserializationContext ctxt)
                       throws IOException,
                              JsonProcessingException
Throws:
IOException
JsonProcessingException

_parseLong

protected final long _parseLong(JsonParser jp,
                                DeserializationContext ctxt)
                         throws IOException,
                                JsonProcessingException
Throws:
IOException
JsonProcessingException

_parseFloat

protected final float _parseFloat(JsonParser jp,
                                  DeserializationContext ctxt)
                           throws IOException,
                                  JsonProcessingException
Throws:
IOException
JsonProcessingException

_parseDouble

protected final double _parseDouble(JsonParser jp,
                                    DeserializationContext ctxt)
                             throws IOException,
                                    JsonProcessingException
Throws:
IOException
JsonProcessingException

_parseDate

protected Date _parseDate(JsonParser jp,
                          DeserializationContext ctxt)
                   throws IOException,
                          JsonProcessingException
Throws:
IOException
JsonProcessingException

findDeserializer

protected JsonDeserializer<Object> findDeserializer(DeserializationConfig config,
                                                    DeserializerProvider provider,
                                                    JavaType type,
                                                    String propertyName,
                                                    Map<JavaType,JsonDeserializer<Object>> seen)
                                             throws JsonMappingException
Helper method used to locate deserializers for properties the bean itself contains.

Parameters:
type - Type of property to deserialize
Throws:
JsonMappingException

handleUnknownProperty

protected void handleUnknownProperty(DeserializationContext ctxt,
                                     Object instanceOrClass,
                                     String propName)
                              throws IOException,
                                     JsonProcessingException
Method called to deal with a property that did not map to a known Bean property. Method can deal with the problem as it sees fit (ignore, throw exception); but if it does return, it has to skip the matching Json content parser has.

Parameters:
ctxt - Context for deserialization; allows access to the parser, error reporting functionality
instanceOrClass - Instance that is being populated by this deserializer, or if not known, Class that would be instantiated. If null, will assume type is what getValueClass() returns.
propName - Name of the property that can not be mapped
Throws:
IOException
JsonProcessingException

reportUnknownProperty

protected void reportUnknownProperty(DeserializationContext ctxt,
                                     Object instanceOrClass,
                                     String fieldName)
                              throws IOException,
                                     JsonProcessingException
Throws:
IOException
JsonProcessingException