Package org.jbehave.core.parsers
Class RegexPrefixCapturingPatternParser
java.lang.Object
org.jbehave.core.parsers.RegexPrefixCapturingPatternParser
- All Implemented Interfaces:
StepPatternParser
A step pattern parser that provides a step matcher which will capture parameters starting with the given prefix in any matching step. Default prefix is $.
The parameter names are by default assumed to be any unicode-supported alphanumeric sequence, not limited to ASCII (see http://www.regular-expressions.info/unicode.html), i.e. corresponding to character class [\p{L}\p{N}\p{Pc}]. A different character class can optionally be provided.
- Author:
- Elizabeth Keogh, Mauro Talevi
-
Constructor Summary
ConstructorDescriptionCreates a parser which captures parameters starting with $ in a matching step and whose names are alphanumeric sequences.Creates a parser which captures parameters starting with a given prefix in a matching step and whose names are alphanumeric sequencesRegexPrefixCapturingPatternParser
(String prefix, String characterClass) Creates a parser which captures parameters starting with a given prefix in a matching step and a given character class. -
Method Summary
-
Constructor Details
-
RegexPrefixCapturingPatternParser
public RegexPrefixCapturingPatternParser()Creates a parser which captures parameters starting with $ in a matching step and whose names are alphanumeric sequences. -
RegexPrefixCapturingPatternParser
Creates a parser which captures parameters starting with a given prefix in a matching step and whose names are alphanumeric sequences- Parameters:
prefix
- the prefix to use in capturing parameters
-
RegexPrefixCapturingPatternParser
Creates a parser which captures parameters starting with a given prefix in a matching step and a given character class.- Parameters:
prefix
- the prefix to use in capturing parameterscharacterClass
- the regex character class to find parameter names
-
-
Method Details
-
getPrefix
Description copied from interface:StepPatternParser
Returns current parameter prefix- Specified by:
getPrefix
in interfaceStepPatternParser
- Returns:
- parameter prefix, e.g. $
-
parseStep
Description copied from interface:StepPatternParser
Parses a step pattern to create a step matcher- Specified by:
parseStep
in interfaceStepPatternParser
- Parameters:
stepType
- the step typestepPattern
- the step pattern- Returns:
- A StepMatcher that will capture the parameters associated with a step
-
toString
-