Class PSNS

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

@NotThreadSafe public class PSNS extends Object implements IPSClonableElement<PSNS>, IPSHasForeignAttributes
A single Schematron ns-element.
Specification of a namespace prefix and URI. The required prefix attribute is an XML name with no colon character. The required uri attribute is a namespace URI.
NOTE: Because the characters allowed as names may change in versions of XML subsequent to W3C XML 1.0, the ISO/IEC 19757-2 (RELAX NG Compact Syntax) schema for Schematron does not constrain the prefix to particular characters.
In an ISO Schematron schema, namespace prefixes in context expressions, assertion tests and other query expressions should use the namespace bindings provided by this element. Namespace prefixes should not use the namespace bindings in scope for element and attribute names.
Author:
Philip Helger
  • Constructor Details

    • PSNS

      public PSNS()
  • 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.
    • 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
    • getUri

      @Nullable public String getUri()
      Returns:
      The namespace URI. May be null.
    • setUri

      public void setUri(@Nullable String sUri)
      Parameters:
      sUri - The namespace URI. May be null.
    • getPrefix

      @Nullable public String getPrefix()
      Returns:
      The namespace prefix. May be null.
    • setPrefix

      public void setPrefix(@Nullable String sPrefix)
      Parameters:
      sPrefix - The namespace prefix 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 PSNS getClone()
      Specified by:
      getClone in interface com.helger.commons.lang.ICloneable<PSNS>
    • toString

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

      @Nonnull public static PSNS ofPrefixAndUri(@Nullable String sPrefix, @Nullable String sUri)
      Factory method to create a new PSNS with certain "prefix" and "uri" values
      Parameters:
      sUri -
      sPrefix - The namespace prefix to use. May be null.
      sUri - The namespace URI. May be null.
      Returns:
      Never null.
      Since:
      6.2.3