Package io.cucumber.core.runner
Class CoreStepDefinition
java.lang.Object
io.cucumber.core.runner.CoreStepDefinition
- All Implemented Interfaces:
Located,StepDefinition
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArgumentMatcherprivate final StepExpressionprivate final UUIDprivate final StepDefinitionprivate final Type[] -
Constructor Summary
ConstructorsConstructorDescriptionCoreStepDefinition(UUID id, StepDefinition stepDefinition, StepExpression expression) -
Method Summary
Modifier and TypeMethodDescriptionvoidInvokes the step definition.(package private) Optional<SourceReference> (package private) StepExpression(package private) UUIDgetId()Location of step definition.Return the pattern associated with this instance.(package private) StepDefinitionprivate static Type[]getTypes(List<ParameterInfo> parameterInfos) booleanisDefinedAt(StackTraceElement stackTraceElement) Return true if this matches the location.matchedArguments(Step step) Return parameter information.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.cucumber.core.backend.Located
getSourceReference
-
Field Details
-
id
-
expression
-
argumentMatcher
-
stepDefinition
-
types
-
-
Constructor Details
-
CoreStepDefinition
CoreStepDefinition(UUID id, StepDefinition stepDefinition, StepExpression expression)
-
-
Method Details
-
getTypes
-
getExpression
StepExpression getExpression() -
getStepDefinition
StepDefinition getStepDefinition() -
matchedArguments
-
getId
UUID getId() -
execute
public void execute(Object[] args) throws CucumberBackendException, CucumberInvocationTargetException Description copied from interface:StepDefinitionInvokes the step definition. The method should raise a Throwable if the invocation fails, which will cause the step to fail.- Specified by:
executein interfaceStepDefinition- Parameters:
args- The arguments for the step- Throws:
CucumberBackendException- of a failure to invoke the stepCucumberInvocationTargetException- in case of a failure in the step.
-
parameterInfos
Description copied from interface:StepDefinitionReturn parameter information.- Specified by:
parameterInfosin interfaceStepDefinition- Returns:
- parameter information, may not return null
-
getPattern
Description copied from interface:StepDefinitionReturn the pattern associated with this instance. Used for error reporting only.- Specified by:
getPatternin interfaceStepDefinition- Returns:
- the pattern associated with this instance.
-
isDefinedAt
Description copied from interface:LocatedReturn true if this matches the location. This is used to filter stack traces.- Specified by:
isDefinedAtin interfaceLocated- Parameters:
stackTraceElement- The location of the step.- Returns:
- Return true if this matches the location.
-
getLocation
Description copied from interface:LocatedLocation of step definition. Can either be a a method or stack trace style location.Examples:
-
com.example.StepDefinitions.given_an_example(io.cucumber.datatable.DataTable) com.example.StepDefinitions.<init>(StepDefinitions.java:9)
- Specified by:
getLocationin interfaceLocated- Returns:
- The source line of the step definition.
-
-
getDefinitionLocation
Optional<SourceReference> getDefinitionLocation()
-