Interface IPSBoundSchema

All Known Implementing Classes:
AbstractPSBoundSchema, PSXPathBoundSchema

public interface IPSBoundSchema
Base interface for a bound schema. A bound schema is a PSSchema with a specific
Author:
Philip Helger
  • Method Details

    • getQueryBinding

      @Nonnull IPSQueryBinding getQueryBinding()
      Returns:
      The query binding that was used to create this bound schema.
    • getOriginalSchema

      @Nonnull PSSchema getOriginalSchema()
      Returns:
      The original schema used to bind. Never null.
    • getNamespaceContext

      @Nonnull com.helger.xml.namespace.MapBasedNamespaceContext getNamespaceContext()
      Returns:
      The namespace context as defined by the namespaces in the original schema. Never null.
    • getPhaseID

      @Nonnull String getPhaseID()
      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

      @Nullable PSPhase getPhase()
      Returns:
      The phase object to be evaluated. May be null if no specific phase is to be validated!
    • isPhaseSpecified

      boolean isPhaseSpecified()
      Returns:
      true if a special phase was specified, false if not.
    • getAllRelevantPatterns

      @Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<PSPattern> getAllRelevantPatterns()
      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.
    • getValidationContext

      @Nonnull String getValidationContext(@Nonnull String sRuleContext)
      Get the validation context to be used. As rules can be stated as "element" they are not necessarily present on root level. For XPath this may e.g. be resolved by prepending "//" so that all elements are resolved correctly.
      Parameters:
      sRuleContext - The original rule context. May not be null.
      Returns:
      The real validation context to use.
    • validate

      void validate(@Nonnull Node aNode, @Nullable String sBaseURI, @Nonnull IPSValidationHandler aHandler) throws SchematronValidationException
      The generic validation method. It validates the passed XML node to this bound schema.
      Parameters:
      aNode - The node to be validated. May not be null.
      sBaseURI - Base URI of the XML to be validated. May be null.
      aHandler - The validation handler that receives the callback informations. May not be null.
      Throws:
      SchematronValidationException - In case a validation exception occurs
    • validatePartially

      @Nonnull com.helger.commons.state.EValidity validatePartially(@Nonnull Node aNode, @Nullable String sBaseURI) throws SchematronValidationException
      Special validation that breaks on the first error. This is a specialized call of validate(Node, String, IPSValidationHandler).
      Parameters:
      aNode - The XML node to be validated. May not be null.
      sBaseURI - Base URI of the XML to be validated. May be null.
      Returns:
      EValidity.VALID if the document is valid, EValidity.INVALID if it is invalid.
      Throws:
      SchematronValidationException - In case a validation exception occurs
    • validateComplete

      @Nonnull com.helger.schematron.svrl.jaxb.SchematronOutputType validateComplete(@Nonnull Node aNode, @Nullable String sBaseURI) throws SchematronValidationException
      Special validation that creates an SVRL document. This is a specialized call of validate(Node, String, IPSValidationHandler).
      Parameters:
      aNode - The XML node to be validated. May not be null.
      sBaseURI - Base URI of the XML to be validated. May be null.
      Returns:
      The SVRL domain object.
      Throws:
      SchematronValidationException - In case a validation exception occurs