com.pdfunit.xml

## Class PDFInternalNamespaces

- java.lang.Object
- - com.pdfunit.xml.PDFInternalNamespaces

- All Implemented Interfaces:
    javax.xml.namespace.NamespaceContext

      public class PDFInternalNamespaces
      extends java.lang.Object
      implements javax.xml.namespace.NamespaceContext

  This class implements the interface javax.xml.namespace.NamespaceContext. Namespaces are read from a config file and passed in as a parameter of the add() method.

  Additionally, it provides methods, to handle a default namespace and to set the namespace with a addXX()-method.

  Since:
    2016.05
  Author:
    Carsten Siedentop, March 2016

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PDFInternalNamespaces()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(java.util.Hashtable<java.lang.String,java.lang.String> newNamespaces)`
    `java.lang.String` | `getNamespaceURI(java.lang.String prefix)` Returning the namespace belonging to the prefix.
    `java.lang.String` | `getPrefix(java.lang.String namespace)` Returning the prefix belonging to the namespace.
    `java.util.Iterator<java.lang.String>` | `getPrefixes(java.lang.String expectedNamespace)` This method does what the name suggests.
    `void` | `setDefault(DefaultNamespace defaultNS)` XPath inside the JDK does not work with an empty string as a prefix.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PDFInternalNamespaces

          public PDFInternalNamespaces()

  - ### Method Detail

    - #### getNamespaceURI

          public java.lang.String getNamespaceURI(java.lang.String prefix)

      Returning the namespace belonging to the prefix.
      Specified by:
        `getNamespaceURI` in interface `javax.xml.namespace.NamespaceContext`

    - #### getPrefix

          public java.lang.String getPrefix(java.lang.String namespace)

      Returning the prefix belonging to the namespace.
      Specified by:
        `getPrefix` in interface `javax.xml.namespace.NamespaceContext`

    - #### getPrefixes

          public java.util.Iterator<java.lang.String> getPrefixes(java.lang.String expectedNamespace)

      This method does what the name suggests.
      Specified by:
        `getPrefixes` in interface `javax.xml.namespace.NamespaceContext`

    - #### setDefault

          public void setDefault(DefaultNamespace defaultNS)

      XPath inside the JDK does not work with an empty string as a prefix. So the prefix 'default' is set.
      See Also:
        `XMLConstants.DEFAULT_NS_PREFIX`

    - #### add

          public void add(java.util.Hashtable<java.lang.String,java.lang.String> newNamespaces)

Copyright (C) PDFUnit.com. See here for license.