|
||||||||||
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.XQueryRule
public class XQueryRule
A validation rule which uses an XQuery expression to resolve a boolean value which determines whether the rule will pass or fail.
In the case of a failure the errorMessage
attribute is passed to the validation mechanism.
Warning: Serialized objects of this class or of a deployed class which is derived from it may not be compatible with future releases of C24 Integreation Objects. The current serialization support is appropriate for short term storage or RMI between applications running the same version of C24 Integreation Objects.
DomainConstraintManager
,
Serialized FormConstructor Summary | |
---|---|
XQueryRule()
Creates a new instance. |
Method Summary | |
---|---|
String |
getErrorMessage()
Returns the error message which is used if the rule fails. |
XQueryStatement |
getQuery()
Returns the XQuery statement which is evaluated to decide if the rule passes or fails. |
StreamSource[] |
resolve(String moduleURI,
String baseURI,
String[] locations)
The implementation tries to resolve the location hint on the classpath only and return a StreamSource. |
void |
setErrorMessage(String errorMessage)
Sets the error message which is used if the rule fails. |
void |
setQuery(XQueryStatement query)
Sets the XQuery statement which is evaluated to decide if the rule passes or fails. |
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 XQueryRule()
Method Detail |
---|
public XQueryStatement getQuery()
public void setQuery(XQueryStatement query)
statement
- The statement.public String getErrorMessage()
public void setErrorMessage(String errorMessage)
errorMessage
- The error message.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 StreamSource[] resolve(String moduleURI, String baseURI, String[] locations) throws net.sf.saxon.trans.XPathException
resolve
in interface net.sf.saxon.query.ModuleURIResolver
moduleURI
- the module URI of the module to be imported; or null when loading a non-library module.baseURI
- The base URI of the module containing the "import module" declaration; null if no base URI is known.locations
- The set of URIs specified in the "at" clause of "import module", which serve as location hints for the module.
net.sf.saxon.trans.XPathException
public String toString()
toString
in class DefaultValidationRule
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |