Class PSAssertReport

java.lang.Object
com.helger.schematron.pure.model.PSAssertReport
All Implemented Interfaces:
IPSElement, IPSHasFlag, IPSHasForeignAttributes, IPSHasForeignElements, IPSHasID, IPSHasLinkableGroup, IPSHasMixedContent, IPSHasRichGroup, IPSHasTexts

@NotThreadSafe public class PSAssertReport extends Object implements IPSElement, IPSHasFlag, IPSHasForeignElements, IPSHasMixedContent, IPSHasID, IPSHasRichGroup, IPSHasLinkableGroup
A single Schematron assert- or report-element.
An assertion made about the context nodes. The data content is a natural-language assertion. The required test attribute is an assertion test evaluated in the current context. If the test evaluates positive, the assertion succeeds. The optional diagnostics attribute is a reference to further diagnostic information.
The natural-language assertion shall be a positive statement of a constraint. NOTE: The natural-language assertion may contain information about actual values in addition to expected values and may contain diagnostic information. Users should note, however, that the diagnostic element is provided for such information to encourage clear statement of the natural-language assertion.
The icon, see and fpi attributes allow rich interfaces and documentation.
The flag attribute allows more detailed outcomes.
The role and subject attributes allow explicit identification of some part of a pattern.
Author:
Philip Helger
  • Constructor Details

    • PSAssertReport

      public PSAssertReport(boolean bIsAssert)
  • 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.
    • getAllForeignElements

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

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

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

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

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

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

      public boolean isAssert()
    • isReport

      public boolean isReport()
    • getTest

      @Nullable public String getTest()
    • setTest

      public void setTest(@Nullable String sTest)
    • getFlag

      @Nullable public String getFlag()
      Description copied from interface: IPSHasFlag
      The name of a Boolean flag variable. A flag is implicitly declared by an assertion or rule having a flag attribute with that name. The value of a flag becomes true when an assertion with that flag fails or a rule with that flag fires.
      The purpose of flags is to convey state or severity information to a subsequent process.
      An implementation is not required to make use of this attribute.
      Specified by:
      getFlag in interface IPSHasFlag
      Returns:
      The flag value
    • setFlag

      public void setFlag(@Nullable String sFlag)
    • getID

      @Nullable public String getID()
      Specified by:
      getID in interface IPSHasID
      Returns:
      The optional ID of this element. May be null.
    • 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.
    • getAllDiagnostics

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<String> getAllDiagnostics()
      Returns:
      List of references to PSDiagnostic elements.
    • setDiagnostics

      public void setDiagnostics(@Nullable String sDiagnostics)
      Set the diagnostics, as an IDREFS value (multiple IDREF values separated by spaces)
      Parameters:
      sDiagnostics - The value to be set. May be null.
    • setDiagnostics

      public void setDiagnostics(@Nullable com.helger.commons.collection.impl.ICommonsList<String> aDiagnostics)
      Set the diagnostics, as an IDREFS value (multiple IDREF values separated by spaces)
      Parameters:
      aDiagnostics - The value to be 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.
    • 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.
    • getLinkable

      @Nullable public PSLinkableGroup getLinkable()
      Specified by:
      getLinkable in interface IPSHasLinkableGroup
      Returns:
      Get the existing linkable group or null if none is present.
    • setLinkable

      public void setLinkable(@Nullable PSLinkableGroup aLinkable)
      Description copied from interface: IPSHasLinkableGroup
      Overwrite any existing linkable group.
      Specified by:
      setLinkable in interface IPSHasLinkableGroup
      Parameters:
      aLinkable - The new linkable group to set. May be null.
    • 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.
    • hasAnyText

      public boolean hasAnyText()
      Specified by:
      hasAnyText in interface IPSHasTexts
      Returns:
      true if at least one text element is contained, false if not
    • 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.
    • getAllNames

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSName> getAllNames()
    • addName

      public void addName(@Nonnull PSName aName)
    • getAllValueOfs

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSValueOf> getAllValueOfs()
    • addValueOf

      public void addValueOf(@Nonnull PSValueOf aValueOf)
    • getAllEmphs

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

      public void addEmph(@Nonnull PSEmph aEmph)
    • getAllDirs

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

      public void addDir(@Nonnull PSDir aDir)
    • getAllSpans

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

      public void addSpan(@Nonnull PSSpan aSpan)
    • getAllContentElements

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

      public String toString()
      Overrides:
      toString in class Object
    • assertion

      @Nonnull public static PSAssertReport assertion()
    • report

      @Nonnull public static PSAssertReport report()