@API(value=Internal) public class ExecutableInvoker extends Object
ExecutableInvoker
encapsulates the invocation of a
Executable
(i.e., method or constructor),
including support for dynamic resolution of method parameters via
ParameterResolvers
.Constructor and Description |
---|
ExecutableInvoker() |
Modifier and Type | Method and Description |
---|---|
<T> T |
invoke(Constructor<T> constructor,
ExtensionContext extensionContext,
ExtensionRegistry extensionRegistry)
Invoke the supplied constructor with dynamic parameter resolution.
|
<T> T |
invoke(Constructor<T> constructor,
Object outerInstance,
ExtensionContext extensionContext,
ExtensionRegistry extensionRegistry)
Invoke the supplied constructor with the supplied outer instance and
dynamic parameter resolution.
|
Object |
invoke(Method method,
ExtensionContext extensionContext,
ExtensionRegistry extensionRegistry)
Invoke the supplied
static method with dynamic parameter resolution. |
Object |
invoke(Method method,
Object target,
ExtensionContext extensionContext,
ExtensionRegistry extensionRegistry)
Invoke the supplied method on the supplied target object with dynamic parameter
resolution.
|
public <T> T invoke(Constructor<T> constructor, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
constructor
- the constructor to invoke and resolve parameters forextensionContext
- the current ExtensionContext
extensionRegistry
- the ExtensionRegistry
to retrieve
ParameterResolvers
frompublic <T> T invoke(Constructor<T> constructor, Object outerInstance, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
This method should only be used to invoke the constructor for an inner class.
constructor
- the constructor to invoke and resolve parameters forouterInstance
- the outer instance to supply as the first argument
to the constructorextensionContext
- the current ExtensionContext
extensionRegistry
- the ExtensionRegistry
to retrieve
ParameterResolvers
frompublic Object invoke(Method method, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
static
method with dynamic parameter resolution.method
- the method to invoke and resolve parameters forextensionContext
- the current ExtensionContext
extensionRegistry
- the ExtensionRegistry
to retrieve
ParameterResolvers
frompublic Object invoke(Method method, Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry)
method
- the method to invoke and resolve parameters fortarget
- the object on which the method will be invoked; should be
null
for static methodsextensionContext
- the current ExtensionContext
extensionRegistry
- the ExtensionRegistry
to retrieve
ParameterResolvers
from