com.fasterxml.aalto.dom

## Class BijectiveNsMap

- java.lang.Object
- - com.fasterxml.aalto.dom.BijectiveNsMap

-     public final class BijectiveNsMap
      extends Object

  Helper class that implements "bijective map" (Map that allows use of values as keys and vice versa, bidirectional access), and is specifically used for storing namespace binding information. One thing worth noting is that Strings stored are NOT assumed to have been unified (interned) -- if they were, different implementation would be more optimal.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `addGeneratedMapping(String prefixBase, NamespaceContext ctxt, String uri, int[] seqArr)` Method used to add a dynamic binding, and return the prefix used to bind the specified namespace URI.
    `String` | `addMapping(String prefix, String uri)` Method to add a new prefix-to-URI mapping for the current scope.
    `BijectiveNsMap` | `createChild()`
    `static BijectiveNsMap` | `createEmpty()`
    `String` | `findPrefixByUri(String uri)`
    `String` | `findUriByPrefix(String prefix)`
    `List<String>` | `getPrefixesBoundToUri(String uri, List<String> l)`
    `int` | `localSize()`
    `int` | `size()`

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

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

- - ### Method Detail

    - #### createEmpty

          public static BijectiveNsMap createEmpty()

    - #### createChild

          public BijectiveNsMap createChild()

    - #### findUriByPrefix

          public String findUriByPrefix(String prefix)

    - #### findPrefixByUri

          public String findPrefixByUri(String uri)

    - #### getPrefixesBoundToUri

          public List<String> getPrefixesBoundToUri(String uri,
                                           List<String> l)

    - #### size

          public int size()

    - #### localSize

          public int localSize()

    - #### addMapping

          public String addMapping(String prefix,
                          String uri)

      Method to add a new prefix-to-URI mapping for the current scope. Note that it should NOT be used for the default namespace declaration
      Parameters:
        `prefix` - Prefix to bind
        `uri` - URI to bind to the prefix
      Returns:
        If the prefix was already bound, the URI it was bound to: null if it's a new binding for the current scope.

    - #### addGeneratedMapping

          public String addGeneratedMapping(String prefixBase,
                                   NamespaceContext ctxt,
                                   String uri,
                                   int[] seqArr)

      Method used to add a dynamic binding, and return the prefix used to bind the specified namespace URI.

Copyright © 2012-2015 FasterXML. All Rights Reserved.