cucumber.runtime.snippets.Snippet Maven / Gradle / Ivy
package cucumber.runtime.snippets;
import java.util.List;
public interface Snippet {
/**
* @return a {@link java.text.MessageFormat} template used to generate a snippet. The template can access the following variables:
*
*
* - {0} : Step Keyword
* - {1} : Value of {@link #escapePattern(String)}
* - {2} : Function name
* - {3} : Value of {@link #arguments(java.util.List)}
* - {4} : Regexp hint comment
* - {5} : value of {@link #tableHint()} if the step has a table
*
*/
String template();
/**
* @return a hint about alternative ways to declare a table argument
*/
String tableHint();
/**
* @param argumentTypes the types the snippet's argument should accept
* @return a string representation of the arguments
*/
String arguments(List> argumentTypes);
/**
* Langauges that don't support named capture groups should return null.
*
* @return the start of a named capture group
*/
String namedGroupStart();
/**
* Langauges that don't support named capture groups should return null.
*
* @return the end of a named capture group
*/
String namedGroupEnd();
/**
* @param pattern the computed pattern that will match an undefined step
* @return an escaped representation of the pattern, if escaping is necessary.
*/
String escapePattern(String pattern);
}