Package org.codehaus.jackson.map.deser
Class SettableAnyProperty
- java.lang.Object
-
- org.codehaus.jackson.map.deser.SettableAnyProperty
-
public final class SettableAnyProperty extends java.lang.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
?
-
-
Field Summary
Fields Modifier and Type Field Description protected BeanProperty
_property
Method used for setting "any" properties, along with annotation information.protected java.lang.reflect.Method
_setter
Physical JDK object used for assigning properties.protected JavaType
_type
protected JsonDeserializer<java.lang.Object>
_valueDeserializer
-
Constructor Summary
Constructors Constructor Description SettableAnyProperty(BeanProperty property, java.lang.reflect.Method rawSetter, JavaType type, JsonDeserializer<java.lang.Object> valueDeser)
SettableAnyProperty(BeanProperty property, AnnotatedMethod setter, JavaType type)
Deprecated.Since 1.9 - use variant that takes deserializerSettableAnyProperty(BeanProperty property, AnnotatedMethod setter, JavaType type, JsonDeserializer<java.lang.Object> valueDeser)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
_throwAsIOE(java.lang.Exception e, java.lang.String propName, java.lang.Object value)
java.lang.Object
deserialize(JsonParser jp, DeserializationContext ctxt)
void
deserializeAndSet(JsonParser jp, DeserializationContext ctxt, java.lang.Object instance, java.lang.String propName)
Method called to deserialize appropriate value, given parser (and context), and set it using appropriate method (a setter method).BeanProperty
getProperty()
JavaType
getType()
boolean
hasValueDeserializer()
void
set(java.lang.Object instance, java.lang.String propName, java.lang.Object value)
void
setValueDeserializer(JsonDeserializer<java.lang.Object> deser)
Deprecated.Since 1.9 - construct with deserializerjava.lang.String
toString()
SettableAnyProperty
withValueDeserializer(JsonDeserializer<java.lang.Object> deser)
-
-
-
Field Detail
-
_property
protected final BeanProperty _property
Method used for setting "any" properties, along with annotation information. Retained to allow contextualization of any properties.- Since:
- 1.7
-
_setter
protected final java.lang.reflect.Method _setter
Physical JDK object used for assigning properties.
-
_type
protected final JavaType _type
-
_valueDeserializer
protected JsonDeserializer<java.lang.Object> _valueDeserializer
-
-
Constructor Detail
-
SettableAnyProperty
@Deprecated public SettableAnyProperty(BeanProperty property, AnnotatedMethod setter, JavaType type)
Deprecated.Since 1.9 - use variant that takes deserializer
-
SettableAnyProperty
public SettableAnyProperty(BeanProperty property, AnnotatedMethod setter, JavaType type, JsonDeserializer<java.lang.Object> valueDeser)
-
SettableAnyProperty
public SettableAnyProperty(BeanProperty property, java.lang.reflect.Method rawSetter, JavaType type, JsonDeserializer<java.lang.Object> valueDeser)
-
-
Method Detail
-
withValueDeserializer
public SettableAnyProperty withValueDeserializer(JsonDeserializer<java.lang.Object> deser)
-
setValueDeserializer
@Deprecated public void setValueDeserializer(JsonDeserializer<java.lang.Object> deser)
Deprecated.Since 1.9 - construct with deserializer
-
getProperty
public BeanProperty getProperty()
-
hasValueDeserializer
public boolean hasValueDeserializer()
-
getType
public JavaType getType()
-
deserializeAndSet
public final void deserializeAndSet(JsonParser jp, DeserializationContext ctxt, java.lang.Object instance, java.lang.String propName) 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.String propName, java.lang.Object value) throws java.io.IOException
- Throws:
java.io.IOException
-
_throwAsIOE
protected void _throwAsIOE(java.lang.Exception e, java.lang.String propName, java.lang.Object value) throws java.io.IOException
- Parameters:
e
- Exception to re-throw or wrappropName
- Name of property (from Json input) to setvalue
- Value of the property- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-