|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectantlr.BaseAST
antlr.CommonAST
org.makumba.providers.datadefinition.mdd.MDDAST
org.makumba.providers.datadefinition.mdd.ValidationRuleNode
public class ValidationRuleNode
Field Summary | |
---|---|
protected ArrayList<String> |
arguments
arguments of the comparison rule |
protected ComparisonExpressionNode |
comparisonExpression
comparison expression |
protected String |
expression
regex expression |
protected FieldNode |
field
field node the rule applies to. this is only used for single-field validation rules, as convenience mechanism to check the rule applicability. |
protected String |
lowerBound
range validation limits |
protected MDDNode |
mdd
the parent MDD |
protected String |
message
message |
protected String |
name
name of the rule |
protected ValidationType |
type
type of the rule |
protected String |
upperBound
|
Fields inherited from class org.makumba.providers.datadefinition.mdd.MDDAST |
---|
makumbaType, wasIncluded |
Fields inherited from class antlr.BaseAST |
---|
down, right |
Constructor Summary | |
---|---|
ValidationRuleNode(MDDNode mdd,
antlr.collections.AST originAST)
|
|
ValidationRuleNode(MDDNode mdd,
antlr.collections.AST originAST,
FieldNode field)
|
|
ValidationRuleNode(MDDNode mdd,
antlr.collections.AST originAST,
ValidationType type,
FieldNode parentField)
|
Method Summary | |
---|---|
void |
checkApplicability()
Checks if the type of the rule is compatible with the field types it refers to |
int |
compareTo(ValidationRule o)
We order the rules such that comparison rules come last. |
ComparisonExpressionNode |
getComparisonExpression()
|
DataDefinition |
getDataDefinition()
Gets the DataDefinition this rule applies to |
String |
getErrorMessage()
Gets the error message that should be shown for this rule. |
String |
getExpression()
|
FieldDefinition |
getFieldDefinition()
Gets the FieldDefinition this rule applies to. |
String |
getLowerBound()
|
String |
getRuleName()
Gets the name of this rule. |
String |
getUpperBound()
|
Collection<String> |
getValidationRuleArguments()
Gets the arguments (field names) this rule applies to |
FieldDefinition |
getValidationRuleArgumentType(String fieldName)
|
ValidationType |
getValidationType()
|
protected void |
throwException()
Throw a default exception. |
String |
toString()
|
boolean |
validate(Object value,
Transaction t)
should be overridden in extended classes |
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 |
Field Detail |
---|
protected String name
protected ValidationType type
protected String message
protected transient FieldNode field
protected MDDNode mdd
protected String lowerBound
protected String upperBound
protected ArrayList<String> arguments
protected String expression
protected ComparisonExpressionNode comparisonExpression
Constructor Detail |
---|
public ValidationRuleNode(MDDNode mdd, antlr.collections.AST originAST)
public ValidationRuleNode(MDDNode mdd, antlr.collections.AST originAST, FieldNode field)
public ValidationRuleNode(MDDNode mdd, antlr.collections.AST originAST, ValidationType type, FieldNode parentField)
Method Detail |
---|
public void checkApplicability()
public String getRuleName()
ValidationRule
getRuleName
in interface ValidationRule
public ValidationType getValidationType()
public String getErrorMessage()
ValidationRule
getErrorMessage
in interface ValidationRule
public FieldDefinition getFieldDefinition()
ValidationRule
FieldDefinition
this rule applies to.
getFieldDefinition
in interface ValidationRule
public boolean validate(Object value, Transaction t) throws InvalidValueException
validate
in interface ValidationRule
t
- TODO
InvalidValueException
- if the validation failspublic int compareTo(ValidationRule o)
compareTo
in interface Comparable<ValidationRule>
protected void throwException() throws InvalidValueException
InvalidValueException
public String toString()
toString
in interface antlr.collections.AST
toString
in class antlr.BaseAST
public Collection<String> getValidationRuleArguments()
ValidationRule
getValidationRuleArguments
in interface ValidationRule
public FieldDefinition getValidationRuleArgumentType(String fieldName)
public DataDefinition getDataDefinition()
ValidationRule
DataDefinition
this rule applies to
getDataDefinition
in interface ValidationRule
public String getLowerBound()
public String getUpperBound()
public String getExpression()
public ComparisonExpressionNode getComparisonExpression()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |