|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.entityfs.support.util.regexp.Glob
public class Glob
This class corresponds to Java's Pattern
class for glob patterns.
A glob pattern is a pattern for matching strings that can use wildcards such
as *
and ?
. Most programmers have encountered glob
patterns when working with files and directories in an operating system
shell. Read more about glob patterns in the Wikipedia article
on Glob.
Glob objects are immutable.
Internally, the glob pattern is translated to a Pattern
object.
Constructor Summary | |
---|---|
Glob(String glob)
Create a new glob pattern object. |
|
Glob(String glob,
int flags)
Create a new glob pattern object using custom pattern compilation flags. |
Method Summary | |
---|---|
static Glob |
compile(String glob)
This is an alternative way of creating Glob objects that uses the
same approach as the Pattern object. |
static Glob |
compile(String glob,
int flags)
This is an alternative way of creating Glob objects using custom
pattern compilation flags. |
int |
flags()
Get the pattern compilation flags that were used when compiling this glob pattern. |
Pattern |
getPattern()
Get the Pattern object that corresponds to this glob pattern. |
Matcher |
matcher(CharSequence input)
Get a Matcher for matching text in the supplied input. |
static boolean |
matches(String glob,
String input)
Convenience method for matching a glob pattern against the supplied input. |
String |
pattern()
Get the glob pattern that was used to create this object. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Glob(String glob) throws PatternSyntaxException
glob
- The glob pattern.
PatternSyntaxException
- On syntax errors in the supplied glob
pattern.Glob(String, int)
,
compile(String)
public Glob(String glob, int flags) throws PatternSyntaxException
Pattern
object.
glob
- The glob pattern.flags
- Custom pattern compilation flags.
PatternSyntaxException
- On syntax errors in the supplied glob
pattern.Glob(String)
,
compile(String,int)
Method Detail |
---|
public static Glob compile(String glob) throws PatternSyntaxException
Glob
objects that uses the
same approach as the Pattern
object.
glob
- The glob pattern.
Glob
object.
PatternSyntaxException
- On syntax errors in the supplied glob
pattern.Glob(String)
,
compile(String, int)
,
Pattern.compile(String)
public static Glob compile(String glob, int flags) throws PatternSyntaxException
Glob
objects using custom
pattern compilation flags. This method uses the same approach as the
Pattern
object.
The compilation flags are the same as those used by the Pattern
object.
glob
- The glob pattern.flags
- Custom pattern compilation flags.
Glob
object.
PatternSyntaxException
- On syntax errors in the supplied glob
pattern.Glob(String, int)
,
compile(String)
,
Pattern.compile(String, int)
public int flags()
Glob(String, int)
,
Pattern.flags()
public Matcher matcher(CharSequence input)
Matcher
for matching text in the supplied input.
input
- The text to match glob expressions in.
Matcher
object.Pattern.matcher(CharSequence)
public static boolean matches(String glob, String input) throws PatternSyntaxException
glob
- The glob pattern.input
- The string to match.
true
if the input
string matches the glob
pattern.
PatternSyntaxException
- On syntax errors in the supplied glob
pattern.Pattern.matches(String, CharSequence)
public String pattern()
public Pattern getPattern()
Pattern
object that corresponds to this glob pattern.
Pattern
object.public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |