org.jwall.web.audit.rules.operators
Class AbstractCondition

java.lang.Object
  extended by org.jwall.web.audit.rules.operators.AbstractCondition
All Implemented Interfaces:
Serializable, Condition
Direct Known Subclasses:
BeginsWith, ConditionEQ, ConditionGE, ConditionGT, ConditionLE, ConditionLT, ConditionPM, ConditionRX, ConditionSX, Contains, EndsWith

public abstract class AbstractCondition
extends Object
implements Condition

The abstract stuff of a condition instance.

Author:
Christian Bockermann <chris@jwall.org>
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jwall.web.audit.rules.Condition
EQ, GE, GT, IN, LE, LT, PM, RX, SX
 
Constructor Summary
AbstractCondition(String variable, String value)
           
 
Method Summary
static Condition createCondition(Operator oper, String variable, String value)
           
 List<String> extractValues(AuditEvent evt)
           
abstract  String getOperator()
          This returns a textual representation of the operator of this condition.
 String getPureValue()
           
 String getValue()
          This method returns the value used by this condition to match the value of the variable against.
 String getVariable()
          Returns the variable on which this condition acts.
 boolean isNegated()
           
static boolean isNumeric(String s)
           
 boolean matches(AuditEvent evt)
          Deprecated.  
 boolean matches(List<String> values)
           
 boolean matches(String val)
           
 void setValue(String value)
           
 void setVariable(String variable)
          Sets the variable on which this condition needs to match.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jwall.web.audit.rules.Condition
matches
 

Constructor Detail

AbstractCondition

public AbstractCondition(String variable,
                         String value)
                  throws SyntaxException
Throws:
SyntaxException
Method Detail

extractValues

public List<String> extractValues(AuditEvent evt)
See Also:
org.jwall.web.audit.rules.Condition#extractValues(org.jwall.web.audit.AuditEvent)

matches

public final boolean matches(AuditEvent evt)
Deprecated. 

Description copied from interface: Condition
This method executes the condition against the given event. This is basically the core-functionality of this instance.

Specified by:
matches in interface Condition
Returns:

matches

public final boolean matches(List<String> values)

matches

public final boolean matches(String val)

getVariable

public String getVariable()
Description copied from interface: Condition
Returns the variable on which this condition acts.

Specified by:
getVariable in interface Condition
Returns:
the variable

setVariable

public void setVariable(String variable)
Description copied from interface: Condition
Sets the variable on which this condition needs to match.

Specified by:
setVariable in interface Condition
Parameters:
variable - the variable to set

getValue

public String getValue()
Description copied from interface: Condition
This method returns the value used by this condition to match the value of the variable against.

Specified by:
getValue in interface Condition
Returns:
the value

setValue

public void setValue(String value)
Parameters:
value - the value to set

toString

public String toString()
Overrides:
toString in class Object

getPureValue

public final String getPureValue()

isNegated

public final boolean isNegated()

isNumeric

public static boolean isNumeric(String s)

getOperator

public abstract String getOperator()
Description copied from interface: Condition
This returns a textual representation of the operator of this condition.

Specified by:
getOperator in interface Condition
Returns:

createCondition

public static Condition createCondition(Operator oper,
                                        String variable,
                                        String value)
                                 throws SyntaxException
Throws:
SyntaxException


Copyright © 2012 jwall.org. All Rights Reserved.