Top Description Fields Constructors Methods
org.apache.commons.jexl2.internal

public final Class ListSetExecutor

extends Set
Class Inheritance
Imports
java.util.List, java.lang.reflect.Array

Specialized executor to set a property in a List or array.
Since
2.0

Field Summary

Modifier and TypeField and Description
private static final Method
ARRAY_SET

The java.lang.reflect.Array.get method used as an active marker in ListGet.

private static final Method
LIST_SET

The java.util.obj.set method used as an active marker in ListSet.

private final Integer
property

The property.

Constructor Summary

AccessConstructor and Description
public
ListSetExecutor(Introspector
the introspector
is
,
Class<?>
the class that might implement the map interface
clazz
,
Integer
the key to use in obj.set(key,value)
key
,
Object
the value to use in obj.set(key,value)
value
)

Creates an instance checking for the List interface or Array capability.

Method Summary

Modifier and TypeMethod and Description
pack-priv static Method

Returns:

a marker method, obj.set or array.set
discover
(Class<?>
the class to introspect
clazz
)

Finds the method to perform 'set' on a obj of array.

public Object
execute(final Object
The object to set the property in.
obj
,
Object
The value.
value
)

Implements abstract org.apache.commons.jexl2.internal.AbstractExecutor.Set.execute.

Sets the property value of an object.
public Object
getTargetProperty()

Overrides org.apache.commons.jexl2.internal.AbstractExecutor.getTargetProperty.

Gets the property targeted by this executor.
public Object
tryExecute(final Object
The object to invoke the method from.
obj
,
Object
The property to set in the object.
key
,
Object
The value to use as the property value.
value
)

Overrides org.apache.commons.jexl2.internal.AbstractExecutor.Set.tryExecute.

Tries to reuse this executor, checking that it is compatible with the actual set of arguments.
Inherited from org.apache.commons.jexl2.internal.AbstractExecutor.Set:
invoketryInvoke

Field Detail

ARRAY_SETback to summary
private static final Method ARRAY_SET

The java.lang.reflect.Array.get method used as an active marker in ListGet.

LIST_SETback to summary
private static final Method LIST_SET

The java.util.obj.set method used as an active marker in ListSet.

propertyback to summary
private final Integer property

The property.

Constructor Detail

ListSetExecutorback to summary
public ListSetExecutor(Introspector is, Class<?> clazz, Integer key, Object value)

Creates an instance checking for the List interface or Array capability.

Parameters
is:Introspector

the introspector

clazz:Class<?>

the class that might implement the map interface

key:Integer

the key to use in obj.set(key,value)

value:Object

the value to use in obj.set(key,value)

Method Detail

discoverback to summary
pack-priv static Method discover(Class<?> clazz)

Finds the method to perform 'set' on a obj of array.

Parameters
clazz:Class<?>

the class to introspect

Returns:Method

a marker method, obj.set or array.set

executeback to summary
public Object execute(final Object obj, Object value)

Implements abstract org.apache.commons.jexl2.internal.AbstractExecutor.Set.execute.

Doc from org.apache.commons.jexl2.internal.AbstractExecutor.Set.execute.

Sets the property value of an object.

Parameters
obj:Object

The object to set the property in.

value:Object

The value.

Returns:Object

The return value.

Annotations
@Override
getTargetPropertyback to summary
public Object getTargetProperty()

Overrides org.apache.commons.jexl2.internal.AbstractExecutor.getTargetProperty.

Doc from org.apache.commons.jexl2.internal.AbstractExecutor.getTargetProperty.

Gets the property targeted by this executor.

Returns:Object

the target property

Annotations
@Override
tryExecuteback to summary
public Object tryExecute(final Object obj, Object key, Object value)

Overrides org.apache.commons.jexl2.internal.AbstractExecutor.Set.tryExecute.

Doc from org.apache.commons.jexl2.internal.AbstractExecutor.Set.tryExecute.

Tries to reuse this executor, checking that it is compatible with the actual set of arguments.

Compatibility means that: o must be of the same class as this executor's target class, property must be of the same class as this executor's target property (for list and map based executors) and have the same value (for other types) and that arg must be a valid argument for this executor underlying method.

Parameters
obj:Object

The object to invoke the method from.

key:Object

The property to set in the object.

value:Object

The value to use as the property value.

Returns:Object

The return value or TRY_FAILED if checking failed.

Annotations
@Override