Class PSActive

java.lang.Object
com.helger.schematron.pure.model.PSActive
All Implemented Interfaces:
com.helger.commons.lang.ICloneable<PSActive>, IPSClonableElement<PSActive>, IPSElement, IPSHasForeignAttributes, IPSHasForeignElements, IPSHasMixedContent, IPSHasTexts

@NotThreadSafe public class PSActive extends Object implements IPSClonableElement<PSActive>, IPSHasForeignElements, IPSHasMixedContent
A single Schematron active-element.
The required pattern attribute is a reference to a pattern that is active in the current phase.
PSActive elements are only references from PSPhase elements.
Author:
Philip Helger
  • Constructor Details

    • PSActive

      public PSActive()
  • 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
    • setPattern

      public void setPattern(@Nullable String sPattern)
      Parameters:
      sPattern - The ID of the pattern to set active.
    • getPattern

      @Nullable public String getPattern()
      Returns:
      ID of the PSPattern to be marked active. May be null.
    • addText

      public void addText(@Nonnull @Nonempty String sText)
      Description copied from interface: IPSHasTexts
      Add a new text element.
      Specified by:
      addText in interface IPSHasTexts
      Parameters:
      sText - The text to be added. May not be null.
    • hasAnyText

      public boolean hasAnyText()
      Specified by:
      hasAnyText in interface IPSHasTexts
      Returns:
      true if at least one text element is contained, false if not
    • getAllTexts

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<String> getAllTexts()
      Specified by:
      getAllTexts in interface IPSHasTexts
      Returns:
      A copy of all contained text elements. Never null.
    • addDir

      public void addDir(@Nonnull PSDir aDir)
    • getAllDirs

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSDir> getAllDirs()
    • addEmph

      public void addEmph(@Nonnull PSEmph aEmph)
    • getAllEmphs

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSEmph> getAllEmphs()
    • addSpan

      public void addSpan(@Nonnull PSSpan aSpan)
    • getAllSpans

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

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<Object> getAllContentElements()
      Specified by:
      getAllContentElements in interface IPSHasMixedContent
      Returns:
      A list of String, PSDir, PSEmph and PSSpan 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.
    • getClone

      @Nonnull public PSActive getClone()
      Specified by:
      getClone in interface com.helger.commons.lang.ICloneable<PSActive>
    • toString

      public String toString()
      Overrides:
      toString in class Object