org.entityfs.util.filter.regexp
Class GlobSupport

java.lang.Object
  extended by org.entityfs.util.filter.regexp.GlobSupport

public final class GlobSupport
extends Object

Utility class for converting between a glob pattern and a Java regexp Pattern. This uses the same approach as the Jakarta ORO GlobCompiler .

EntityFS version 1.1 introduces the Glob class which works more like Java's Pattern class.

Since:
1.0
Author:
Karl Gustafsson
See Also:
Glob
In_jar:
entityfs-util

Method Summary
static Pattern getPattern(String glob)
          Get a Java regexp Pattern from a glob pattern.
static Pattern getPattern(String glob, int flags)
          Get a Java regexp Pattern from a glob pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPattern

public static Pattern getPattern(String glob)
                          throws PatternSyntaxException
Get a Java regexp Pattern from a glob pattern.

Parameters:
glob - The glob pattern
Returns:
A Java regexp pattern.
Throws:
PatternSyntaxException - On syntax errors (and perhaps internal bugs...)
See Also:
Glob.getPattern(), Glob.Glob(String)

getPattern

public static Pattern getPattern(String glob,
                                 int flags)
                          throws PatternSyntaxException
Get a Java regexp Pattern from a glob pattern.

Parameters:
glob - The glob pattern.
flags - Flags for the created Pattern object.
Returns:
A Java regexp pattern
Throws:
PatternSyntaxException - On syntax errors
See Also:
Glob.getPattern(), Glob.Glob(String, int)