Namespace (Groovy 4.0.15)
Description: declaration: package: groovy.xml, class: Namespace

Package groovy.xml

# Class Namespace

java.lang.Object
groovy.xml.Namespace

public class Namespace extends Object
A simple helper class which acts as a factory of `QName` instances.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Namespace()`
  `Namespace(String uri)`
  `Namespace(String uri, String prefix)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `QName`
  `get(String localName)`
  Returns the QName for the given localName.
  `String`
  `getPrefix()`
  Returns the prefix mapped to this namespace
  `String`
  `getUri()`
  Returns the URI of this namespace

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

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

- ## Constructor Details

  - ### Namespace

    public Namespace()

  - ### Namespace

    public Namespace(String uri)

  - ### Namespace

    public Namespace(String uri, String prefix)

- ## Method Details

  - ### get

    public QName get(String localName)
    Returns the QName for the given localName.
    Parameters:
      `localName` - the local name within this

  - ### getPrefix

    public String getPrefix()
    Returns the prefix mapped to this namespace
    Returns:
      the prefix assigned to this namespace or null if no namespace is mapped.

  - ### getUri

    public String getUri()
    Returns the URI of this namespace
    Returns:
      the URI of this namespace