|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.pandoragames.far.ui.SimpleFileNamePattern
public abstract class SimpleFileNamePattern
Utility for simplified regular expresions. At several places, especially for the selection of file names, the application will accept a simple pattern as alternative to an ordinary regular expression. A simple pattern is a simpliefied regular expression syntax, typically allowing * as a wild card for "any number of characters" (in contrast to .* in proper regular expressions).
The default implementation for a simple pattern is
SimpleFileNamePatternFAR,
but an alternative
SimpleFileNamePatternFAR
is provided and others could be added. See the respective implementations for
details of the pattern syntax.
| Field Summary | |
|---|---|
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. |
| Constructor Summary | |
|---|---|
protected |
SimpleFileNamePattern()
Protected constructor for inheriting classes. |
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Set<java.lang.Character> forbiddenCharacters
protected java.util.Set<java.lang.Character> toBeEscaped
protected org.apache.commons.logging.Log logger
| Constructor Detail |
|---|
protected SimpleFileNamePattern()
| Method Detail |
|---|
public static SimpleFileNamePattern getInstance()
SimpleFileNamePatternFAR.
This behaviour 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 considdered
PatternException - if the simple pattern is not validpublic boolean validateFileNamePattern(FileNamePattern pattern)
pattern - to be validated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||