Class PSName

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

@NotThreadSafe public class PSName extends Object implements IPSClonableElement<PSName>, IPSHasForeignAttributes
A single Schematron name-element.
Provides the names of nodes from the instance document to allow clearer assertions and diagnostics. The optional path attribute is an expression evaluated in the current context that returns a string that is the name of a node. In the latter case, the name of the node is used.
An implementation which does not report natural-language assertions is not required to make use of this element.
Author:
Philip Helger
  • Constructor Details

    • PSName

      public PSName()
  • 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.
    • 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
    • getPath

      @Nullable public String getPath()
      Returns:
      The optional path to use.
    • hasPath

      public boolean hasPath()
      Returns:
      true if a path is specified, false otherwise.
    • setPath

      public void setPath(@Nullable String sPath)
      Parameters:
      sPath - The path to use. May be null.
    • 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 PSName getClone()
      Specified by:
      getClone in interface com.helger.commons.lang.ICloneable<PSName>
    • toString

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

      @Nonnull public static PSName ofPath(@Nullable String sPath)
      Factory method to create a new PSName with a certain "path" value
      Parameters:
      sPath - The "path" value to be used. May be null.
      Returns:
      Never null.
      Since:
      6.2.3