|
|||||||||||
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 | |
java.lang.Object[] |
getArguments()
|
java.lang.reflect.Method |
getPreparedMethod()
Return the prepared Method object that will be invoker. |
java.lang.Class |
getTargetClass()
Return the target class on which to call the target method. |
java.lang.String |
getTargetMethod()
Return the name of the method to be invoked. |
java.lang.Object |
getTargetObject()
Return the target object on which to call the target method. |
java.lang.Object |
invoke()
Invoke the specified method. |
void |
prepare()
Prepare the specified method. |
void |
setArguments(java.lang.Object[] arguments)
Set arguments for the method invocation. |
void |
setStaticMethod(java.lang.String staticMethod)
Set a fully qualified static method name to invoke, e.g. |
void |
setTargetClass(java.lang.Class targetClass)
Set the target class on which to call the target method. |
void |
setTargetMethod(java.lang.String targetMethod)
Set the name of the method to be invoked. |
void |
setTargetObject(java.lang.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(java.lang.Class targetClass)
setTargetObject(java.lang.Object)
,
setTargetMethod(java.lang.String)
public java.lang.Class getTargetClass()
public void setTargetObject(java.lang.Object targetObject)
setTargetClass(java.lang.Class)
,
setTargetMethod(java.lang.String)
public java.lang.Object getTargetObject()
public void setTargetMethod(java.lang.String targetMethod)
setTargetClass(java.lang.Class)
,
setTargetObject(java.lang.Object)
public java.lang.String getTargetMethod()
public void setStaticMethod(java.lang.String staticMethod) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
setTargetClass(java.lang.Class)
,
setTargetMethod(java.lang.String)
public void setArguments(java.lang.Object[] arguments)
public java.lang.Object[] getArguments()
public void prepare() throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
getPreparedMethod()
,
invoke()
public java.lang.reflect.Method getPreparedMethod()
prepare()
,
invoke()
public java.lang.Object invoke() throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
prepare()
,
VOID
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |