|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbiz.c24.io.api.data.DefaultValidationRule
biz.c24.io.api.data.ContextualValidationRule
public class ContextualValidationRule
A validator implementation for context specific validation.
This validator allows the model to define at a high level a validation which should be applied to a value contained somewhere inside the complex type to which it is applied.
The actual value to be validated is retrieved by executing an XPath statement. The actual validation is done by a delgate validator
Constructor Summary | |
---|---|
ContextualValidationRule(XPathStatement query,
Validator validator)
Creates a new contextual validator which will use the given XPath to lookup the value to validated against the supplied validator. |
Method Summary | |
---|---|
XPathStatement |
getQuery()
Returns the query to be executed to retrieve the value to be validated. |
Validator |
getValidator()
Returns the validator to which the actual validation is delegated. |
void |
setQuery(XPathStatement query)
Sets the query to be executed to retrieve the value to be validated. |
void |
setValidator(Validator validator)
Sets the validator to which the actual validation is delegated. |
String |
toString()
|
boolean |
validate(Object object,
DataComponent component,
ComplexDataObject context,
ValidationManager manager)
Validate the given object. |
Methods inherited from class biz.c24.io.api.data.DefaultValidationRule |
---|
addDependentPredicateCode, getAnnotation, getContextForPredicateChecking, getDependentPredicateCode, getDependentPredicateCodeCount, getErrorCode, getName, getPredicateCode, getSeverity, removeDependentPredicateCode, setAnnotation, setErrorCode, setName, setPredicateCode, setSeverity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContextualValidationRule(XPathStatement query, Validator validator)
query
- The query to select the value to be validated.validator
- The validator to which the validation call is forwarded.
NullPointerException
- If either argument is null
Method Detail |
---|
public boolean validate(Object object, DataComponent component, ComplexDataObject context, ValidationManager manager) throws ValidationException
Validator
validate
in interface Validator
validate
in class DefaultValidationRule
object
- The object to be validated - commonly a String, Integer, Double, Date etc.component
- The Element
or Attribute
inside context
which defines object
.context
- The parent of object
- could be null
.manager
- The validation manager which is performing this validation.
ValidationException
- If the object is not valid and the validation maanger is operating in exception mode.public XPathStatement getQuery()
public void setQuery(XPathStatement query)
query
- The new value.public Validator getValidator()
public void setValidator(Validator validator)
validator
- The new value.public String toString()
toString
in class DefaultValidationRule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |