Class UnresolvedPatternElementFactory
Object
com.owenfeehan.pathpatternfinder.patternelements.unresolved.UnresolvedPatternElementFactory
public class UnresolvedPatternElementFactory extends Object
Creates
Pattern
s or PatternElement
s which have yet to be resolved or adds
a new such unresolved Element to an existing Pattern
.- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description UnresolvedPatternElementFactory(IOCase ioCase)
Creates with a particular case-sensitivity. -
Method Summary
Modifier and Type Method Description void
addUnresolvedPathsTo(List<Path> list, Pattern pattern, boolean avoidExtensionSplit)
Adds unresolved-paths to the patternvoid
addUnresolvedStringsTo(List<String> list, Pattern pattern, boolean requiresPeriod)
Adds unresolved-strings to the patternvoid
addUnresolvedStringsTo(List<String> list, Pattern pattern, boolean requiresPeriod, Skipper skipper)
Adds unresolved-strings to the pattern with additional instructions to skip certain types of operations (Skipper)Pattern
createUnresolvedString(PatternElement left, List<String> right, boolean requiresPeriod)
Creates aPattern
with an element on the left, and a unresolved-string on the rightPattern
createUnresolvedString(List<PatternElement> left, List<String> right, boolean requiresPeriod)
Creates aPattern
with an elements on the left, and a unresolved-string on the rightPattern
createUnresolvedString(List<String> list, boolean requiresPeriod)
Creates aPattern
with a single-unresolved-string as elementCasedStringComparer
stringComparer()
The comparer uses for strings, with particular case-sensitivity specified.
-
Constructor Details
-
UnresolvedPatternElementFactory
Creates with a particular case-sensitivity.- Parameters:
ioCase
- specifies the case-sensitivity to use when comparing strings.
-
-
Method Details
-
stringComparer
The comparer uses for strings, with particular case-sensitivity specified.- Returns:
- the comparer
-
createUnresolvedString
Creates aPattern
with a single-unresolved-string as element- Parameters:
list
- input-listrequiresPeriod
- if true, a constant string will only be trimmed from the right if it includes at- Returns:
- the newly created pattern
-
createUnresolvedString
public Pattern createUnresolvedString(List<PatternElement> left, List<String> right, boolean requiresPeriod)Creates aPattern
with an elements on the left, and a unresolved-string on the right- Parameters:
left
- left-most elementsright
- right-most elementrequiresPeriod
- if true, a constant string will only be trimmed from the right if it includes at- Returns:
- the newly created pattern
-
createUnresolvedString
public Pattern createUnresolvedString(PatternElement left, List<String> right, boolean requiresPeriod)Creates aPattern
with an element on the left, and a unresolved-string on the right- Parameters:
left
- left-most elementright
- right-most elementrequiresPeriod
- if true, a constant string will only be trimmed from the right if it includes at- Returns:
- the newly created pattern
-
addUnresolvedPathsTo
Adds unresolved-paths to the pattern- Parameters:
list
- paths to addpattern
- pattern to add them toavoidExtensionSplit
- if true, splits will be avoided in file extensions in the paths (defined as anything after the right-most period)
-
addUnresolvedStringsTo
Adds unresolved-strings to the pattern- Parameters:
list
- strings to addpattern
- pattern to add them torequiresPeriod
- if true, a constant string will only be trimmed from the right if it includes at least one period (useful to prevent file-extensions) from being broken up.
-
addUnresolvedStringsTo
public void addUnresolvedStringsTo(List<String> list, Pattern pattern, boolean requiresPeriod, Skipper skipper)Adds unresolved-strings to the pattern with additional instructions to skip certain types of operations (Skipper)- Parameters:
list
- strings to addpattern
- pattern to add them torequiresPeriod
- if true, a constant string will only be trimmed from the right if it includes at least one period (useful to prevent file-extensions) from being broken up.skipper
- which types of operations to skip
-