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 a Story.
  • Field Details

  • Constructor Details

    • RegexStoryParser

      public RegexStoryParser()
    • RegexStoryParser

      public RegexStoryParser(ExamplesTableFactory tableFactory)
  • Method Details

    • parseStory

      public Story parseStory(String storyAsText)
      Description copied from interface: StoryParser
      Parses story from its textual representation
      Specified by:
      parseStory in interface StoryParser
      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 interface StoryParser
      Parameters:
      storyAsText - the textual representation
      storyPath - the story path, may be null
      Returns:
      The Story
    • keywords

      protected Keywords keywords()
    • splitElements

      protected List<String> splitElements(String text, String keyword)
    • startingWithNL

      protected String startingWithNL(String text)
    • findSteps

      protected List<String> findSteps(String stepsAsText)
    • concatenateStartingWords

      protected String concatenateStartingWords()
    • concatenateWithOr

      protected String concatenateWithOr(String beforeKeyword, List<String> keywords)