viper.filters
Interface Filterable

All Known Implementing Classes:
Attribute, FrameSpan

public interface Filterable

This interface is used to allow the FILTER to work on Attributes and the FrameSpan.


Nested Class Summary
static interface Filterable.Rule
          This object tests a given value against a rule.
 
Method Summary
 Filterable.Rule convertRule(java.lang.String unparsedRule, java.util.List unparsedValues, ErrorWriter err)
          This converts a string into a rule, writing out errors in the format to err.
 boolean isValidRule(java.lang.String ruleName)
          Tell if a name is a valid rule or not
 boolean passes(Filterable.Rule rule)
          Tests to see if the value passes the given rule.
 

Method Detail

convertRule

public Filterable.Rule convertRule(java.lang.String unparsedRule,
                                   java.util.List unparsedValues,
                                   ErrorWriter err)
                            throws BadDataException
This converts a string into a rule, writing out errors in the format to err.

Parameters:
unparsedRule - A string containing a single rule.
unparsedValues - A string containing values.
err - A place to log the errors.
Returns:
A List containing a rule (String) and value (Object) pair.
Throws:
BadDataException

isValidRule

public boolean isValidRule(java.lang.String ruleName)
Tell if a name is a valid rule or not

Parameters:
ruleName - the name of the rule
Returns:
true if the rule is valid.

passes

public boolean passes(Filterable.Rule rule)
Tests to see if the value passes the given rule.

Parameters:
rule - the rule to check this value against
Returns:
if this value is good according to the given rule