Class StepInterceptorImpl
java.lang.Object
com.tngtech.jgiven.impl.intercept.StepInterceptorImpl
- All Implemented Interfaces:
StepInterceptor
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tngtech.jgiven.impl.intercept.StepInterceptor
StepInterceptor.Invoker -
Field Summary
FieldsModifier and TypeFieldDescriptionContains the stack of call receivers. -
Constructor Summary
ConstructorsConstructorDescriptionStepInterceptorImpl(ScenarioExecutor scenarioExecutor, ScenarioListener listener, StageTransitionHandler stageTransitionHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanenableMethodExecution(boolean b) voidenableMethodInterception(boolean b) protected InvocationModegetInvocationMode(Object receiver, Method method) protected ObjecthandleThrowable(Object receiver, Method method, Throwable t, long durationInNanos, boolean handleMethod) final Objectintercept(Object receiver, Method method, Object[] parameters, StepInterceptor.Invoker invoker) protected ObjectreturnReceiverOrNull(Object receiver, Method method) voidsetDefaultInvocationMode(InvocationMode defaultInvocationMode) voidsetScenarioListener(ScenarioListener scenarioListener) voidsetSuppressExceptions(boolean b)
-
Field Details
-
stageStack
Contains the stack of call receivers. This is used to update the state of a parent stage after a call to a child stage has returned
-
-
Constructor Details
-
StepInterceptorImpl
public StepInterceptorImpl(ScenarioExecutor scenarioExecutor, ScenarioListener listener, StageTransitionHandler stageTransitionHandler)
-
-
Method Details
-
intercept
public final Object intercept(Object receiver, Method method, Object[] parameters, StepInterceptor.Invoker invoker) throws Throwable - Specified by:
interceptin interfaceStepInterceptor- Throws:
Throwable
-
handleThrowable
protected Object handleThrowable(Object receiver, Method method, Throwable t, long durationInNanos, boolean handleMethod) throws Throwable - Throws:
Throwable
-
returnReceiverOrNull
-
getInvocationMode
-
enableMethodInterception
public void enableMethodInterception(boolean b) -
disableMethodExecution
public void disableMethodExecution() -
enableMethodExecution
public boolean enableMethodExecution(boolean b) -
setSuppressExceptions
public void setSuppressExceptions(boolean b) -
setDefaultInvocationMode
-
setScenarioListener
-