Class Namespaces


public class Namespaces extends Object
A utility class to perform operations on Namespaces.
Peter Ansell
  • Field Details

  • Method Details

    • asMap

      public static Map<String,String> asMap(Set<Namespace> namespaces)
      Converts a set of Namespaces into a map containing the Namespace.getPrefix() strings as keys, with the Namespace.getName() strings as values in the map for each namespace in the given set.
      namespaces - The Set of Namespaces to transform.
      A Map of String to String where the key/value combinations are created based on the prefix and names from Namespaces in the input set.
    • wrap

      public static Map<String,String> wrap(Set<Namespace> namespaces)
      Wraps the given Set of Namespaces as a Map of prefix to URI mappings, so that it can be used where a Map is required by the API.
      NOTE: The Map returned by this method is not synchronized.
      namespaces - The Set to wrap.
      A Map of prefix to URI mappings which is backed by the given Set of Namespaces.