@NotThreadSafe public class PSValidationHandlerBreakOnFirstFailedAssert extends AbstractPSPartialValidationHandler
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.
|
onEnd, onPattern, onRule, onStart, onSuccessfulReportpublic PSValidationHandlerBreakOnFirstFailedAssert()
@Nonnull public com.helger.commons.state.EContinue onFailedAssert(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext)
IPSValidationHandleronFailedAssert in interface IPSValidationHandleronFailedAssert in class PSValidationHandlerDefaultaAssertReport - 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 class AbstractPSPartialValidationHandlerEValidity.VALID if no failed
assertion and no successful report occurred,
EValidity.INVALID otherwise.Copyright © 2014–2016 Philip Helger. All rights reserved.