Class ListSetExecutor
- java.lang.Object
-
- org.apache.commons.jexl3.internal.introspection.AbstractExecutor
-
- org.apache.commons.jexl3.internal.introspection.AbstractExecutor.Set
-
- org.apache.commons.jexl3.internal.introspection.ListSetExecutor
-
- All Implemented Interfaces:
JexlPropertySet
public final class ListSetExecutor extends AbstractExecutor.Set
Specialized executor to set a property in a List or array.- 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
Fields Modifier and Type Field Description private static java.lang.reflect.MethodARRAY_SETThe java.lang.reflect.Array.get method used as an active marker in ListGet.private static java.lang.reflect.MethodLIST_SETThe java.util.obj.set method used as an active marker in ListSet.private java.lang.IntegerpropertyThe property.-
Fields inherited from class org.apache.commons.jexl3.internal.introspection.AbstractExecutor
method, objectClass, TRY_FAILED
-
-
Constructor Summary
Constructors Modifier Constructor Description privateListSetExecutor(java.lang.Class<?> clazz, java.lang.reflect.Method method, java.lang.Integer key)Creates an instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ListSetExecutordiscover(Introspector is, java.lang.Class<?> clazz, java.lang.Object identifier, java.lang.Object value)Attempts to discover a ListSetExecutor.java.lang.ObjectgetTargetProperty()Gets the property targeted by this executor.java.lang.Objectinvoke(java.lang.Object obj, java.lang.Object value)Method used to set the property value of an object.java.lang.ObjecttryInvoke(java.lang.Object obj, java.lang.Object key, java.lang.Object value)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 Detail
-
ARRAY_SET
private static final java.lang.reflect.Method ARRAY_SET
The java.lang.reflect.Array.get method used as an active marker in ListGet.
-
LIST_SET
private static final java.lang.reflect.Method LIST_SET
The java.util.obj.set method used as an active marker in ListSet.
-
property
private final java.lang.Integer property
The property.
-
-
Constructor Detail
-
ListSetExecutor
private ListSetExecutor(java.lang.Class<?> clazz, java.lang.reflect.Method method, java.lang.Integer key)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 method
-
-
Method Detail
-
discover
public static ListSetExecutor discover(Introspector is, java.lang.Class<?> clazz, java.lang.Object identifier, java.lang.Object value)
Attempts to discover a ListSetExecutor.- Parameters:
is- the introspectorclazz- the class to find the get method fromidentifier- the key to use as an argument to the get methodvalue- the value to use as argument in list.put(key, value)- Returns:
- the executor if found, null otherwise
-
getTargetProperty
public java.lang.Object getTargetProperty()
Description copied from class:AbstractExecutorGets the property targeted by this executor.- Overrides:
getTargetPropertyin classAbstractExecutor- Returns:
- the target property
-
invoke
public java.lang.Object invoke(java.lang.Object obj, java.lang.Object value)Description copied from interface:JexlPropertySetMethod 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
public java.lang.Object tryInvoke(java.lang.Object obj, java.lang.Object key, java.lang.Object value)Description copied from interface:JexlPropertySetAttempts 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.
-
-