public class LoggingPSValidationHandler extends Object implements IPSValidationHandler
IPSValidationHandler| Constructor and Description |
|---|
LoggingPSValidationHandler()
Default constructor.
|
LoggingPSValidationHandler(org.slf4j.Logger aLogger)
Constructor with a custom logger
|
| Modifier and Type | Method and Description |
|---|---|
static String |
getAsString(Node aNode) |
static String |
getAsString(NodeList aNL) |
org.slf4j.Logger |
getLogger() |
com.helger.commons.error.level.IErrorLevel |
getLogLevel() |
String |
getLogPrefix() |
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 |
onFiredRule(PSRule aRule,
String sContext,
int nNodeIndex,
int nNodeCount)
This method is called for every rule inside the current pattern.
|
void |
onPattern(PSPattern aPattern)
This method is called for every pattern inside the schema.
|
void |
onRuleStart(PSRule aRule,
NodeList aContextList)
Called once for each rule, even if the context list is empty.
|
void |
onStart(PSSchema aSchema,
PSPhase aActivePhase,
String sBaseURI)
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.
|
LoggingPSValidationHandler |
setLogLevel(com.helger.commons.error.level.IErrorLevel aLogLevel) |
LoggingPSValidationHandler |
setLogPrefix(String sLogPrefix) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitand, andpublic LoggingPSValidationHandler()
public LoggingPSValidationHandler(@Nonnull org.slf4j.Logger aLogger)
aLogger - The logger to use. May not be null.@Nonnull public final org.slf4j.Logger getLogger()
@Nonnull public final com.helger.commons.error.level.IErrorLevel getLogLevel()
@Nonnull public final LoggingPSValidationHandler setLogLevel(@Nonnull com.helger.commons.error.level.IErrorLevel aLogLevel)
@Nonnull public final LoggingPSValidationHandler setLogPrefix(@Nullable String sLogPrefix)
public void onStart(@Nonnull PSSchema aSchema, @Nullable PSPhase aActivePhase, @Nullable String sBaseURI) throws SchematronValidationException
IPSValidationHandleronStart in interface IPSValidationHandleraSchema - 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 errorsIPSValidationHandler.onEnd(PSSchema, PSPhase)public void onPattern(@Nonnull PSPattern aPattern) throws SchematronValidationException
IPSValidationHandleronPattern in interface IPSValidationHandleraPattern - The current pattern. Never null.SchematronValidationException - In case of validation errorspublic void onRuleStart(@Nonnull PSRule aRule, @Nonnull NodeList aContextList) throws SchematronValidationException
IPSValidationHandleronRuleStart in interface IPSValidationHandleraRule - The rule that is to be executed.aContextList - The list of context nodes. Never null but maybe empty.SchematronValidationException - In case of errorspublic void onFiredRule(@Nonnull PSRule aRule, @Nonnull String sContext, @Nonnegative int nNodeIndex, @Nonnegative int nNodeCount) throws SchematronValidationException
IPSValidationHandleronFiredRule in interface IPSValidationHandleraRule - 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 public com.helger.commons.state.EContinue onFailedAssert(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext) throws SchematronValidationException
IPSValidationHandleronFailedAssert in interface IPSValidationHandleraAssertReport - 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
IPSValidationHandleronSuccessfulReport in interface IPSValidationHandleraAssertReport - 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
IPSValidationHandleronEnd in interface IPSValidationHandleraSchema - 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, String)Copyright © 2014–2020 Philip Helger. All rights reserved.