com.fasterxml.jackson.databind.deser

## Class SettableAnyProperty

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

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  SettableAnyProperty.JsonNodeFieldAnyProperty, SettableAnyProperty.JsonNodeParameterAnyProperty, SettableAnyProperty.MapFieldAnyProperty, SettableAnyProperty.MapParameterAnyProperty, SettableAnyProperty.MethodAnyProperty

    public abstract 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: starting with 2.14, is `abstract` class with multiple concrete implementations

See Also:
  Serialized Form

### Nested Class Summary

Nested Classes
`protected static class` `SettableAnyProperty.JsonNodeFieldAnyProperty`
`protected static class` `SettableAnyProperty.JsonNodeParameterAnyProperty` [databind#562] Allow @JsonAnySetter on Creator constructor
`protected static class` `SettableAnyProperty.MapFieldAnyProperty`
`protected static class` `SettableAnyProperty.MapParameterAnyProperty` [databind#562] Allow @JsonAnySetter on Creator constructor
`protected static class` `SettableAnyProperty.MethodAnyProperty`

### Field Summary

Fields
`protected KeyDeserializer` `_keyDeserializer`
`protected BeanProperty` `_property` Method used for setting "any" properties, along with annotation information.
`protected AnnotatedMember` `_setter` Annotated variant is needed for JDK serialization only
`protected boolean` `_setterIsField`
`protected JavaType` `_type`
`protected JsonDeserializer<Object>` `_valueDeserializer`
`protected TypeDeserializer` `_valueTypeDeserializer`

### Constructor Summary

Constructors
Constructor and Description
`SettableAnyProperty(BeanProperty property, AnnotatedMember setter, JavaType type, KeyDeserializer keyDeser, JsonDeserializer<Object> valueDeser, TypeDeserializer typeDeser)`

### Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract void` `_set(Object instance, Object propName, Object value)`
`protected void` `_throwAsIOE(Exception e, Object propName, Object value)`
`static SettableAnyProperty` `constructForJsonNodeField(DeserializationContext ctxt, BeanProperty property, AnnotatedMember field, JavaType valueType, JsonDeserializer<Object> valueDeser)`
`static SettableAnyProperty` `constructForJsonNodeParameter(DeserializationContext ctxt, BeanProperty prop, AnnotatedMember mutator, JavaType valueType, JsonDeserializer<Object> valueDeser, int parameterIndex)`
`static SettableAnyProperty` `constructForMapField(DeserializationContext ctxt, BeanProperty property, AnnotatedMember field, JavaType valueType, KeyDeserializer keyDeser, JsonDeserializer<Object> valueDeser, TypeDeserializer typeDeser)`
`static SettableAnyProperty` `constructForMapParameter(DeserializationContext ctxt, BeanProperty property, AnnotatedMember field, JavaType valueType, KeyDeserializer keyDeser, JsonDeserializer<Object> valueDeser, TypeDeserializer typeDeser, int parameterIndex)`
`static SettableAnyProperty` `constructForMethod(DeserializationContext ctxt, BeanProperty property, AnnotatedMember field, JavaType valueType, KeyDeserializer keyDeser, JsonDeserializer<Object> valueDeser, TypeDeserializer typeDeser)`
`Object` `createParameterObject()` Create an instance of value to pass through Creator parameter.
`Object` `deserialize(com.fasterxml.jackson.core.JsonParser p, DeserializationContext ctxt)`
`void` `deserializeAndSet(com.fasterxml.jackson.core.JsonParser p, 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).
`void` `fixAccess(DeserializationConfig config)`
`int` `getParameterIndex()` Accessor for parameterIndex.
`BeanProperty` `getProperty()`
`String` `getPropertyName()`
`JavaType` `getType()`
`boolean` `hasValueDeserializer()`
`boolean` `isFieldType()` Method called to check whether this property is field
`void` `set(Object instance, Object propName, Object value)`
`String` `toString()`
`abstract 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 AnnotatedMember _setter

Annotated variant is needed for JDK serialization only

#### _setterIsField

    protected final boolean _setterIsField

#### _type

    protected final JavaType _type

#### _valueDeserializer

    protected JsonDeserializer<Object> _valueDeserializer

#### _valueTypeDeserializer

    protected final TypeDeserializer _valueTypeDeserializer

#### _keyDeserializer

    protected final KeyDeserializer _keyDeserializer

Since:
  2.9

### Constructor Detail

#### SettableAnyProperty

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

### Method Detail

#### constructForMethod

    public static SettableAnyProperty constructForMethod(DeserializationContext ctxt,
                                                         BeanProperty property,
                                                         AnnotatedMember field,
                                                         JavaType valueType,
                                                         KeyDeserializer keyDeser,
                                                         JsonDeserializer<Object> valueDeser,
                                                         TypeDeserializer typeDeser)

Since:
  2.14

#### constructForMapField

    public static SettableAnyProperty constructForMapField(DeserializationContext ctxt,
                                                           BeanProperty property,
                                                           AnnotatedMember field,
                                                           JavaType valueType,
                                                           KeyDeserializer keyDeser,
                                                           JsonDeserializer<Object> valueDeser,
                                                           TypeDeserializer typeDeser)

Since:
  2.14

#### constructForJsonNodeField

    public static SettableAnyProperty constructForJsonNodeField(DeserializationContext ctxt,
                                                                BeanProperty property,
                                                                AnnotatedMember field,
                                                                JavaType valueType,
                                                                JsonDeserializer<Object> valueDeser)

Since:
  2.14

#### constructForMapParameter

    public static SettableAnyProperty constructForMapParameter(DeserializationContext ctxt,
                                                               BeanProperty property,
                                                               AnnotatedMember field,
                                                               JavaType valueType,
                                                               KeyDeserializer keyDeser,
                                                               JsonDeserializer<Object> valueDeser,
                                                               TypeDeserializer typeDeser,
                                                               int parameterIndex)

Since:
  2.18

#### constructForJsonNodeParameter

    public static SettableAnyProperty constructForJsonNodeParameter(DeserializationContext ctxt,
                                                                    BeanProperty prop,
                                                                    AnnotatedMember mutator,
                                                                    JavaType valueType,
                                                                    JsonDeserializer<Object> valueDeser,
                                                                    int parameterIndex)

#### withValueDeserializer

    public abstract SettableAnyProperty withValueDeserializer(JsonDeserializer<Object> deser)

#### fixAccess

    public void fixAccess(DeserializationConfig config)

#### getProperty

    public BeanProperty getProperty()

#### hasValueDeserializer

    public boolean hasValueDeserializer()

#### getType

    public JavaType getType()

#### getPropertyName

    public String getPropertyName()

Since:
  2.14

#### getParameterIndex

    public int getParameterIndex()

Accessor for parameterIndex.

Returns:
  -1 if not a parameterized setter, otherwise index of parameter
Since:
  2.18

#### isFieldType

    public boolean isFieldType()

Method called to check whether this property is field

Since:
  2.18.1

#### createParameterObject

    public Object createParameterObject()

Create an instance of value to pass through Creator parameter.

Since:
  2.18

#### deserializeAndSet

    public void deserializeAndSet(com.fasterxml.jackson.core.JsonParser p,
                                  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(com.fasterxml.jackson.core.JsonParser p,
                              DeserializationContext ctxt)
                       throws IOException

Throws:
  `IOException`

#### set

    public void set(Object instance,
                    Object propName,
                    Object value)
             throws IOException

Throws:
  `IOException`

#### _set

    protected abstract void _set(Object instance,
                                 Object propName,
                                 Object value)
                          throws Exception

Throws:
  `Exception`

#### _throwAsIOE

    protected void _throwAsIOE(Exception e,
                               Object 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`