Class Element.NamespaceDictionary

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.String>, Dictionary<java.lang.String,​java.lang.String>
    Enclosing class:
    Element

    public final class Element.NamespaceDictionary
    extends java.lang.Object
    implements Dictionary<java.lang.String,​java.lang.String>, java.lang.Iterable<java.lang.String>
    Dictionary representing the namespaces declared by this element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(java.lang.String prefix)
      Tests for the existence of a namespace declared by this element.
      java.lang.String get​(java.lang.String prefix)
      Returns the URI of a namespace declared by this element.
      java.util.Iterator<java.lang.String> iterator()
      Returns an iterator over the element's namespace prefixes.
      java.lang.String put​(java.lang.String prefix, java.lang.String uri)
      Sets the URI of a namespace declared by this element.
      java.lang.String remove​(java.lang.String prefix)
      Removes a namespace from this element's declared namespaces.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • get

        public java.lang.String get​(java.lang.String prefix)
        Returns the URI of a namespace declared by this element.
        Specified by:
        get in interface Dictionary<java.lang.String,​java.lang.String>
        Parameters:
        prefix - The namespace prefix.
        Returns:
        The declared namespace, or null if no such namespace exists.
      • put

        public java.lang.String put​(java.lang.String prefix,
                                    java.lang.String uri)
        Sets the URI of a namespace declared by this element.
        Specified by:
        put in interface Dictionary<java.lang.String,​java.lang.String>
        Parameters:
        prefix - The namespace prefix.
        uri - The namespace URI.
        Returns:
        The URI previously associated with the given prefix.
      • remove

        public java.lang.String remove​(java.lang.String prefix)
        Removes a namespace from this element's declared namespaces.
        Specified by:
        remove in interface Dictionary<java.lang.String,​java.lang.String>
        Parameters:
        prefix - The namespace prefix.
        Returns:
        The URI previously associated with the given prefix.
      • containsKey

        public boolean containsKey​(java.lang.String prefix)
        Tests for the existence of a namespace declared by this element.
        Specified by:
        containsKey in interface Dictionary<java.lang.String,​java.lang.String>
        Parameters:
        prefix - Namespace prefix to test for.
        Returns:
        true if this element declares a namespace with the given prefix; false otherwise.
      • iterator

        public java.util.Iterator<java.lang.String> iterator()
        Returns an iterator over the element's namespace prefixes.
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>