@Retention(value=RUNTIME) @Target(value=METHOD) @API(status=STABLE) public @interface ParameterType
The name of the method is used as the name of the ParameterType
.
The method must have one of these signatures. The number of String
parameters must match the
number of capture groups in the regular expression.
String -> Author
String, String -> Author
String, String, ect -> Author
String... -> Author
Author
is an example of the type of the parameter type. ParameterType.getType()
ParameterType
,
Cucumber ExpressionsModifier and Type | Required Element and Description |
---|---|
String |
value
Regular expression.
|
Modifier and Type | Optional Element and Description |
---|---|
String |
name
Name of the parameter type.
|
boolean |
preferForRegexMatch
Indicates whether or not this is a preferential parameter type when matching text
against a
RegularExpression . |
boolean |
useForSnippets
Indicates whether or not this is a parameter type that should be used for generating
GeneratedExpression s from text. |
public abstract String value
Describes which patterns match this parameter type. If the expression includes capture groups their captured strings will be provided as individual arguments.
ParameterType.getRegexps()
public abstract String name
This is used as the type name in typed expressions. When not provided this will default to the name of the annotated method.
ParameterType.getName()
public abstract boolean preferForRegexMatch
RegularExpression
. In case there are multiple parameter types
with a regexp identical to the capture group's regexp, a preferential parameter type will
win. If there are more than 1 preferential ones, an error will be thrown.ParameterType.preferForRegexpMatch()
public abstract boolean useForSnippets
GeneratedExpression
s from text. Typically, parameter types with greedy regexps
should return false.ParameterType.useForSnippets()
Copyright © 2020. All rights reserved.