public interface IPSValidationHandler extends Serializable
IPSBoundSchema.validate(Node,String,
IPSValidationHandler)| Modifier and Type | Method and Description |
|---|---|
default IPSValidationHandler |
and(IPSValidationHandler rhs)
Create a new validation handler that first invokes all methods from this
handler, and than later on from the passed validation handler.
|
static IPSValidationHandler |
and(IPSValidationHandler lhs,
IPSValidationHandler rhs)
Create a new validation handler that first invokes all methods from the
first handler and second from the second handler.
|
default void |
onEnd(PSSchema aSchema,
PSPhase aActivePhase)
This is the last method called.
|
default com.helger.commons.state.EContinue |
onFailedAssert(PSAssertReport aAssertReport,
String sTestExpression,
Node aRuleMatchingNode,
int nNodeIndex,
Object aContext)
This method is called for every failed assert.
|
default void |
onFiredRule(PSRule aRule,
String sContext,
int nNodeIndex,
int nNodeCount)
This method is called for every rule inside the current pattern.
|
default void |
onPattern(PSPattern aPattern)
This method is called for every pattern inside the schema.
|
default void |
onRuleStart(PSRule aRule,
NodeList aContextList)
Called once for each rule, even if the context list is empty.
|
default void |
onStart(PSSchema aSchema,
PSPhase aActivePhase,
String sBaseURI)
This is the first method called.
|
default com.helger.commons.state.EContinue |
onSuccessfulReport(PSAssertReport aAssertReport,
String sTestExpression,
Node aRuleMatchingNode,
int nNodeIndex,
Object aContext)
This method is called for every failed assert.
|
default void onStart(@Nonnull PSSchema aSchema, @Nullable PSPhase aActivePhase, @Nullable String sBaseURI) throws SchematronValidationException
aSchema - The Schematron to be validated. Never null.aActivePhase - The selected phase, if any special phase was selected. May be
null.sBaseURI - The Base URI of the XML to be validated. May be null.SchematronValidationException - In case of validation errorsonEnd(PSSchema, PSPhase)default void onPattern(@Nonnull PSPattern aPattern) throws SchematronValidationException
aPattern - The current pattern. Never null.SchematronValidationException - In case of validation errorsdefault void onRuleStart(@Nonnull PSRule aRule, @Nonnull NodeList aContextList) throws SchematronValidationException
aRule - The rule that is to be executed.aContextList - The list of context nodes. Never null but maybe empty.SchematronValidationException - In case of errorsdefault void onFiredRule(@Nonnull PSRule aRule, @Nonnull String sContext, @Nonnegative int nNodeIndex, @Nonnegative int nNodeCount) throws SchematronValidationException
aRule - The current rule. Never null.sContext - The real context to be used in validation. May differ from the
result of PSRule.getContext() because of replaced variables
from <let> elements.nNodeIndex - 0-based node index currently firednNodeCount - The total number of nodes for this rule. Always > 0.SchematronValidationException - In case of validation errors@Nonnull default com.helger.commons.state.EContinue onFailedAssert(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext) throws SchematronValidationException
aAssertReport - The current assert element. Never null.sTestExpression - The source XPath expression that was evaluated for this node. It may
be different from the test expression contained in the passed
assert/report element because of replaced <let> elements.
Never null.aRuleMatchingNode - The XML node of the document to be validated.nNodeIndex - The index of the matched node, relative to the current rule.aContext - A context object - implementation dependent. For the default query
binding this is e.g. an
PSXPathBoundAssertReport
object.EContinue.BREAK to stop validating immediately.SchematronValidationException - In case of validation errors@Nonnull default com.helger.commons.state.EContinue onSuccessfulReport(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext) throws SchematronValidationException
aAssertReport - The current assert element. Never null.sTestExpression - The source XPath expression that was evaluated for this node. It may
be different from the test expression contained in the passed
assert/report element because of replaced <let> elements.
Never null.aRuleMatchingNode - The XML node of the document to be validated.nNodeIndex - The index of the matched node, relative to the current rule.aContext - A context object - implementation dependent. For the default query
binding this is e.g. an
PSXPathBoundAssertReport
object.EContinue.BREAK to stop validating immediately.SchematronValidationException - In case of validation errorsdefault void onEnd(@Nonnull PSSchema aSchema, @Nullable PSPhase aActivePhase) throws SchematronValidationException
aSchema - The Schematron that was be validated. Never null.aActivePhase - The selected phase, if any special phase was selected. May be
null.SchematronValidationException - In case of validation errorsonStart(PSSchema, PSPhase, String)@Nonnull default IPSValidationHandler and(@Nullable IPSValidationHandler rhs)
rhs - The validation handler to be invoked after this one. May be
null.@Nonnull static IPSValidationHandler and(@Nullable IPSValidationHandler lhs, @Nullable IPSValidationHandler rhs)
lhs - The first validation handler to be invoked. May be
null.rhs - The second validation handler to be invoked. May be
null.null if both are null.Copyright © 2014–2020 Philip Helger. All rights reserved.