cucumber
Annotation Type Delimiter


@Retention(value=RUNTIME)
@Target(value=PARAMETER)
public @interface Delimiter

This annotation can be specified on step definition method parameters to give Cucumber a hint about how to transform a String to a list of objects. For example, if you have the following Gherkin step:

 Given the users adam, bob, john
 

Then the following Java Step Definition would convert that into a List:

 @Given("^the users ([a-z](?:, [a-z]+))$")
 public void the_users(@Delimiter(", ") List users) {
     this.users = users;
 }
 

This annotation also works with regular expression patterns. Step definition method parameters of type List without the Delimiter annotation will default to the pattern ", ?".


Required Element Summary
 String value
           
 

Element Detail

value

public abstract String value


Copyright © 2012. All Rights Reserved.