|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jorphan.reflect.Functor
public class Functor
Implements function call-backs. Functors may be defined for instance objects or classes. The method is created on first use, which allows the invokee (class or instance) to be omitted from the constructor. The class name takes precedence over the instance. If a functor is created with a particular instance, then that is used for all future calls; if an object is provided, it is ignored. This allows easy override of the table model behaviour. If an argument list is provided in the constructor, then that is ignored in subsequent invoke() calls. Usage: f = new Functor("methodName") o = f.invoke(object) - OR - o = f.invoke(object,params) f2 = new Functor(object,"methodName"); o = f2.invoke() - OR - o = f2.invoke(params) f3 = new Functor(class,"methodName"); o = f3.invoke(object) - will be ignored o = f3.invoke() - OR - o = f3.invoke(params) o = f3.invoke(object,params) - object will be ignored
Constructor Summary | |
---|---|
Functor(Class<?> _clazz,
String _methodName)
Create a functor from class and method name. |
|
Functor(Class<?> _clazz,
String _methodName,
Class<?>[] _types)
Create a functor with the class, method name, and argument class types. |
|
Functor(Object _invokee,
String _methodName)
Create a functor with the invokee and a method name. |
|
Functor(Object _invokee,
String _methodName,
Class<?>[] _types)
Create a functor with the invokee, method name, and argument class types. |
|
Functor(Object _invokee,
String _methodName,
Object[] _args)
Create a functor with an invokee, method name, and argument values. |
|
Functor(String _methodName)
Create a functor with just the method name. |
|
Functor(String _methodName,
Class<?>[] _types)
Create a functor with the method name and argument class types. |
|
Functor(String _methodName,
Object[] _args)
Create a functor from method name and arguments. |
Method Summary | |
---|---|
boolean |
checkMethod(Object _invokee)
Deprecated. ** for use by Unit test code only ** |
boolean |
checkMethod(Object _invokee,
Class<?> c)
Deprecated. ** for use by Unit test code only ** |
Object |
invoke()
Invoke a Functor, which must have been created with either a class name or object. |
Object |
invoke(Object p_invokee)
Invoke the method on a given object. |
Object |
invoke(Object[] p_args)
Invoke the method with the provided parameters. |
Object |
invoke(Object p_invokee,
Object[] p_args)
Invoke the method on the invokee with the provided parameters. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Functor(Object _invokee, String _methodName)
_invokee
- object on which to invoke the method_methodName
- method namepublic Functor(Class<?> _clazz, String _methodName)
_clazz
- class to be used_methodName
- method namepublic Functor(Object _invokee, String _methodName, Class<?>[] _types)
_invokee
- object on which to invoke the method_methodName
- method name_types
- public Functor(Class<?> _clazz, String _methodName, Class<?>[] _types)
_clazz
- the class in which to find the method_methodName
- method name_types
- public Functor(String _methodName)
_methodName
- method namepublic Functor(String _methodName, Class<?>[] _types)
_methodName
- method name_types
- parameter typespublic Functor(Object _invokee, String _methodName, Object[] _args)
_invokee
- object on which to invoke the method_methodName
- method name_args
- arguments to be passed to the methodpublic Functor(String _methodName, Object[] _args)
_methodName
- method name_args
- Method Detail |
---|
public Object invoke()
public Object invoke(Object p_invokee)
p_invokee
- - provides the object to call; ignored if the class or object were provided to the constructor
public Object invoke(Object[] p_args)
p_args
- parameters for the method
public Object invoke(Object p_invokee, Object[] p_args)
@Deprecated public boolean checkMethod(Object _invokee)
@Deprecated public boolean checkMethod(Object _invokee, Class<?> c)
public String toString()
toString
in class Object
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |