org.jbehave.core.parsers
Class RegexPrefixCapturingPatternParser

java.lang.Object
  extended by org.jbehave.core.parsers.RegexPrefixCapturingPatternParser
All Implemented Interfaces:
StepPatternParser

public class RegexPrefixCapturingPatternParser
extends Object
implements 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 $.

Author:
Elizabeth Keogh

Constructor Summary
RegexPrefixCapturingPatternParser()
          Creates a parser which captures parameters starting with $ in a matching step.
RegexPrefixCapturingPatternParser(String prefix)
          Creates a parser which captures parameters starting with a given prefix in a matching step.
 
Method Summary
 String getPrefix()
           
 StepMatcher parseStep(StepType stepType, String stepPattern)
          Parses a step pattern to create a step matcher
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegexPrefixCapturingPatternParser

public RegexPrefixCapturingPatternParser()
Creates a parser which captures parameters starting with $ in a matching step.


RegexPrefixCapturingPatternParser

public RegexPrefixCapturingPatternParser(String prefix)
Creates a parser which captures parameters starting with a given prefix in a matching step.

Parameters:
prefix - the prefix to use in capturing parameters
Method Detail

getPrefix

public String getPrefix()

parseStep

public StepMatcher parseStep(StepType stepType,
                             String stepPattern)
Description copied from interface: StepPatternParser
Parses a step pattern to create a step matcher

Specified by:
parseStep in interface StepPatternParser
stepPattern - the step pattern
Returns:
A StepMatcher that will capture the parameters associated with a step

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2011. All Rights Reserved.