cucumber.runtime
Interface StepDefinition


public interface StepDefinition


Method Summary
 void execute(java.util.Locale locale, java.lang.Object[] args)
          Invokes the step definition.
 java.lang.String getLocation()
          The source line where the step definition is defined.
 java.util.List<ParameterType> getParameterTypes()
          The parameter types this step definition can be invoked with.
 java.lang.String getPattern()
           
 boolean isDefinedAt(java.lang.StackTraceElement stackTraceElement)
          Return true if this matches the location.
 java.util.List<gherkin.formatter.Argument> matchedArguments(gherkin.formatter.model.Step step)
          Returns a list of arguments.
 

Method Detail

matchedArguments

java.util.List<gherkin.formatter.Argument> matchedArguments(gherkin.formatter.model.Step step)
Returns a list of arguments. Return null if the step definition doesn't match at all. Return an empty List if it matches with 0 arguments and bigger sizes if it matches several.


getLocation

java.lang.String getLocation()
The source line where the step definition is defined. Example: foo/bar/Zap.brainfuck:42


getParameterTypes

java.util.List<ParameterType> getParameterTypes()
The parameter types this step definition can be invoked with. This will be used to coerce string values from arguments before invoking the step definition. The size of the returned array must be equal to the number of arguments accepted by execute.

If the parameter types are unknown at runtime, the result may be null.


execute

void execute(java.util.Locale locale,
             java.lang.Object[] args)
             throws java.lang.Throwable
Invokes the step definition. The method should raise a Throwable if the invocation fails, which will cause the step to fail.

Throws:
java.lang.Throwable

isDefinedAt

boolean isDefinedAt(java.lang.StackTraceElement stackTraceElement)
Return true if this matches the location. This is used to filter stack traces.


getPattern

java.lang.String getPattern()
Returns:
the pattern associated with this instance. Used for error reporting only.