Class UnresolvedPatternElementFactory
Object
com.owenfeehan.pathpatternfinder.patternelements.unresolved.UnresolvedPatternElementFactory
public class UnresolvedPatternElementFactory extends Object
Creates
Patterns or PatternElements 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 voidaddUnresolvedPathsTo(List<Path> list, Pattern pattern, boolean avoidExtensionSplit)Adds unresolved-paths to the patternvoidaddUnresolvedStringsTo(List<String> list, Pattern pattern, boolean requiresPeriod)Adds unresolved-strings to the patternvoidaddUnresolvedStringsTo(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)PatterncreateUnresolvedString(PatternElement left, List<String> right, boolean requiresPeriod)Creates aPatternwith an element on the left, and a unresolved-string on the rightPatterncreateUnresolvedString(List<PatternElement> left, List<String> right, boolean requiresPeriod)Creates aPatternwith an elements on the left, and a unresolved-string on the rightPatterncreateUnresolvedString(List<String> list, boolean requiresPeriod)Creates aPatternwith a single-unresolved-string as elementCasedStringComparerstringComparer()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 aPatternwith 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 aPatternwith 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 aPatternwith 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
-