org.codehaus.jackson.map.deser
Class SettableBeanProperty

java.lang.Object
  extended by org.codehaus.jackson.map.deser.SettableBeanProperty

public final class SettableBeanProperty
extends java.lang.Object

Class that represents a single settable property of a bean: contains both type and name definitions, and reflection-based set functionality


Field Summary
protected  java.lang.Object _nullValue
          Value to be used when 'null' literal is encountered in Json.
protected  JsonDeserializer<java.lang.Object> _valueDeserializer
           
 
Constructor Summary
SettableBeanProperty(java.lang.String propName, JavaType type, java.lang.reflect.Method setter, java.lang.reflect.Method getter)
           
 
Method Summary
protected  java.io.IOException _throwAsIOE(java.lang.Exception e)
           
protected  void _throwAsIOE(java.lang.Exception e, java.lang.Object value)
          Method that takes in exception of any type, and casts or wraps it to an IOException or its subclass.
 java.lang.Object deserialize(JsonParser jp, DeserializationContext ctxt)
           
 void deserializeAndSet(JsonParser jp, DeserializationContext ctxt, java.lang.Object instance)
          Method called to deserialize appropriate value, given parser (and context), and set it using appropriate method (a setter method).
 java.lang.String getPropertyName()
           
 JavaType getType()
           
 boolean hasValueDeserializer()
           
 void set(java.lang.Object instance, java.lang.Object value)
           
 void setValueDeserializer(JsonDeserializer<java.lang.Object> deser)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_valueDeserializer

protected JsonDeserializer<java.lang.Object> _valueDeserializer

_nullValue

protected java.lang.Object _nullValue
Value to be used when 'null' literal is encountered in Json. For most types simply Java null, but for primitive types must be a non-null value (like Integer.valueOf(0) for int).

Constructor Detail

SettableBeanProperty

public SettableBeanProperty(java.lang.String propName,
                            JavaType type,
                            java.lang.reflect.Method setter,
                            java.lang.reflect.Method getter)
Method Detail

setValueDeserializer

public void setValueDeserializer(JsonDeserializer<java.lang.Object> deser)

getPropertyName

public java.lang.String getPropertyName()

getType

public JavaType getType()

hasValueDeserializer

public boolean hasValueDeserializer()

deserializeAndSet

public final void deserializeAndSet(JsonParser jp,
                                    DeserializationContext ctxt,
                                    java.lang.Object instance)
                             throws java.io.IOException,
                                    JsonProcessingException
Method called to deserialize appropriate value, given parser (and context), and set it using appropriate method (a setter method).

Throws:
java.io.IOException
JsonProcessingException

deserialize

public final java.lang.Object deserialize(JsonParser jp,
                                          DeserializationContext ctxt)
                                   throws java.io.IOException,
                                          JsonProcessingException
Throws:
java.io.IOException
JsonProcessingException

set

public final void set(java.lang.Object instance,
                      java.lang.Object value)
               throws java.io.IOException
Throws:
java.io.IOException

_throwAsIOE

protected void _throwAsIOE(java.lang.Exception e,
                           java.lang.Object value)
                    throws java.io.IOException
Method that takes in exception of any type, and casts or wraps it to an IOException or its subclass.

Throws:
java.io.IOException

_throwAsIOE

protected java.io.IOException _throwAsIOE(java.lang.Exception e)
                                   throws java.io.IOException
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object