com.fasterxml.jackson.databind.deser

## Class SettableAnyProperty

- java.lang.Object
- - com.fasterxml.jackson.databind.deser.SettableAnyProperty

- All Implemented Interfaces:
    Serializable

      public class SettableAnyProperty
      extends Object
      implements Serializable

  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`?

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected BeanProperty` | `_property` Method used for setting "any" properties, along with annotation information.
    `protected Method` | `_setter` Physical JDK object used for assigning properties.
    `protected JavaType` | `_type`
    `protected JsonDeserializer<Object>` | `_valueDeserializer`
    `protected TypeDeserializer` | `_valueTypeDeserializer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SettableAnyProperty(BeanProperty property, AnnotatedMethod setter, JavaType type, JsonDeserializer<Object> valueDeser)` Deprecated.
    `SettableAnyProperty(BeanProperty property, AnnotatedMethod setter, JavaType type, JsonDeserializer<Object> valueDeser, TypeDeserializer typeDeser)`
    `SettableAnyProperty(BeanProperty property, Method rawSetter, JavaType type, JsonDeserializer<Object> valueDeser)` Deprecated.
    `SettableAnyProperty(BeanProperty property, Method rawSetter, JavaType type, JsonDeserializer<Object> valueDeser, TypeDeserializer typeDeser)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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).
    `BeanProperty` | `getProperty()`
    `JavaType` | `getType()`
    `boolean` | `hasValueDeserializer()`
    `void` | `set(Object instance, String propName, Object value)`
    `String` | `toString()`
    `SettableAnyProperty` | `withValueDeserializer(JsonDeserializer<Object> deser)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### _property

          protected final BeanProperty _property

      Method used for setting "any" properties, along with annotation information. Retained to allow contextualization of any properties.

    - #### _setter

          protected final transient Method _setter

      Physical JDK object used for assigning properties.

      NOTE: must be marked transient since it is not serializable, in case these are to be serialized

    - #### _type

          protected final JavaType _type

    - #### _valueDeserializer

          protected JsonDeserializer<Object> _valueDeserializer

    - #### _valueTypeDeserializer

          protected final TypeDeserializer _valueTypeDeserializer

  - ### Constructor Detail

    - #### SettableAnyProperty

          @Deprecated
          public SettableAnyProperty(BeanProperty property,
                                        AnnotatedMethod setter,
                                        JavaType type,
                                        JsonDeserializer<Object> valueDeser)

      Deprecated.

    - #### SettableAnyProperty

          public SettableAnyProperty(BeanProperty property,
                             AnnotatedMethod setter,
                             JavaType type,
                             JsonDeserializer<Object> valueDeser,
                             TypeDeserializer typeDeser)

    - #### SettableAnyProperty

          @Deprecated
          public SettableAnyProperty(BeanProperty property,
                                        Method rawSetter,
                                        JavaType type,
                                        JsonDeserializer<Object> valueDeser)

      Deprecated.

    - #### SettableAnyProperty

          public SettableAnyProperty(BeanProperty property,
                             Method rawSetter,
                             JavaType type,
                             JsonDeserializer<Object> valueDeser,
                             TypeDeserializer typeDeser)

  - ### Method Detail

    - #### withValueDeserializer

          public SettableAnyProperty withValueDeserializer(JsonDeserializer<Object> deser)

    - #### getProperty

          public BeanProperty getProperty()

    - #### hasValueDeserializer

          public boolean hasValueDeserializer()

    - #### getType

          public JavaType getType()

    - #### deserializeAndSet

          public final void deserializeAndSet(JsonParser jp,
                               DeserializationContext ctxt,
                               Object instance,
                               String propName)
                                       throws IOException

      Method called to deserialize appropriate value, given parser (and context), and set it using appropriate method (a setter method).
      Throws:
        `IOException`

    - #### deserialize

          public Object deserialize(JsonParser jp,
                           DeserializationContext ctxt)
                             throws IOException

      Throws:
        `IOException`

    - #### set

          public 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`

Copyright © 2014 FasterXML. All Rights Reserved.