Class AttributeMap

  • All Implemented Interfaces:
    Serializable, NamedNodeMap

    public class AttributeMap
    extends NamedNodeMapImpl
    AttributeMap inherits from NamedNodeMapImpl and extends it to deal with the specifics of storing attributes. These are:
    • managing ownership of attribute nodes
    • managing default attributes
    • firing mutation events

    This class doesn't directly support mutation events, however, it notifies the document when mutations are performed so that the document class do so.

    Version:
    $Id$
    See Also:
    Serialized Form
    • Method Detail

      • removeItem

        protected Node removeItem​(Node item,
                                  boolean addDefault)
                           throws DOMException
        NON-DOM: Remove the node object NOTE: Specifically removes THIS NODE -- not the node with this name, nor the node with these contents. If node does not belong to this named node map, we throw a DOMException.
        Parameters:
        item - The node to remove
        addDefault - true -- magically add default attribute
        Returns:
        Removed node
        Throws:
        DOMException
      • internalRemoveNamedItem

        protected final Node internalRemoveNamedItem​(String name,
                                                     boolean raiseEx)
        Internal removeNamedItem method allowing to specify whether an exception must be thrown if the specified name is not found.
      • removeNamedItemNS

        public Node removeNamedItemNS​(String namespaceURI,
                                      String name)
                               throws DOMException
        Introduced in DOM Level 2.

        Removes an attribute specified by local name and namespace URI.

        Specified by:
        removeNamedItemNS in interface NamedNodeMap
        Overrides:
        removeNamedItemNS in class NamedNodeMapImpl
        Parameters:
        namespaceURI - The namespace URI of the node to remove. When it is null or an empty string, this method behaves like removeNamedItem.
        name - The local name of the node to remove. If the removed attribute is known to have a default value, an attribute immediately appears containing the default value.
        Returns:
        Node The node removed from the map if a node with such a local name and namespace URI exists.
        Throws:
        DOMException
      • internalRemoveNamedItemNS

        protected final Node internalRemoveNamedItemNS​(String namespaceURI,
                                                       String name,
                                                       boolean raiseEx)
        Internal removeNamedItemNS method allowing to specify whether an exception must be thrown if the specified local name and namespace URI is not found.
      • reconcileDefaults

        protected void reconcileDefaults​(NamedNodeMapImpl defaults)
        Get this AttributeMap in sync with the given "defaults" map.
        Parameters:
        defaults - The default attributes map to sync with.