Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jbehave.core.steps
Class PatternVariantBuilder

    java.lang.Object
      org.jbehave.core.steps.PatternVariantBuilder

    public class PatternVariantBuilder

extends Object

Builds a set of pattern variants of given pattern input, supporting a custom directives. Depending on the directives present, one or more resulting variants are created.

Currently supported directives are

Pattern | Result
..A {x|y} B.. | ..A x B.. ..A y B..
..A {x|y|} B.. | ..A x B.. ..A y B.. ..A B..
..A {x} B.. | ..A x B..

These directives can be used to conveniently create several variants of a step pattern, without having to repeat it as a whole as one or more aliases.

Examples:

- ``

  Author:
    Daniel Schneller

  Constructor Summary
  `PatternVariantBuilder(String input)` Creates a builder and calculates all variants for given input.

  Method Summary
  `Set<String>` | `allVariants()` Returns a new copy set of all variants with no whitespace compression.
  `Set<String>` | `allVariants(boolean compressWhitespace)` Returns a new copy set of all variants.
  `String` | `getInput()`

  Methods inherited from class java.lang.Object
  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  Constructor Detail

  ### PatternVariantBuilder

      public PatternVariantBuilder(String input)

    Creates a builder and calculates all variants for given input. When there are no variants found in the input, it will itself be the only result.

    Parameters:
      `input` - to be evaluated

  Method Detail

  ### getInput

      public String getInput()

  ### allVariants

      public Set<String> allVariants()

    Returns a new copy set of all variants with no whitespace compression.

    Returns:
      a `Set` of all variants without whitespace compression
    See Also:
      `allVariants(boolean)`

  ### allVariants

      public Set<String> allVariants(boolean compressWhitespace)

    Returns a new copy set of all variants. Any two or more consecutive white space characters will be condensed into a single space if boolean flag is set.

    Otherwise, any whitespace will be left as is.

    Parameters:
      `compressWhitespace` - whether or not to compress whitespace
    Returns:
      a `Set` of all variants

  Overview | Package | Class | Use | Tree | Deprecated | Index | Help
  PREV CLASS NEXT CLASS | FRAMES NO FRAMES
  SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

  Copyright © 2003-2013. All Rights Reserved.