Class ResolvedPatternElementFactory
Object
com.owenfeehan.pathpatternfinder.patternelements.resolved.ResolvedPatternElementFactory
public class ResolvedPatternElementFactory extends Object
Creation of the different types of resolved elements.
- Author:
- Owen Feehan
-
Method Summary
Modifier and Type Method Description static void
addConstantAndDirectoryTo(String value, Pattern pattern)
LikeaddConstantTo(String,Pattern)
but additionally adds a directory separator.static PatternElement
addConstantTo(char value, Pattern pattern)
Creates a new constant element from a character, and adds topattern
.static PatternElement
addConstantTo(String value, Pattern pattern)
Creates a new constant element from a string, and adds topattern
.static void
addDirectorySeperatorTo(Pattern pattern)
Creates a new directory-seperator element, and adds topattern
.static PatternElement
constant(char value)
Creates constant element of a single character.static PatternElement
constant(String value)
Creates constant element of a string.static PatternElement
directorySeperator()
Creates an element representing a directory separator.static PatternElement
integer(int... values)
Creates a varying integer element of one or more ints.static PatternElement
integer(List<String> values)
Creates a varying integer element of one more strings.static PatternElement
string(String... values)
Creates a varying string element of one or more strings.static PatternElement
string(List<String> values)
Creates a varying string element from a list of strings.
-
Method Details
-
constant
Creates constant element of a single character.- Parameters:
value
- the character- Returns:
- a newly created element
-
constant
Creates constant element of a string.- Parameters:
value
- the string- Returns:
- a newly created element
-
integer
Creates a varying integer element of one or more ints.- Parameters:
values
- the ints that vary- Returns:
- a newly created element
-
integer
Creates a varying integer element of one more strings.- Parameters:
values
- the strings that vary- Returns:
- a newly created element
-
string
Creates a varying string element of one or more strings.- Parameters:
values
- the strings that vary- Returns:
- a newly created element
-
string
Creates a varying string element from a list of strings.- Parameters:
values
- the strings that vary- Returns:
- a newly created element
-
directorySeperator
Creates an element representing a directory separator.e.g. this is a forward-slash on Unix or a backslash on Windows.
- Returns:
- a newly created element
-
addConstantAndDirectoryTo
LikeaddConstantTo(String,Pattern)
but additionally adds a directory separator.- Parameters:
value
- the value for the constant elementpattern
- the pattern to add to
-
addConstantTo
Creates a new constant element from a string, and adds topattern
.- Parameters:
value
- the value for the constant elementpattern
- the pattern to add to- Returns:
- the element that was added
-
addConstantTo
Creates a new constant element from a character, and adds topattern
.- Parameters:
value
- the value for the constant elementpattern
- the pattern to add to- Returns:
- the element that was added
-
addDirectorySeperatorTo
Creates a new directory-seperator element, and adds topattern
.- Parameters:
pattern
- the pattern to add to
-