io.cucumber.core.backend.Located Maven / Gradle / Ivy
package io.cucumber.core.backend;
import org.apiguardian.api.API;
import java.util.Optional;
@API(status = API.Status.STABLE)
public interface Located {
/**
* @param stackTraceElement The location of the step.
* @return Return true if this matches the location. This
* is used to filter stack traces.
*/
boolean isDefinedAt(StackTraceElement stackTraceElement);
/**
* Location of step definition. Can either be a a method or stack trace
* style location.
*
* Examples:
*
* -
* {@code com.example.StepDefinitions.given_an_example(io.cucumber.datatable.DataTable) }
*
* - {@code com.example.StepDefinitions.
(StepDefinitions.java:9)}
*
*
*
* @return The source line of the step definition.
*/
String getLocation();
default Optional getSourceReference() {
return Optional.empty();
}
}