Package org.codehaus.jackson.map.deser
Class SettableAnyProperty
java.lang.Object
org.codehaus.jackson.map.deser.SettableAnyProperty
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
FieldsModifier and TypeFieldDescriptionprotected final BeanProperty
Method used for setting "any" properties, along with annotation information.protected final Method
Physical JDK object used for assigning properties.protected final JavaType
protected JsonDeserializer
<Object> -
Constructor Summary
ConstructorsConstructorDescriptionSettableAnyProperty
(BeanProperty property, Method rawSetter, JavaType type, JsonDeserializer<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<Object> valueDeser) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
_throwAsIOE
(Exception e, String propName, Object value) final Object
deserialize
(JsonParser jp, DeserializationContext ctxt) final 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).getType()
boolean
final void
void
Deprecated.Since 1.9 - construct with deserializertoString()
-
Field Details
-
_property
Method used for setting "any" properties, along with annotation information. Retained to allow contextualization of any properties.- Since:
- 1.7
-
_setter
Physical JDK object used for assigning properties. -
_type
-
_valueDeserializer
-
-
Constructor Details
-
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<Object> valueDeser) -
SettableAnyProperty
public SettableAnyProperty(BeanProperty property, Method rawSetter, JavaType type, JsonDeserializer<Object> valueDeser)
-
-
Method Details
-
withValueDeserializer
-
setValueDeserializer
Deprecated.Since 1.9 - construct with deserializer -
getProperty
-
hasValueDeserializer
public boolean hasValueDeserializer() -
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
- Throws:
IOException
-
_throwAsIOE
- Parameters:
e
- Exception to re-throw or wrappropName
- Name of property (from Json input) to setvalue
- Value of the property- Throws:
IOException
-
toString
-