public abstract class SimpleFileNamePattern
extends java.lang.Object
The default implementation for a simple pattern is
SimpleFileNamePatternFAR,
but an alternative
SimpleFileNamePatternShell
is provided and others could be added. See the respective implementations for
details of the pattern syntax.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<java.lang.Character> |
forbiddenCharacters
Set of characters that should not be tolerated in a simple pattern.
|
protected org.apache.commons.logging.Log |
logger
Never leave without a logger.
|
protected java.util.Set<java.lang.Character> |
toBeEscaped
Set of characters that must be escaped when producing a regular expression.
|
| Modifier | Constructor and Description |
|---|---|
protected |
SimpleFileNamePattern()
Protected constructor for inheriting classes.
|
| Modifier and Type | Method and Description |
|---|---|
abstract java.util.regex.Pattern |
createPattern(java.lang.String simplePattern,
boolean ignoreCase)
Create a
java.util.regex.Pattern from a simple string pattern. |
static SimpleFileNamePattern |
getInstance()
Returns an instance of this utility class.
|
protected static void |
setInstance(SimpleFileNamePattern instance)
Sets a new implementation of this class as to be returned by the
getInstance() method. |
boolean |
validateFileNamePattern(FileNamePattern pattern)
Validates the specified FileNamePattern for syntactically correctness.
|
protected java.util.Set<java.lang.Character> forbiddenCharacters
protected java.util.Set<java.lang.Character> toBeEscaped
protected org.apache.commons.logging.Log logger
protected SimpleFileNamePattern()
public static SimpleFileNamePattern getInstance()
SimpleFileNamePatternFAR.
This behavior can be changed by calling the setInstance() method.protected static void setInstance(SimpleFileNamePattern instance)
getInstance() method. Null values will be ignored.instance - new default instance for getInstance() method.public abstract java.util.regex.Pattern createPattern(java.lang.String simplePattern,
boolean ignoreCase)
throws PatternException
java.util.regex.Pattern from a simple string pattern.
The syntax of the simple pattern is implementation dependend.simplePattern - see class descriptionignoreCase - should letter case be consideredPatternException - if the simple pattern is not validpublic boolean validateFileNamePattern(FileNamePattern pattern)
pattern - to be validated