public class PatternVariantBuilder
extends java.lang.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|y|} 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:
Constructor and Description |
---|
PatternVariantBuilder(java.lang.String input)
Creates a builder and calculates all variants for given input.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
allVariants()
Returns a new copy set of all variants with no whitespace compression.
|
java.util.Set<java.lang.String> |
allVariants(boolean compressWhitespace)
Returns a new copy set of all variants.
|
java.lang.String |
getInput() |
public PatternVariantBuilder(java.lang.String input)
input
- to be evaluatedpublic java.lang.String getInput()
public java.util.Set<java.lang.String> allVariants()
Set
of all variants without whitespace compressionallVariants(boolean)
public java.util.Set<java.lang.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.
compressWhitespace
- whether or not to compress whitespaceSet
of all variantsCopyright © 2003-2014. All Rights Reserved.