|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object viper.filters.Rules
This class is simply a bunch of factory classes for standard rule types.
Constructor Summary | |
Rules()
|
Method Summary | |
static Filterable.Rule |
getComparisonRelation(java.lang.Object o,
java.lang.String relation)
Gets a relation operation. |
static Filterable.Rule |
getComplexRule(Filterable f,
java.lang.String complexRule,
ErrorWriter err)
Parses a rule of the form rule "value"
(|| / &&) ... |
static Filterable.Rule |
getEquality(java.lang.Object o)
Gets a rule that tests for equality with the target object. |
static Filterable.Rule |
getFalse()
Gets a rule that always returns false. |
static Filterable.Rule |
getInequality(java.lang.Object o)
Tests to see if two objects are not equal. |
static Filterable.Rule |
getTrue()
Gets a rule that always returns true. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Rules()
Method Detail |
public static Filterable.Rule getFalse()
public static Filterable.Rule getTrue()
public static Filterable.Rule getEquality(java.lang.Object o)
o
- The object to test against.
public static Filterable.Rule getInequality(java.lang.Object o)
o
- the object to test against.
true
iff o != the tested object.public static Filterable.Rule getComparisonRelation(java.lang.Object o, java.lang.String relation) throws BadDataException
==
or
!=
, it uses the equals
method of the
object; otherwise, it casts the object to
java.lang.Comparable
.
o
- The object to compare.relation
- String representing the relation, eg "<" or ">="
BadDataException
public static Filterable.Rule getComplexRule(Filterable f, java.lang.String complexRule, ErrorWriter err) throws java.lang.IllegalArgumentException
rule "value"
(|| / &&) ...
f
- the rule typecomplexRule
- the string describing the ruleerr
- the error stream
java.lang.IllegalArgumentException
- if the first rule was not valid. If a later rule is in error,
it prints an error to the error writer and returns the valid
rule so far. To get an exception on all errors, set err to
null
. Note that in this case, warnings (lack
of quotes) will be ignored.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |