Class PSPhase

java.lang.Object
com.helger.schematron.pure.model.PSPhase
All Implemented Interfaces:
IPSElement, IPSHasForeignAttributes, IPSHasForeignElements, IPSHasID, IPSHasIncludes, IPSHasLets, IPSHasRichGroup

@NotThreadSafe public class PSPhase extends Object implements IPSElement, IPSHasForeignElements, IPSHasIncludes, IPSHasLets, IPSHasID, IPSHasRichGroup
A single Schematron phase-element.
A grouping of patterns, to name and declare variations in schemas, for example, to support progressive validation. The required id attribute is the name of the phase. The implementation determines which phase to use for validating documents, for example by user command.
Two names, #ALL and #DEFAULT, have special meanings. The name #ALL is reserved and available for use by implementations to denote that all patterns are active. The name #DEFAULT is reserved and available for use by implementations to denote that the name given in the defaultPhase attribute on the schema element should be used. If no defaultPhase is specified, then all patterns are active.
NOTE: The names #ALL and #DEFAULT shall not be used in a Schematron schema. They are for use when invoking or configuring schema validation, for example as a command-line parameter.
The icon, see and fpi attributes allow rich interfaces and documentation.
PSPhase elements are only referenced from PSSchema elements.
Author:
Philip Helger
  • Constructor Details

    • PSPhase

      public PSPhase()
  • Method Details

    • isValid

      public boolean isValid(@Nonnull IPSErrorHandler aErrorHandler)
      Description copied from interface: IPSElement
      Check if this element is specified completely. This method stops at the first encountered error.
      Specified by:
      isValid in interface IPSElement
      Parameters:
      aErrorHandler - The error handler where the error details are stored. May not be null.
      Returns:
      true if all mandatory fields are set and the element is valid, false otherwise.
    • validateCompletely

      public void validateCompletely(@Nonnull IPSErrorHandler aErrorHandler)
      Description copied from interface: IPSElement
      Check if this element is specified completely. This method performs all validations independent of the number of encountered error.
      Specified by:
      validateCompletely in interface IPSElement
      Parameters:
      aErrorHandler - The error handler where the error details are stored. May not be null.
    • isMinimal

      public boolean isMinimal()
      Specified by:
      isMinimal in interface IPSElement
      Returns:
      true if this element conforms to the Schematron minimal syntax, false otherwise.
    • addForeignElement

      public void addForeignElement(@Nonnull com.helger.xml.microdom.IMicroElement aForeignElement)
      Specified by:
      addForeignElement in interface IPSHasForeignElements
    • hasForeignElements

      public boolean hasForeignElements()
      Specified by:
      hasForeignElements in interface IPSHasForeignElements
    • getAllForeignElements

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<com.helger.xml.microdom.IMicroElement> getAllForeignElements()
      Specified by:
      getAllForeignElements in interface IPSHasForeignElements
    • addForeignAttribute

      public void addForeignAttribute(@Nonnull String sAttrName, @Nonnull String sAttrValue)
      Specified by:
      addForeignAttribute in interface IPSHasForeignAttributes
    • hasForeignAttributes

      public boolean hasForeignAttributes()
      Specified by:
      hasForeignAttributes in interface IPSHasForeignAttributes
    • getAllForeignAttributes

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getAllForeignAttributes()
      Specified by:
      getAllForeignAttributes in interface IPSHasForeignAttributes
    • setID

      public void setID(@Nullable String sID)
      Description copied from interface: IPSHasID
      Set an ID for this object.
      Specified by:
      setID in interface IPSHasID
      Parameters:
      sID - The ID to be set. May be null.
    • getID

      @Nullable public String getID()
      Specified by:
      getID in interface IPSHasID
      Returns:
      The optional ID of this element. May be null.
    • setRich

      public void setRich(@Nullable PSRichGroup aRich)
      Description copied from interface: IPSHasRichGroup
      Overwrite any existing rich group.
      Specified by:
      setRich in interface IPSHasRichGroup
      Parameters:
      aRich - The new rich group to set. May be null.
    • getRich

      @Nullable public PSRichGroup getRich()
      Specified by:
      getRich in interface IPSHasRichGroup
      Returns:
      Get the existing rich group or null if none is present.
    • addInclude

      public void addInclude(@Nonnull PSInclude aInclude)
      Description copied from interface: IPSHasIncludes
      Add an include to this object.
      Specified by:
      addInclude in interface IPSHasIncludes
      Parameters:
      aInclude - The include to be added. May not be null.
    • hasAnyInclude

      public boolean hasAnyInclude()
      Specified by:
      hasAnyInclude in interface IPSHasIncludes
      Returns:
      true if at least one include is present in this object.
    • getAllIncludes

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSInclude> getAllIncludes()
      Specified by:
      getAllIncludes in interface IPSHasIncludes
      Returns:
      A list of all contained includes. Never null.
    • addP

      public void addP(@Nonnull PSP aP)
    • getAllPs

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSP> getAllPs()
    • addLet

      public void addLet(@Nonnull PSLet aLet)
      Description copied from interface: IPSHasLets
      Add a PSLet element.
      Specified by:
      addLet in interface IPSHasLets
      Parameters:
      aLet - The let element to be added. May not be null.
    • hasAnyLet

      public boolean hasAnyLet()
      Specified by:
      hasAnyLet in interface IPSHasLets
      Returns:
      true if this object has at least on contained PSLet object.
    • getAllLets

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSLet> getAllLets()
      Specified by:
      getAllLets in interface IPSHasLets
      Returns:
      A list of all contained PSLet elements. Never null.
    • getAllLetsAsMap

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getAllLetsAsMap()
      Specified by:
      getAllLetsAsMap in interface IPSHasLets
      Returns:
      The content of all PSLet elements as an ordered Map from name to value. The order must match the declaration order! Never null.
    • addActive

      public void addActive(@Nonnull PSActive aActive)
    • getAllActives

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSActive> getAllActives()
    • getAllContentElements

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IPSElement> getAllContentElements()
      Returns:
      A list of PSActive, PSLet and PSP elements.
    • getAsMicroElement

      @Nonnull public com.helger.xml.microdom.IMicroElement getAsMicroElement()
      Specified by:
      getAsMicroElement in interface IPSElement
      Returns:
      The XML representation of this element. Never null.
    • toString

      public String toString()
      Overrides:
      toString in class Object