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 ResourceLoaderDEFAULT_RESOURCE_LOADERstatic TableTransformersDEFAULT_TABLE_TRANSFORMERSprotected static StringNONE
-
Constructor Summary
Constructors Constructor Description RegexStoryParser()RegexStoryParser(ExamplesTableFactory tableFactory)
-
Method Summary
Modifier and Type Method Description protected StringconcatenateStartingWords()protected StringconcatenateWithOr(String beforeKeyword, List<String> keywords)protected List<String>findSteps(String stepsAsText)protected Keywordskeywords()StoryparseStory(String storyAsText)Parses story from its textual representationStoryparseStory(String storyAsText, String storyPath)Parses story from its textual representation and (optional) story pathprotected List<String>splitElements(String text, String keyword)protected StringstartingWithNL(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:StoryParserParses story from its textual representation- Specified by:
parseStoryin interfaceStoryParser- Parameters:
storyAsText- the textual representation- Returns:
- The Story
-
parseStory
public Story parseStory(String storyAsText, String storyPath)
Description copied from interface:StoryParserParses story from its textual representation and (optional) story path- Specified by:
parseStoryin interfaceStoryParser- Parameters:
storyAsText- the textual representationstoryPath- the story path, may benull- Returns:
- The Story
-
keywords
protected Keywords keywords()
-
concatenateStartingWords
protected String concatenateStartingWords()
-
-