R - The type of the return value.public static class Invokers.Invoker<R> extends Object
Invoker provide an indirection for calling Methods.
This allows e.g. injecting additional parameters in the "real" invocation,
or calling different methods depending on the parameter(s).| Modifier and Type | Method and Description |
|---|---|
Class<?>[] |
getParameterTypes()
The expected parameter types.
|
R |
invoke(Object object,
Object... params)
Invoke a method on
object with the params
provided. |
public Invoker(Method method)
public Class<?>[] getParameterTypes()
public R invoke(Object object, Object... params) throws InvocationTargetException, IllegalAccessException
object with the params
provided. The params may be modified and/or interpreted
before the "real" method is invoked.object - The object to invoke a method on.params - The parameters available for invoking the method.InvocationTargetException - If the underlying Method#invoke throwsIllegalAccessException - If the underlying Method#invoke throwsCopyright © 2017 Code Distillery. All rights reserved.