Class MapSetExecutor

    • Field Detail

      • MAP_SET

        private static final java.lang.reflect.Method MAP_SET
        The java.util.map.put method used as an active marker in MapSet.
      • property

        private final java.lang.Object property
        The property.
      • valueClass

        private final java.lang.Class<?> valueClass
        The property value class.
    • Constructor Detail

      • MapSetExecutor

        private MapSetExecutor​(java.lang.Class<?> clazz,
                               java.lang.reflect.Method method,
                               java.lang.Object key,
                               java.lang.Object value)
        Creates an instance.
        Parameters:
        clazz - the class the set method applies to
        method - the method called through this executor
        key - the key to use as 1st argument to the set method
        value - the value to use as 2nd argument to the set method
    • Method Detail

      • discover

        public static MapSetExecutor discover​(Introspector is,
                                              java.lang.Class<?> clazz,
                                              java.lang.Object identifier,
                                              java.lang.Object value)
        Attempts to discover a MapSetExecutor.
        Parameters:
        is - the introspector
        clazz - the class to find the set method from
        identifier - the key to use as an argument to the get method
        value - the value to use as argument in map.put(key,value)
        Returns:
        the executor if found, null otherwise
      • getTargetProperty

        public java.lang.Object getTargetProperty()
        Description copied from class: AbstractExecutor
        Gets the property targeted by this executor.
        Overrides:
        getTargetProperty in class AbstractExecutor
        Returns:
        the target property
      • invoke

        public java.lang.Object invoke​(java.lang.Object obj,
                                       java.lang.Object value)
        Description copied from interface: JexlPropertySet
        Method used to set the property value of an object.
        Parameters:
        obj - Object on which the property setter will be called with the value
        value - value to be set
        Returns:
        the value returned from the set operation (impl specific)
      • tryInvoke

        public java.lang.Object tryInvoke​(java.lang.Object obj,
                                          java.lang.Object key,
                                          java.lang.Object value)
        Description copied from interface: JexlPropertySet
        Attempts to reuse this JexlPropertySet, checking that it is compatible with the actual set of arguments.
        Parameters:
        obj - the object to invoke the get upon
        key - the property key to get
        value - the property value to set
        Returns:
        the result of the method invocation that should be checked by tryFailed to determine if it succeeded or failed.