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

public final Class MapSetExecutor

extends Set
Class Inheritance
Imports
java.util.Map, java.lang.reflect.InvocationTargetException

Specialized executor to set a property in a Map.
Since
2.0

Field Summary

Modifier and TypeField and Description
private static final Method
MAP_SET

The java.util.map.put method used as an active marker in MapSet.

private final Object
property

The property.

Constructor Summary

AccessConstructor and Description
public
MapSetExecutor(Introspector
the introspector
is
,
Class<?>
the class that might implement the map interface
clazz
,
Object
the key to use as argument in map.put(key,value)
key
,
Object
the value to use as argument in map.put(key,value)
value
)

Creates an instance checking for the Map interface.

Method Summary

Modifier and TypeMethod and Description
pack-priv static Method

Returns:

a marker method, map.get
discover
(Class<?>
the class to introspect
clazz
)

Finds the method to perform 'set' on a map.

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

MAP_SETback to summary
private static final Method MAP_SET

The java.util.map.put method used as an active marker in MapSet.

propertyback to summary
private final Object property

The property.

Constructor Detail

MapSetExecutorback to summary
public MapSetExecutor(Introspector is, Class<?> clazz, Object key, Object value)

Creates an instance checking for the Map interface.

Parameters
is:Introspector

the introspector

clazz:Class<?>

the class that might implement the map interface

key:Object

the key to use as argument in map.put(key,value)

value:Object

the value to use as argument in map.put(key,value)

Method Detail

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

Finds the method to perform 'set' on a map.

Parameters
clazz:Class<?>

the class to introspect

Returns:Method

a marker method, map.get

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

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
Exceptions
IllegalAccessException:
Method is inaccessible.
InvocationTargetException:
Method body throws an exception.
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