@NotThreadSafe public class PSValidationHandlerDefault extends Object implements IPSValidationHandler
IPSValidationHandler
. This class
may serve as the basis for your implementations.Constructor and Description |
---|
PSValidationHandlerDefault() |
Modifier and Type | Method and Description |
---|---|
void |
onEnd(PSSchema aSchema,
PSPhase aActivePhase)
This is the last method called.
|
com.helger.commons.state.EContinue |
onFailedAssert(PSAssertReport aAssertReport,
String sTestExpression,
Node aRuleMatchingNode,
int nNodeIndex,
Object aContext)
This method is called for every failed assert.
|
void |
onPattern(PSPattern aPattern)
This method is called for every pattern inside the schema.
|
void |
onRule(PSRule aRule,
String sContext)
This method is called for every rule inside the current pattern.
|
void |
onStart(PSSchema aSchema,
PSPhase aActivePhase)
This is the first method called.
|
com.helger.commons.state.EContinue |
onSuccessfulReport(PSAssertReport aAssertReport,
String sTestExpression,
Node aRuleMatchingNode,
int nNodeIndex,
Object aContext)
This method is called for every failed assert.
|
public void onStart(@Nonnull PSSchema aSchema, @Nullable PSPhase aActivePhase) throws SchematronValidationException
IPSValidationHandler
onStart
in interface IPSValidationHandler
aSchema
- The Schematron to be validated. Never null
.aActivePhase
- The selected phase, if any special phase was selected. May be
null
.SchematronValidationException
- In case of validation errorsIPSValidationHandler.onEnd(PSSchema, PSPhase)
public void onPattern(@Nonnull PSPattern aPattern) throws SchematronValidationException
IPSValidationHandler
onPattern
in interface IPSValidationHandler
aPattern
- The current pattern. Never null
.SchematronValidationException
- In case of validation errorspublic void onRule(@Nonnull PSRule aRule, @Nonnull String sContext) throws SchematronValidationException
IPSValidationHandler
onRule
in interface IPSValidationHandler
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.SchematronValidationException
- In case of validation errors@Nonnull public com.helger.commons.state.EContinue onFailedAssert(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext) throws SchematronValidationException
IPSValidationHandler
onFailedAssert
in interface IPSValidationHandler
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 public com.helger.commons.state.EContinue onSuccessfulReport(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext) throws SchematronValidationException
IPSValidationHandler
onSuccessfulReport
in interface IPSValidationHandler
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 errorspublic void onEnd(@Nonnull PSSchema aSchema, @Nullable PSPhase aActivePhase) throws SchematronValidationException
IPSValidationHandler
onEnd
in interface IPSValidationHandler
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 errorsIPSValidationHandler.onStart(PSSchema, PSPhase)
Copyright © 2014–2016 Philip Helger. All rights reserved.