org.makumba.providers.datadefinition.mdd.validation
Class ComparisonValidationRule

java.lang.Object
  extended by antlr.BaseAST
      extended by antlr.CommonAST
          extended by org.makumba.providers.datadefinition.mdd.MDDAST
              extended by org.makumba.providers.datadefinition.mdd.ValidationRuleNode
                  extended by org.makumba.providers.datadefinition.mdd.validation.ComparisonValidationRule
All Implemented Interfaces:
antlr.collections.AST, Serializable, Comparable<ValidationRule>, ValidationRule

public class ComparisonValidationRule
extends ValidationRuleNode

FIXME the whole Lhs/Rhs thing is a very clumsy implementation.

Version:
$Id: ComparisonValidationRule.java,v 1.1 Jul 10, 2009 2:25:21 PM manu Exp $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.makumba.providers.datadefinition.mdd.ValidationRuleNode
arguments, comparisonExpression, expression, field, lowerBound, mdd, message, name, type, upperBound
 
Fields inherited from class org.makumba.providers.datadefinition.mdd.MDDAST
makumbaType, wasIncluded
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
ComparisonValidationRule(MDDNode mdd, antlr.collections.AST originAST, ValidationType type, FieldNode parentField)
           
 
Method Summary
 String getRuleName()
          Gets the name of this rule.
protected  boolean throwException(boolean b)
           
 boolean validate(Object value, Transaction t)
          should be overridden in extended classes
 
Methods inherited from class org.makumba.providers.datadefinition.mdd.ValidationRuleNode
checkApplicability, compareTo, getComparisonExpression, getDataDefinition, getErrorMessage, getExpression, getFieldDefinition, getLowerBound, getUpperBound, getValidationRuleArguments, getValidationRuleArgumentType, getValidationType, throwException, toString
 
Methods inherited from class org.makumba.providers.datadefinition.mdd.MDDAST
getColumn, getLine, initialize, initialize, setCol, setLine
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, setText, setType
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComparisonValidationRule

public ComparisonValidationRule(MDDNode mdd,
                                antlr.collections.AST originAST,
                                ValidationType type,
                                FieldNode parentField)
Method Detail

getRuleName

public String getRuleName()
Description copied from interface: ValidationRule
Gets the name of this rule.

Specified by:
getRuleName in interface ValidationRule
Overrides:
getRuleName in class ValidationRuleNode

validate

public boolean validate(Object value,
                        Transaction t)
                 throws InvalidValueException
Description copied from class: ValidationRuleNode
should be overridden in extended classes

Specified by:
validate in interface ValidationRule
Overrides:
validate in class ValidationRuleNode
t - TODO
Throws:
InvalidValueException - if the validation fails

throwException

protected boolean throwException(boolean b)
                          throws InvalidValueException
Throws:
InvalidValueException