Package org.jbehave.core.parsers
Class RegexStoryParser
- java.lang.Object
-
- org.jbehave.core.parsers.RegexStoryParser
-
- All Implemented Interfaces:
StoryParser
public class RegexStoryParser extends Object implements StoryParser
Pattern-based story parser, which uses the keywords provided to parse the textual story into aStory
.
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceLoader
DEFAULT_RESOURCE_LOADER
static TableTransformers
DEFAULT_TABLE_TRANSFORMERS
protected static String
NONE
-
Constructor Summary
Constructors Constructor Description RegexStoryParser()
RegexStoryParser(ExamplesTableFactory tableFactory)
-
Method Summary
Modifier and Type Method Description protected String
concatenateStartingWords()
protected String
concatenateWithOr(String beforeKeyword, List<String> keywords)
protected List<String>
findSteps(String stepsAsText)
protected Keywords
keywords()
Story
parseStory(String storyAsText)
Parses story from its textual representationStory
parseStory(String storyAsText, String storyPath)
Parses story from its textual representation and (optional) story pathprotected List<String>
splitElements(String text, String keyword)
protected String
startingWithNL(String text)
-
-
-
Field Detail
-
DEFAULT_RESOURCE_LOADER
public static final ResourceLoader DEFAULT_RESOURCE_LOADER
-
DEFAULT_TABLE_TRANSFORMERS
public static final TableTransformers DEFAULT_TABLE_TRANSFORMERS
-
NONE
protected static final String NONE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RegexStoryParser
public RegexStoryParser()
-
RegexStoryParser
public RegexStoryParser(ExamplesTableFactory tableFactory)
-
-
Method Detail
-
parseStory
public Story parseStory(String storyAsText)
Description copied from interface:StoryParser
Parses story from its textual representation- Specified by:
parseStory
in interfaceStoryParser
- Parameters:
storyAsText
- the textual representation- Returns:
- The Story
-
parseStory
public Story parseStory(String storyAsText, String storyPath)
Description copied from interface:StoryParser
Parses story from its textual representation and (optional) story path- Specified by:
parseStory
in interfaceStoryParser
- Parameters:
storyAsText
- the textual representationstoryPath
- the story path, may benull
- Returns:
- The Story
-
keywords
protected Keywords keywords()
-
concatenateStartingWords
protected String concatenateStartingWords()
-
-