org.apache.commons.jexl2.internal
Class AbstractExecutor

java.lang.Object
  extended by org.apache.commons.jexl2.internal.AbstractExecutor
Direct Known Subclasses:
AbstractExecutor.Get, AbstractExecutor.Method, AbstractExecutor.Set

public abstract class AbstractExecutor
extends Object

Abstract class that is used to execute an arbitrary method that is introspected. This is the superclass for all other AbstractExecutor classes.

Since:
1.0

Nested Class Summary
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.
 
Field Summary
protected  Method method
          Method to be executed.
protected  Class<?> objectClass
          The class this executor applies to.
static Object TRY_FAILED
          A marker for invocation failures in tryInvoke.
 
Constructor Summary
protected AbstractExecutor(Class<?> theClass, Method theMethod)
          Default and sole constructor.
 
Method Summary
 boolean equals(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.
 Object getTargetProperty()
          Gets the property targeted by this executor.
 int hashCode()
          
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRY_FAILED

public static final Object TRY_FAILED
A marker for invocation failures in tryInvoke.


objectClass

protected final Class<?> objectClass
The class this executor applies to.


method

protected final Method method
Method to be executed.

Constructor Detail

AbstractExecutor

protected AbstractExecutor(Class<?> theClass,
                           Method theMethod)
Default and sole constructor.

Parameters:
theClass - the class this executor applies to
theMethod - the method held by this executor
Method Detail

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(AbstractExecutor arg)
Indicates whether some other executor is equivalent to this one.

Parameters:
arg - the other executor to check
Returns:
true if both executors are equivalent, false otherwise

isAlive

public final boolean isAlive()
Tell whether the executor is alive by looking at the value of the method.

Returns:
boolean Whether the executor is alive.

isCacheable

public boolean isCacheable()
Specifies if this executor is cacheable and able to be reused for this class of object it was returned for.

Returns:
true if can be reused for this class, false if not

getMethod

public final Method getMethod()
Gets the method to be executed or used as a marker.

Returns:
Method The method used by execute in derived classes.

getTargetClass

public final Class<?> getTargetClass()
Gets the object class targeted by this executor.

Returns:
the target object class

getTargetProperty

public Object getTargetProperty()
Gets the property targeted by this executor.

Returns:
the target property

getMethodName

public final String getMethodName()
Gets the method name used.

Returns:
method name

tryFailed

public final boolean tryFailed(Object exec)
Checks whether a tryExecute failed or not.

Parameters:
exec - the value returned by tryExecute
Returns:
true if tryExecute failed, false otherwise


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.