Class PSValidationHandlerBreakOnFirstFailedAssert
java.lang.Object
com.helger.schematron.pure.validation.PSValidationHandlerBreakOnFirstFailedAssert
- All Implemented Interfaces:
IPSPartialValidationHandler,IPSValidationHandler
@NotThreadSafe
public class PSValidationHandlerBreakOnFirstFailedAssert
extends Object
implements IPSPartialValidationHandler
A simple implementation if
IPSValidationHandler that stops validation
upon the first failed assertion. The final validation result can be retrieved
by invoking getValidity().- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.helger.commons.state.EValiditycom.helger.commons.state.EContinueonFailedAssert(PSAssertReport aAssertReport, String sTestExpression, Node aRuleMatchingNode, int nNodeIndex, Object aContext) This method is called for every failed assert.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.schematron.pure.validation.IPSValidationHandler
and, onEnd, onFiredRule, onPattern, onRuleStart, onStart, onSuccessfulReport
-
Constructor Details
-
PSValidationHandlerBreakOnFirstFailedAssert
public PSValidationHandlerBreakOnFirstFailedAssert()
-
-
Method Details
-
onFailedAssert
@Nonnull public com.helger.commons.state.EContinue onFailedAssert(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext) Description copied from interface:IPSValidationHandlerThis method is called for every failed assert.- Specified by:
onFailedAssertin interfaceIPSValidationHandler- Parameters:
aAssertReport- The current assert element. Nevernull.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. Nevernull.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. anPSXPathBoundAssertReportobject.- Returns:
EContinue.BREAKto stop validating immediately.
-
getValidity
- Specified by:
getValidityin interfaceIPSPartialValidationHandler- Returns:
- The validity of the XML file.
EValidity.VALIDif no failed assertion and no successful report occurred,EValidity.INVALIDotherwise.
-
toString
-