Package: groovy.xml

## [Java] Class NamespaceBuilder

- groovy.xml.NamespaceBuilder

-     public class NamespaceBuilder
      extends Object

  A helper class for creating namespaces for GroovyMarkup

- - ### Constructor Summary

    Constructors
    Constructor and description
    `NamespaceBuilder(BuilderSupport builder)` Creates a helper that produces namespace-aware wrappers for the supplied builder.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public NamespaceBuilderSupport` | `declareNamespace(Map ns)` Declares multiple namespace mappings at once.
    `` | `public NamespaceBuilderSupport` | `namespace(String uri)` Associates a namespace URI with the default prefix.
    `` | `public NamespaceBuilderSupport` | `namespace(String uri, String prefix)` Associates a namespace URI with the supplied prefix.
    `` | `public static NamespaceBuilderSupport` | `newInstance(BuilderSupport builder, String uri)` Creates a namespace-aware builder wrapper for a single default namespace URI.
    `` | `public static NamespaceBuilderSupport` | `newInstance(BuilderSupport builder)` Creates a namespace-aware builder wrapper without any predefined namespace mappings.
    `` | `public static NamespaceBuilderSupport` | `newInstance(BuilderSupport builder, String uri, String prefix)` Creates a namespace-aware builder wrapper for a single namespace mapping.
    `` | `public static NamespaceBuilderSupport` | `newInstance(Map nsMap, BuilderSupport builder)` Creates a namespace-aware builder wrapper using the supplied prefix-to-URI mappings.

  - ### Inherited Methods Summary

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

- - ### Constructor Detail

    - #### public NamespaceBuilder(BuilderSupport builder)

      Creates a helper that produces namespace-aware wrappers for the supplied builder.

      Parameters:
        `builder` - the builder to wrap

  - ### Method Detail

    - #### public NamespaceBuilderSupport declareNamespace(Map ns)

      Declares multiple namespace mappings at once.

      Parameters:
        `ns` - the prefix-to-URI mappings to declare
      Returns:
        a namespace-aware builder wrapper

    - #### public NamespaceBuilderSupport namespace(String uri)

      Associates a namespace URI with the default prefix.

      Parameters:
        `uri` - the namespace URI to associate
      Returns:
        a namespace-aware builder wrapper

    - #### public NamespaceBuilderSupport namespace(String uri, String prefix)

      Associates a namespace URI with the supplied prefix.

      Parameters:
        `uri` - the namespace URI to associate
        `prefix` - the prefix to associate with `uri`
      Returns:
        a namespace-aware builder wrapper

    - #### public static NamespaceBuilderSupport newInstance(BuilderSupport builder, String uri)

      Creates a namespace-aware builder wrapper for a single default namespace URI.

      Parameters:
        `builder` - the builder to wrap
        `uri` - the namespace URI to associate with the default prefix
      Returns:
        a namespace-aware builder wrapper

    - #### public static NamespaceBuilderSupport newInstance(BuilderSupport builder)

      Creates a namespace-aware builder wrapper without any predefined namespace mappings.

      Parameters:
        `builder` - the builder to wrap
      Returns:
        a namespace-aware builder wrapper

    - #### public static NamespaceBuilderSupport newInstance(BuilderSupport builder, String uri, String prefix)

      Creates a namespace-aware builder wrapper for a single namespace mapping.

      Parameters:
        `builder` - the builder to wrap
        `uri` - the namespace URI to associate
        `prefix` - the prefix to associate with `uri`
      Returns:
        a namespace-aware builder wrapper

    - #### public static NamespaceBuilderSupport newInstance(Map nsMap, BuilderSupport builder)

      Creates a namespace-aware builder wrapper using the supplied prefix-to-URI mappings.

      Parameters:
        `nsMap` - the namespace mappings to declare
        `builder` - the builder to wrap
      Returns:
        a namespace-aware builder wrapper