|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.oro.io.RegexFilenameFilter
RegexFilenameFilter is the base class for a set of FilenameFilter
implementations that filter based on a regular expression. It
is also a generic filter implementation that can use any regular
expression engine represented by a PatternMatchingEngine.
Perl5FilenameFilter,
AwkFilenameFilter,
GlobFilenameFilter| Constructor Summary | |
protected |
RegexFilenameFilter(PatternCache cache,
PatternMatcher matcher)
|
protected |
RegexFilenameFilter(PatternCache cache,
PatternMatcher matcher,
java.lang.String regex)
|
protected |
RegexFilenameFilter(PatternCache cache,
PatternMatcher matcher,
java.lang.String regex,
int options)
|
|
RegexFilenameFilter(PatternMatchingEngine engine)
Creates a new RegexFilenameFilter using the supplied PatternMatchingEngine. |
|
RegexFilenameFilter(java.lang.String engineKey)
Creates a new RegexFilenameFilter using the supplied engine key to create a PatternMatchingEngine using
the PatternMatchingEngineFactory class. |
| Method Summary | |
boolean |
accept(java.io.File pathname)
Filters a filename. |
boolean |
accept(java.io.File dir,
java.lang.String filename)
Filters a filename. |
void |
setFilterExpression(java.lang.String regex)
Set the regular expression on which to filter. |
void |
setFilterExpression(java.lang.String regex,
int options)
Set the regular expression on which to filter along with any special options to use when compiling the expression. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected RegexFilenameFilter(PatternCache cache,
PatternMatcher matcher,
java.lang.String regex)
protected RegexFilenameFilter(PatternCache cache,
PatternMatcher matcher,
java.lang.String regex,
int options)
protected RegexFilenameFilter(PatternCache cache,
PatternMatcher matcher)
public RegexFilenameFilter(PatternMatchingEngine engine)
PatternMatchingEngine.
engine - The PatternMatchingEngine to use for pattern
matching.
public RegexFilenameFilter(java.lang.String engineKey)
throws java.lang.IllegalArgumentException
PatternMatchingEngine using
the PatternMatchingEngineFactory class.
engineKey - One of the PatternMatchingEngineFactory engine
keys.
java.lang.IllegalArgumentException| Method Detail |
public void setFilterExpression(java.lang.String regex)
throws MalformedCachePatternException
regex - The regular expression on which to filter.
MalformedCachePatternException - If there is an error in
compiling the regular expression. This need not be caught if
you are using a hard-coded expression that you know is correct.
But for robustness and reliability you should catch this exception
for dynamically entered expressions determined at runtime.
public void setFilterExpression(java.lang.String regex,
int options)
throws MalformedCachePatternException
regex - The regular expression on which to filter.options - A set of compilation options specific to the regular
expression grammar being used.
MalformedCachePatternException - If there is an error in
compiling the regular expression. This need not be caught if
you are using a hard-coded expression that you know is correct.
But for robustness and reliability you should catch this exception
for dynamically entered expressions determined at runtime.
public boolean accept(java.io.File dir,
java.lang.String filename)
accept in interface java.io.FilenameFilterdir - The directory containing the file.filename - The name of the file.
public boolean accept(java.io.File pathname)
accept in interface java.io.FileFilterpathname - The file pathname.
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||