Class PSDiagnostic

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

A single Schematron diagnostic-element.
A natural-language message giving more specific details concerning a failed assertion, such as found versus expected values and repair hints.
NOTE: Diagnostics in multiple languages may be supported by using a different diagnostic element for each language, with the appropriate xml:lang language attribute, and referencing all the unique identifiers of the diagnostic elements in the diagnostics attribute of the assertion. Annex G gives a simple example of a multi-lingual schema.
An implementation is not required to make use of this element.
Author:
Philip Helger
  • Constructor Details

    • PSDiagnostic

      public PSDiagnostic()
  • 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.
    • 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.
    • addValueOf

      public void addValueOf(@Nonnull PSValueOf aValueOf)
    • getAllValueOfs

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

      public void addEmph(@Nonnull PSEmph aEmph)
    • getAllEmphs

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

      public void addDir(@Nonnull PSDir aDir)
    • getAllDirs

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<PSDir> getAllDirs()
    • 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, 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.
    • getClone

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

      public String toString()
      Overrides:
      toString in class Object