Class 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 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.
      • _valueDeserializer

        protected JsonDeserializer<java.lang.Object> _valueDeserializer
    • Method Detail

      • setValueDeserializer

        @Deprecated
        public void setValueDeserializer​(JsonDeserializer<java.lang.Object> deser)
        Deprecated.
        Since 1.9 - construct with deserializer
      • hasValueDeserializer

        public boolean hasValueDeserializer()
      • 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
      • 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 wrap
        propName - Name of property (from Json input) to set
        value - Value of the property
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object