|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.filter.base.PatternFilterRule
public class PatternFilterRule
This is an implementation of the FilterRule interface that matches
using a regex Pattern.
| Field Summary | |
|---|---|
private Pattern |
pattern
|
private Boolean |
result
|
| Constructor Summary | |
|---|---|
PatternFilterRule()
The non-arg constructor. |
|
PatternFilterRule(Pattern pattern,
boolean resultOnMatch)
The constructor. |
|
PatternFilterRule(String pattern,
boolean resultOnMatch)
The constructor. |
|
| Method Summary | |
|---|---|
Boolean |
accept(String string)
This method checks if the given string is accepted, denied or
ignored by this rule. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Pattern pattern
accept(String)private Boolean result
accept(String)| Constructor Detail |
|---|
public PatternFilterRule()
public PatternFilterRule(String pattern,
boolean resultOnMatch)
pattern - is the pattern a file has to match in order to activate this
rule. Before this given string is compiled via
Pattern.compile(String) the following manipulation is
performed: If the pattern string does NOT start with the character
^ the implicit prefix .* is added. If the
pattern does NOT end with the character $ the implicit
suffix .* is appended.resultOnMatch - is the result returned if the
pattern matches.
public PatternFilterRule(Pattern pattern,
boolean resultOnMatch)
pattern - is the pattern a file has to match in order to activate this
rule.resultOnMatch - is the result returned if the
pattern matches.| Method Detail |
|---|
public Boolean accept(String string)
string is accepted, denied or
ignored by this rule.
accept in interface FilterRule<String>string - is the string to check.
true if the file should be accepted,
false if the file should NOT be accepted or
null if this rule does NOT make a decision about the
given string.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||