|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.filter.base.FilterRuleChain<V>
V - is the generic type of the value to check.public class FilterRuleChain<V>
This class implements a Filter that is based on a chain of
FilterRules.
| Field Summary | |
|---|---|
private boolean |
defaultResult
|
private String |
id
|
private FilterRuleChain<V> |
parent
The parent that is extended by this chain or null. |
private FilterRule<V>[] |
rules
the rules |
| Constructor Summary | |
|---|---|
FilterRuleChain()
The non-arg constructor. |
|
FilterRuleChain(boolean defaultResult,
FilterRule<V>... rules)
The constructor. |
|
FilterRuleChain(String id,
FilterRuleChain<V> parent,
boolean defaultResult,
FilterRule<V>... rules)
The constructor. |
|
| Method Summary | |
|---|---|
boolean |
accept(V value)
This method determines if the given value should be accepted. |
private Boolean |
acceptRecursive(V value)
This method implements accept(Object) recursively. |
FilterRuleChain<V> |
extend(boolean newDefaultResult,
FilterRule<V>... additionalRules)
This method extends this chain with additionalRules. |
boolean |
getDefaultResult()
This method gets the default result used if none of
the rules matched. |
String |
getId()
This method gets the ID used to identify this chain. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private String id
getId()private FilterRuleChain<V> parent
null.
private FilterRule<V>[] rules
private boolean defaultResult
getDefaultResult()| Constructor Detail |
|---|
public FilterRuleChain()
public FilterRuleChain(boolean defaultResult,
FilterRule<V>... rules)
rules - is the chain of rules.defaultResult - is the result if none of the
rules match.
public FilterRuleChain(String id,
FilterRuleChain<V> parent,
boolean defaultResult,
FilterRule<V>... rules)
id - is the ID.parent - is the parent-chain to extend or
null for a root-chain.rules - is the chain of rules.defaultResult - is the result if none of the
rules match.| Method Detail |
|---|
public boolean getDefaultResult()
result used if none of
the rules matched.
public boolean accept(V value)
value should be accepted.
This method checks all rules in the chain and returns the result of the
first matching rule. If no rule matches,
getDefaultResult() is returned.
accept in interface Filter<V>value - is the value to check.
true if the given value is acceptable,
false if it should be filtered.private Boolean acceptRecursive(V value)
accept(Object) recursively.
value - is the value to filter.
true if the value is accepted, false if
the value is NOT accepted, or null if no decision is
made.
public FilterRuleChain<V> extend(boolean newDefaultResult,
FilterRule<V>... additionalRules)
additionalRules.
newDefaultResult - is the result of the new extended chain if none of
the rules match.additionalRules - are the rules to add.
additionalRules if none
of this rules match.public String getId()
null if undefined.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||