|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.support.MethodInvokerUtils
public class MethodInvokerUtils
Utility methods for create MethodInvoker instances.
Constructor Summary | |
---|---|
MethodInvokerUtils()
|
Method Summary | ||
---|---|---|
static MethodInvoker |
getMethodInvokerByAnnotation(Class<? extends Annotation> annotationType,
Object target)
Create MethodInvoker for the method with the provided annotation
on the provided object. |
|
static MethodInvoker |
getMethodInvokerByAnnotation(Class<? extends Annotation> annotationType,
Object target,
Class<?>... expectedParamTypes)
Create a MethodInvoker from the delegate based on the annotationType. |
|
static MethodInvoker |
getMethodInvokerByName(Object object,
String methodName,
boolean paramsRequired,
Class<?>... paramTypes)
Create a MethodInvoker using the provided method name to search. |
|
static MethodInvoker |
getMethodInvokerForInterface(Class<?> cls,
String methodName,
Object object,
Class<?>... paramTypes)
Create a MethodInvoker using the provided interface, and method
name from that interface. |
|
static
|
getMethodInvokerForSingleArgument(Object target)
Create a MethodInvoker for the delegate from a single public
method. |
|
static String |
getParamTypesString(Class<?>... paramTypes)
Create a String representation of the array of parameter types. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MethodInvokerUtils()
Method Detail |
---|
public static MethodInvoker getMethodInvokerByName(Object object, String methodName, boolean paramsRequired, Class<?>... paramTypes)
MethodInvoker
using the provided method name to search.
object
- to be invokedmethodName
- of the method to be invokedparamsRequired
- boolean indicating whether the parameters are
required, if false, a no args version of the method will be searched for.paramTypes
- - parameter types of the method to search for.
public static String getParamTypesString(Class<?>... paramTypes)
paramTypes
-
public static MethodInvoker getMethodInvokerForInterface(Class<?> cls, String methodName, Object object, Class<?>... paramTypes)
MethodInvoker
using the provided interface, and method
name from that interface.
cls
- the interface to search for the method namedmethodName
- of the method to be invokedobject
- to be invokedparamTypes
- - parameter types of the method to search for.
public static MethodInvoker getMethodInvokerByAnnotation(Class<? extends Annotation> annotationType, Object target, Class<?>... expectedParamTypes)
annotationType
- the annotation to scan fortarget
- the target objectexpectedParamTypes
- the expected parameter types for the method
public static MethodInvoker getMethodInvokerByAnnotation(Class<? extends Annotation> annotationType, Object target)
MethodInvoker
for the method with the provided annotation
on the provided object. Annotations that cannot be applied to methods
(i.e. that aren't annotated with an element type of METHOD) will cause an
exception to be thrown.
annotationType
- to be searched fortarget
- to be invoked
public static <C,T> MethodInvoker getMethodInvokerForSingleArgument(Object target)
MethodInvoker
for the delegate from a single public
method.
target
- an object to search for an appropriate method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |