public final class MethodExecutor extends AbstractExecutor.Method
Modifier and Type | Class and Description |
---|---|
static class |
AbstractExecutor.Get
Abstract class that is used to execute an arbitrary 'get' method.
|
static class |
AbstractExecutor.Method
Abstract class that is used to execute an arbitrary method.
|
static class |
AbstractExecutor.Set
Abstract class that is used to execute an arbitrary 'set' method.
|
Modifier and Type | Field and Description |
---|---|
static Object |
TRY_FAILED
A marker for invocation failures in tryInvoke.
|
Modifier and Type | Method and Description |
---|---|
static MethodExecutor |
discover(Introspector is,
Object obj,
String method,
Object[] args)
Discovers a
MethodExecutor . |
boolean |
equals(org.apache.commons.jexl3.internal.introspection.AbstractExecutor arg)
Indicates whether some other executor is equivalent to this one.
|
boolean |
equals(Object obj) |
Method |
getMethod()
Gets the method to be executed or used as a marker.
|
String |
getMethodName()
Gets the method name used.
|
Class<?> |
getTargetClass()
Gets the object class targeted by this executor.
|
int |
hashCode() |
Object |
invoke(Object o,
Object... args)
Invocation method, called when the method invocation should be performed
and a value returned.
|
boolean |
isAlive()
Tell whether the executor is alive by looking
at the value of the method.
|
boolean |
isCacheable()
Specifies if this executor is cacheable and able to be reused for this
class of object it was returned for.
|
boolean |
tryFailed(Object exec)
Checks whether a tryExecute failed or not.
|
Object |
tryInvoke(String name,
Object obj,
Object... args)
Attempts to reuse this JexlMethod, checking that it is compatible with
the actual set of arguments.
|
getReturnType, getTargetProperty
getClass, notify, notifyAll, toString, wait, wait, wait
isCacheable, tryFailed
public static final Object TRY_FAILED
public static MethodExecutor discover(Introspector is, Object obj, String method, Object[] args)
MethodExecutor
.
If the object is an array, an attempt will be made to find the
method in a List (see ArrayListWrapper
)
If the object is a class, an attempt will be made to find the method as a static method of that class.
is
- the introspector used to discover the methodobj
- the object to introspectmethod
- the name of the method to findargs
- the method argumentspublic Object invoke(Object o, Object... args) throws IllegalAccessException, InvocationTargetException
JexlMethod
o
- the objectargs
- method parameters.IllegalAccessException
InvocationTargetException
public Object tryInvoke(String name, Object obj, Object... args)
JexlMethod
name
- the method nameobj
- the object to invoke the method uponargs
- the method argumentspublic boolean equals(org.apache.commons.jexl3.internal.introspection.AbstractExecutor arg)
arg
- the other executor to checkpublic final boolean isAlive()
public boolean isCacheable()
public final Method getMethod()
public final Class<?> getTargetClass()
public final String getMethodName()
public final boolean tryFailed(Object exec)
exec
- the value returned by tryExecuteCopyright © 2001–2021 The Apache Software Foundation. All rights reserved.