org.codehaus.jackson.map.deser
Class SettableAnyProperty

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

public final class SettableAnyProperty
extends Object

Class that represents a "wildcard" set method which can be used to generically set values of otherwise unmapped (aka "unknown") properties read from Json content.

!!! Note: might make sense to refactor to share some code with SettableBeanProperty?


Constructor Summary
SettableAnyProperty(JavaType type, Method setter)
           
 
Method Summary
protected  void _throwAsIOE(Exception e, String propName, Object value)
           
 Object deserialize(JsonParser jp, DeserializationContext ctxt)
           
 void deserializeAndSet(JsonParser jp, DeserializationContext ctxt, Object instance, String propName)
          Method called to deserialize appropriate value, given parser (and context), and set it using appropriate method (a setter method).
 JavaType getType()
           
 boolean hasValueDeserializer()
           
 void set(Object instance, String propName, Object value)
           
 void setValueDeserializer(JsonDeserializer<Object> deser)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SettableAnyProperty

public SettableAnyProperty(JavaType type,
                           Method setter)
Method Detail

hasValueDeserializer

public boolean hasValueDeserializer()

setValueDeserializer

public void setValueDeserializer(JsonDeserializer<Object> deser)

getType

public JavaType getType()

deserializeAndSet

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

Throws:
IOException
JsonProcessingException

deserialize

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

set

public final void set(Object instance,
                      String propName,
                      Object value)
               throws IOException
Throws:
IOException

_throwAsIOE

protected void _throwAsIOE(Exception e,
                           String propName,
                           Object value)
                    throws IOException
Parameters:
e - Exception to re-throw or wrap
propName - Name of property (from Json input) to set
value - Value of the property
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object