Package com.helger.schematron.pure.bound
Class AbstractPSBoundSchema
java.lang.Object
com.helger.schematron.pure.bound.AbstractPSBoundSchema
- All Implemented Interfaces:
IPSBoundSchema
- Direct Known Subclasses:
PSXPathBoundSchema
Base implementation of
IPSBoundSchema with all common elements. It is
independent of the used query binding.- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractPSBoundSchema(IPSQueryBinding aQueryBinding, PSSchema aOrigSchema, String sPhaseID, IPSErrorHandler aCustomErrorHandler, IPSValidationHandler aCustomValidationHandler) -
Method Summary
Modifier and TypeMethodDescriptionprotected IPSPartialValidationHandlerOverride this implementation in a derived class to modify the behavior.protected voiderror(IPSElement aSourceElement, String sMsg) protected voiderror(IPSElement aSourceElement, String sMsg, Throwable t) final com.helger.commons.collection.impl.ICommonsList<PSPattern>final IPSValidationHandlerfinal IPSErrorHandlerfinal com.helger.xml.namespace.MapBasedNamespaceContextfinal PSSchemafinal PSPhasegetPhase()final Stringfinal IPSQueryBindingfinal booleanfinal booleantoString()com.helger.schematron.svrl.jaxb.SchematronOutputTypevalidateComplete(Node aNode, String sBaseURI) Special validation that creates an SVRL document.com.helger.commons.state.EValidityvalidatePartially(Node aNode, String sBaseURI) Special validation that breaks on the first error.protected voidwarn(IPSElement aSourceElement, String sMsg) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.schematron.pure.bound.IPSBoundSchema
getValidationContext, validate
-
Constructor Details
-
AbstractPSBoundSchema
public AbstractPSBoundSchema(@Nonnull IPSQueryBinding aQueryBinding, @Nonnull PSSchema aOrigSchema, @Nullable String sPhaseID, @Nullable IPSErrorHandler aCustomErrorHandler, @Nullable IPSValidationHandler aCustomValidationHandler)
-
-
Method Details
-
getErrorHandler
-
isDefaultErrorHandler
public final boolean isDefaultErrorHandler() -
warn
@OverridingMethodsMustInvokeSuper protected void warn(@Nonnull IPSElement aSourceElement, @Nonnull String sMsg) -
error
@OverridingMethodsMustInvokeSuper protected void error(@Nonnull IPSElement aSourceElement, @Nonnull String sMsg) -
error
@OverridingMethodsMustInvokeSuper protected void error(@Nonnull IPSElement aSourceElement, @Nonnull String sMsg, @Nullable Throwable t) -
getQueryBinding
- Specified by:
getQueryBindingin interfaceIPSBoundSchema- Returns:
- The query binding that was used to create this bound schema.
-
getOriginalSchema
- Specified by:
getOriginalSchemain interfaceIPSBoundSchema- Returns:
- The original schema used to bind. Never
null.
-
getNamespaceContext
- Specified by:
getNamespaceContextin interfaceIPSBoundSchema- Returns:
- The namespace context as defined by the namespaces in the original
schema. Never
null.
-
getPhaseID
- Specified by:
getPhaseIDin interfaceIPSBoundSchema- Returns:
- Get the phase ID used. If none was specified, the schema
defaultPhase is used. If this is not present, than all patterns are
used and ID of the phase is
CSchematron.PHASE_ALL.
-
getPhase
- Specified by:
getPhasein interfaceIPSBoundSchema- Returns:
- The phase object to be evaluated. May be
nullif no specific phase is to be validated!
-
isPhaseSpecified
public final boolean isPhaseSpecified()- Specified by:
isPhaseSpecifiedin interfaceIPSBoundSchema- Returns:
trueif a special phase was specified,falseif not.
-
getAllRelevantPatterns
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsList<PSPattern> getAllRelevantPatterns()- Specified by:
getAllRelevantPatternsin interfaceIPSBoundSchema- Returns:
- A list of all patterns to be validated. If a phase was selected,
only the patterns matching the selected phase are contained. Never
null.
-
getCustomValidationHandler
-
createPartialValidationHandler
Override this implementation in a derived class to modify the behavior.- Returns:
- An implementation of
IPSPartialValidationHandlerto use for partial validation. May not benull.
-
validatePartially
@Nonnull public com.helger.commons.state.EValidity validatePartially(@Nonnull Node aNode, @Nullable String sBaseURI) throws SchematronValidationException Description copied from interface:IPSBoundSchemaSpecial validation that breaks on the first error. This is a specialized call ofIPSBoundSchema.validate(Node, String, IPSValidationHandler).- Specified by:
validatePartiallyin interfaceIPSBoundSchema- Parameters:
aNode- The XML node to be validated. May not benull.sBaseURI- Base URI of the XML to be validated. May benull.- Returns:
EValidity.VALIDif the document is valid,EValidity.INVALIDif it is invalid.- Throws:
SchematronValidationException- In case a validation exception occurs
-
validateComplete
@Nonnull public com.helger.schematron.svrl.jaxb.SchematronOutputType validateComplete(@Nonnull Node aNode, @Nullable String sBaseURI) throws SchematronValidationException Description copied from interface:IPSBoundSchemaSpecial validation that creates an SVRL document. This is a specialized call ofIPSBoundSchema.validate(Node, String, IPSValidationHandler).- Specified by:
validateCompletein interfaceIPSBoundSchema- Parameters:
aNode- The XML node to be validated. May not benull.sBaseURI- Base URI of the XML to be validated. May benull.- Returns:
- The SVRL domain object.
- Throws:
SchematronValidationException- In case a validation exception occurs
-
toString
-