Class MapSetExecutor
java.lang.Object
org.apache.commons.jexl3.internal.introspection.AbstractExecutor
org.apache.commons.jexl3.internal.introspection.AbstractExecutor.Set
org.apache.commons.jexl3.internal.introspection.MapSetExecutor
- All Implemented Interfaces:
JexlPropertySet
Specialized executor to set a property in a Map.
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.jexl3.internal.introspection.AbstractExecutor
AbstractExecutor.Get, AbstractExecutor.Method, AbstractExecutor.Set
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Method
The java.util.map.put method used as an active marker in MapSet.private final Object
The property.private final Class
<?> The property value class.Fields inherited from class org.apache.commons.jexl3.internal.introspection.AbstractExecutor
method, objectClass, TRY_FAILED
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
MapSetExecutor
(Class<?> clazz, Method method, Object key, Object value) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic MapSetExecutor
discover
(Introspector is, Class<?> clazz, Object identifier, Object value) Attempts to discover a MapSetExecutor.Gets the property targeted by this executor.Method used to set the property value of an object.Attempts to reuse this JexlPropertySet, checking that it is compatible with the actual set of arguments.Methods inherited from class org.apache.commons.jexl3.internal.introspection.AbstractExecutor
castInteger, castString, classOf, equals, equals, getMethod, getMethodName, getTargetClass, hashCode, initMarker, isAlive, isCacheable, makeArgs, tryFailed
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.commons.jexl3.introspection.JexlPropertySet
isCacheable, tryFailed
-
Field Details
-
MAP_SET
The java.util.map.put method used as an active marker in MapSet. -
property
The property. -
valueClass
The property value class.
-
-
Constructor Details
-
MapSetExecutor
Creates an instance.- Parameters:
clazz
- the class the set method applies tomethod
- the method called through this executorkey
- the key to use as 1st argument to the set methodvalue
- the value to use as 2nd argument to the set method
-
-
Method Details
-
discover
public static MapSetExecutor discover(Introspector is, Class<?> clazz, Object identifier, Object value) Attempts to discover a MapSetExecutor.- Parameters:
is
- the introspectorclazz
- the class to find the set method fromidentifier
- the key to use as an argument to the get methodvalue
- the value to use as argument in map.put(key,value)- Returns:
- the executor if found, null otherwise
-
getTargetProperty
Description copied from class:AbstractExecutor
Gets the property targeted by this executor.- Overrides:
getTargetProperty
in classAbstractExecutor
- Returns:
- the target property
-
invoke
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 valuevalue
- value to be set- Returns:
- the value returned from the set operation (impl specific)
-
tryInvoke
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 uponkey
- the property key to getvalue
- 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.
-