Package: groovy.xml

## [Java] Class Namespace

- groovy.xml.Namespace

-     public class Namespace
      extends Object

  A simple helper class which acts as a factory of QName instances.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `Namespace()` Creates a namespace helper with no default URI or prefix.
    `Namespace(String uri)` Creates a namespace helper for the supplied URI.
    `Namespace(String uri, String prefix)` Creates a namespace helper for the supplied URI and prefix.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public QName` | `get(String localName)` Returns the QName for the given localName.
    `` | `public String` | `getPrefix()` Returns the prefix mapped to this namespace
    `` | `public String` | `getUri()` Returns the URI of this namespace

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public Namespace()

      Creates a namespace helper with no default URI or prefix.

    - #### public Namespace(String uri)

      Creates a namespace helper for the supplied URI.

      Parameters:
        `uri` - the namespace URI, trimmed before storage

    - #### public Namespace(String uri, String prefix)

      Creates a namespace helper for the supplied URI and prefix.

      Parameters:
        `uri` - the namespace URI, trimmed before storage
        `prefix` - the namespace prefix, trimmed before storage

  - ### Method Detail

    - #### public QName get(String localName)

      Returns the QName for the given localName.

      Parameters:
        `localName` - the local name within this

    - #### public String getPrefix()

      Returns the prefix mapped to this namespace

      Returns:
        the prefix assigned to this namespace or null if no namespace is mapped.

    - #### public String getUri()

      Returns the URI of this namespace

      Returns:
        the URI of this namespace