net.pandoragames.far.ui
Class SimpleFileNamePatternFAR

java.lang.Object
  extended by net.pandoragames.far.ui.SimpleFileNamePattern
      extended by net.pandoragames.far.ui.SimpleFileNamePatternFAR

public class SimpleFileNamePatternFAR
extends SimpleFileNamePattern

Default implementation of the SimpleFileNamePattern class imposing the following rules:

The simple pattern may contain any character greater #31, except the characters '/','\',':' and ';'. In addition, the platform file separator (/ on *X, \ on Windows) and the platform file-name separator (: on *X, ; on Windows) are not permitted.

The characters '*', '?', '!', '#' and ',' have special meaning. The asterisk '*' represents any number of characters (including zero), '?' represents any single character or none, '!' represents exactly one character, '#' exactly one digit (0-9) and ',' serves as pattern seperator (a logical OR).

If a simple pattern starts with a dot '.', this is considdered equivalent to '*.'. White space at both ends of a simple pattern is of corse discarded.

Author:
Olivier Wehner

Field Summary
 
Fields inherited from class net.pandoragames.far.ui.SimpleFileNamePattern
forbiddenCharacters, logger, toBeEscaped
 
Method Summary
 java.util.regex.Pattern createPattern(java.lang.String simplePattern, boolean ignoreCase)
          Create a java.util.regex.Pattern from a simple string pattern.
static void setDefault()
          Sets this class as the default returned by SimpleFileNamePattern.getInstance().
 
Methods inherited from class net.pandoragames.far.ui.SimpleFileNamePattern
getInstance, setInstance, validateFileNamePattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDefault

public static void setDefault()
Sets this class as the default returned by SimpleFileNamePattern.getInstance().


createPattern

public java.util.regex.Pattern createPattern(java.lang.String simplePattern,
                                             boolean ignoreCase)
                                      throws PatternException
Create a java.util.regex.Pattern from a simple string pattern. See class description for details on the syntax of the simple pattern.

Specified by:
createPattern in class SimpleFileNamePattern
Parameters:
simplePattern - see class description
ignoreCase - should letter case be considdered
Returns:
Pattern object for specified simple pattern string
Throws:
PatternException - if the simple pattern is not valid