Package io.cucumber.java
Annotation Type ParameterType
Register parameter type.
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()
- See Also:
-
ParameterType
- Cucumber Expressions
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionName of the parameter type.boolean
Indicates whether or not this is a preferential parameter type when matching text against a RegularExpression.boolean
Indicates whether or not this is a parameter type that should be used for generatingGeneratedExpression
s from text.boolean
Indicates whether or not this parameter provides a strong type hint when considering a regular expression match.
-
Element Details
-
value
String valueRegular expression.Describes which patterns match this parameter type. If the expression includes capture groups their captured strings will be provided as individual arguments.
- Returns:
- a regular expression.
- See Also:
-
ParameterType.getRegexps()
-
-
-
name
String nameName of the parameter type.This is used as the type name in typed expressions. When not provided this will default to the name of the annotated method.
- Returns:
- human readable type name
- See Also:
-
ParameterType.getName()
- Default:
- ""
-
preferForRegexMatch
boolean preferForRegexMatchIndicates whether or not this is a preferential parameter type when matching text against a 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.- Returns:
- true if this is a preferential type
- See Also:
-
ParameterType.preferForRegexpMatch()
- Default:
- false
-
useForSnippets
boolean useForSnippetsIndicates whether or not this is a parameter type that should be used for generatingGeneratedExpression
s from text. Typically, parameter types with greedy regexps should return false.- Returns:
- true is this parameter type is used for expression generation
- See Also:
-
ParameterType.useForSnippets()
- Default:
- false
-
useRegexpMatchAsStrongTypeHint
boolean useRegexpMatchAsStrongTypeHintIndicates whether or not this parameter provides a strong type hint when considering a regular expression match. If so, the type hint provided by the method arguments will be ignored. If not, when both type hints are in agreement, this parameter type's transformer will be used. Otherwise parameter transformation for a regular expression match will be handled byDefaultParameterTransformer
.- Returns:
- true if this parameter type provides a type hint when considering a regular expression match
- Default:
- false
-