Top Description Inners Fields Constructors Methods
org.junit.jupiter.engine.execution

public Class InterceptingExecutableInvoker

extends Object
Class Inheritance
Annotations
@API
status:INTERNAL
since:5.0
Static Imports
org.apiguardian.api.API.Status.INTERNAL, org.junit.jupiter.engine.execution.ParameterResolutionUtils.resolveParameters

InterceptingExecutableInvoker encapsulates the invocation of a java.lang.reflect.Executable (i.e., method or constructor), including support for dynamic resolution of method parameters via ParameterResolvers.
Since
5.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
private static final InvocationInterceptorChain

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T> T
invoke(Constructor<T>
the constructor to invoke and resolve parameters for
constructor
,
Optional<Object>
the outer instance to supply as the first argument to the constructor; empty, for top-level classes
outerInstance
,
ExtensionContextSupplier
the current ExtensionContext
extensionContext
,
ExtensionRegistry
the ExtensionRegistry to retrieve ParameterResolvers from
extensionRegistry
,
InterceptingExecutableInvoker.ReflectiveInterceptorCall<Constructor<T>, T>
the call for intercepting this constructor invocation via all registered interceptors
interceptorCall
)

Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.

public <T extends @Nullable Object> T
invoke(Method
the method to invoke and resolve parameters for
method
,
@Nullable Object
the target on which the executable will be invoked, potentially wrapped in an Optional; can be null or an empty Optional for a static method
target
,
ExtensionContext
the current ExtensionContext
extensionContext
,
ExtensionRegistry
the ExtensionRegistry to retrieve ParameterResolvers from
extensionRegistry
,
InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, T>
the call for intercepting this method invocation via all registered interceptors
interceptorCall
)

Invoke the supplied method with dynamic parameter resolution.

private <E extends Executable, T> T
invoke(InvocationInterceptor.Invocation<T> originalInvocation, ReflectiveInvocationContext<E> invocationContext, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<E, T> call)

private <E extends Executable, T> T
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

interceptorChainback to summary
private static final InvocationInterceptorChain interceptorChain

Constructor Detail

InterceptingExecutableInvokerback to summary
public InterceptingExecutableInvoker()

Method Detail

invokeback to summary
public <T> T invoke(Constructor<T> constructor, Optional<Object> outerInstance, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<Constructor<T>, T> interceptorCall)

Invoke the supplied constructor with the supplied outer instance and dynamic parameter resolution.

Parameters
constructor:Constructor<T>

the constructor to invoke and resolve parameters for

outerInstance:Optional<Object>

the outer instance to supply as the first argument to the constructor; empty, for top-level classes

extensionContext:ExtensionContextSupplier

the current ExtensionContext

extensionRegistry:ExtensionRegistry

the ExtensionRegistry to retrieve ParameterResolvers from

interceptorCall:InterceptingExecutableInvoker.ReflectiveInterceptorCall<Constructor<T>, T>

the call for intercepting this constructor invocation via all registered interceptors

invokeback to summary
public <T extends @Nullable Object> T invoke(Method method, @Nullable Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, T> interceptorCall)

Invoke the supplied method with dynamic parameter resolution.

Parameters
method:Method

the method to invoke and resolve parameters for

target:@Nullable Object

the target on which the executable will be invoked, potentially wrapped in an Optional; can be null or an empty Optional for a static method

extensionContext:ExtensionContext

the current ExtensionContext

extensionRegistry:ExtensionRegistry

the ExtensionRegistry to retrieve ParameterResolvers from

interceptorCall:InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, T>

the call for intercepting this method invocation via all registered interceptors

invokeback to summary
private <E extends Executable, T> T invoke(InvocationInterceptor.Invocation<T> originalInvocation, ReflectiveInvocationContext<E> invocationContext, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<E, T> call)
invokeback to summary
private <E extends Executable, T> T invoke(InvocationInterceptor.Invocation<T> originalInvocation, ReflectiveInvocationContext<E> invocationContext, ExtensionContextSupplier extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall<E, T> call)
invokeVoidback to summary
public void invokeVoid(Method method, @Nullable Object target, ExtensionContext extensionContext, ExtensionRegistry extensionRegistry, InterceptingExecutableInvoker.ReflectiveInterceptorCall.VoidMethodInterceptorCall interceptorCall)
org.junit.jupiter.engine.execution back to summary

public Interface InterceptingExecutableInvoker.ReflectiveInterceptorCall<E extends Executable, T extends @Nullable Object>


Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Method Summary

Modifier and TypeMethod and Description
public T
apply(InvocationInterceptor interceptor, InvocationInterceptor.Invocation<T> invocation, ReflectiveInvocationContext<E> invocationContext, ExtensionContext extensionContext)

public static InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, @Nullable Void>

Method Detail

applyback to summary
public T apply(InvocationInterceptor interceptor, InvocationInterceptor.Invocation<T> invocation, ReflectiveInvocationContext<E> invocationContext, ExtensionContext extensionContext) throws Throwable
ofVoidMethodback to summary
public static InterceptingExecutableInvoker.ReflectiveInterceptorCall<Method, @Nullable Void> ofVoidMethod(InterceptingExecutableInvoker.ReflectiveInterceptorCall.VoidMethodInterceptorCall call)
org.junit.jupiter.engine.execution back to summary

public Interface InterceptingExecutableInvoker.ReflectiveInterceptorCall.VoidMethodInterceptorCall


Method Summary

Modifier and TypeMethod and Description
public void

Method Detail

applyback to summary
public void apply(InvocationInterceptor interceptor, InvocationInterceptor.Invocation<Void> invocation, ReflectiveInvocationContext<Method> invocationContext, ExtensionContext extensionContext) throws Throwable