@NotThreadSafe public class PSValidationHandlerBreakOnFirstFailedAssert extends Object implements IPSPartialValidationHandler
IPSValidationHandler
that stops validation
upon the first failed assertion. The final validation result can be retrieved
by invoking getValidity()
.Constructor and Description |
---|
PSValidationHandlerBreakOnFirstFailedAssert() |
Modifier and Type | Method and Description |
---|---|
com.helger.commons.state.EValidity |
getValidity() |
com.helger.commons.state.EContinue |
onFailedAssert(PSAssertReport aAssertReport,
String sTestExpression,
Node aRuleMatchingNode,
int nNodeIndex,
Object aContext)
This method is called for every failed assert.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onEnd, onPattern, onRule, onStart, onSuccessfulReport
public PSValidationHandlerBreakOnFirstFailedAssert()
@Nonnull public com.helger.commons.state.EContinue onFailedAssert(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext)
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.@Nonnull public com.helger.commons.state.EValidity getValidity()
getValidity
in interface IPSPartialValidationHandler
EValidity.VALID
if no failed
assertion and no successful report occurred,
EValidity.INVALID
otherwise.Copyright © 2014–2019 Philip Helger. All rights reserved.