|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@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 ",\\s?".
| Required Element Summary | |
|---|---|
String |
value
|
| Element Detail |
|---|
public abstract String value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||