|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.springframework.util.MethodInvoker
Helper class that allows to specify a method to invoke in a declarative fashion, be it static or non-static.
Usage: Specify targetClass/targetMethod respectively targetObject/targetMethod, optionally specify arguments, prepare the invoker. Afterwards, you can invoke the method any number of times.
Typically not used directly but via its subclasses MethodInvokingFactoryBean and MethodInvokingJobDetailFactoryBean.
prepare(),
invoke(),
MethodInvokingFactoryBean,
MethodInvokingJobDetailFactoryBean| Nested Class Summary | |
static class |
MethodInvoker.VoidType
Special marker class used for a void return value, differentiating void from a null value returned by the method. |
| Field Summary | |
static MethodInvoker.VoidType |
VOID
|
| Constructor Summary | |
MethodInvoker()
|
|
| Method Summary | |
Object[] |
getArguments()
|
Method |
getPreparedMethod()
Return the prepared Method object that will be invoker. |
Class |
getTargetClass()
Return the target class on which to call the target method. |
String |
getTargetMethod()
Return the name of the method to be invoked. |
Object |
getTargetObject()
Return the target object on which to call the target method. |
Object |
invoke()
Invoke the specified method. |
void |
prepare()
Prepare the specified method. |
void |
setArguments(Object[] arguments)
Set arguments for the method invocation. |
void |
setStaticMethod(String staticMethod)
Set a fully qualified static method name to invoke, e.g. |
void |
setTargetClass(Class targetClass)
Set the target class on which to call the target method. |
void |
setTargetMethod(String targetMethod)
Set the name of the method to be invoked. |
void |
setTargetObject(Object targetObject)
Set the target object on which to call the target method. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final MethodInvoker.VoidType VOID
| Constructor Detail |
public MethodInvoker()
| Method Detail |
public void setTargetClass(Class targetClass)
setTargetObject(java.lang.Object),
setTargetMethod(java.lang.String)public Class getTargetClass()
public void setTargetObject(Object targetObject)
setTargetClass(java.lang.Class),
setTargetMethod(java.lang.String)public Object getTargetObject()
public void setTargetMethod(String targetMethod)
setTargetClass(java.lang.Class),
setTargetObject(java.lang.Object)public String getTargetMethod()
public void setStaticMethod(String staticMethod)
throws ClassNotFoundException
ClassNotFoundExceptionsetTargetClass(java.lang.Class),
setTargetMethod(java.lang.String)public void setArguments(Object[] arguments)
public Object[] getArguments()
public void prepare()
throws ClassNotFoundException,
NoSuchMethodException
ClassNotFoundException
NoSuchMethodExceptiongetPreparedMethod(),
invoke()public Method getPreparedMethod()
prepare(),
invoke()
public Object invoke()
throws InvocationTargetException,
IllegalAccessException
InvocationTargetException
IllegalAccessExceptionprepare(),
VOID
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||