java.lang.Object | |
↳ | org.apache.xerces.dom.NamedNodeMapImpl |
Known Direct Subclasses |
NamedNodeMaps represent collections of Nodes that can be accessed by name. Entity and Notation nodes are stored in NamedNodeMaps attached to the DocumentType. Attributes are placed in a NamedNodeMap attached to the elem they're related too. However, because attributes require more work, such as firing mutation events, they are stored in a subclass of NamedNodeMapImpl.
Only one Node may be stored per name; attempting to store another will replace the previous value.
NOTE: The "primary" storage key is taken from the NodeName attribute of the node. The "secondary" storage key is the namespaceURI and localName, when accessed by DOM level 2 nodes. All nodes, even DOM Level 2 nodes are stored in a single Vector sorted by the primary "nodename" key.
NOTE: item()'s integer index does _not_ imply that the named nodes must be stored in an array; that's only an access method. Note too that these indices are "live"; if someone changes the map's contents, the indices associated with nodes may change.
@xerces.internal
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
short | CHANGED | ||||||||||
short | HASDEFAULTS | ||||||||||
short | READONLY |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
flags | |||||||||||
nodes | Nodes. | ||||||||||
ownerNode |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a named node map.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Cloning a NamedNodeMap is a DEEP OPERATION; it always clones
all the nodes contained in the map.
| |||||||||||
Report how many nodes are currently stored in this NamedNodeMap.
| |||||||||||
Retrieve a node by name.
| |||||||||||
Introduced in DOM Level 2.
| |||||||||||
Retrieve an item from the map by 0-based index.
| |||||||||||
NON-DOM remove all elements from this map
| |||||||||||
Introduced in DOM Level 2.
| |||||||||||
Adds a node using its nodeName attribute.
| |||||||||||
Adds a node using its namespaceURI and localName.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NON-DOM: copy content of this map into the specified vector
| |||||||||||
This findNamePoint is for DOM Level 2 Namespaces.
| |||||||||||
Subroutine: Locate the named item, or the point at which said item
should be added.
| |||||||||||
NON-DOM: Remove attribute at specified index
| |||||||||||
NON-DOM
set the ownerDocument of this node, and the attributes it contains
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.w3c.dom.NamedNodeMap
|
Cloning a NamedNodeMap is a DEEP OPERATION; it always clones all the nodes contained in the map.
Report how many nodes are currently stored in this NamedNodeMap. Caveat: This is a count rather than an index, so the highest-numbered node at any time can be accessed via item(getLength()-1).
Retrieve a node by name.
name | Name of a node to look up. |
---|
Introduced in DOM Level 2.
Retrieves a node specified by local name and namespace URI.
namespaceURI | The namespace URI of the node to retrieve. When it is null or an empty string, this method behaves like getNamedItem. |
---|---|
localName | The local name of the node to retrieve. |
Retrieve an item from the map by 0-based index.
index | Which item to retrieve. Note that indices are just an enumeration of the current contents; they aren't guaranteed to be stable, nor do they imply any promises about the order of the NamedNodeMap's contents. In other words, DO NOT assume either that index(i) will always refer to the same entry, or that there is any stable ordering of entries... and be prepared for double-reporting or skips as insertion and deletion occur. |
---|
NON-DOM remove all elements from this map
Introduced in DOM Level 2.
Removes a node specified by local name and namespace URI.
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. |
Raised if there is no node named name in the map. | |
DOMException |
Adds a node using its nodeName attribute. As the nodeName attribute is used to derive the name which the node must be stored under, multiple nodes of certain types (those that have a "special" string value) cannot be stored as the names would clash. This is seen as preferable to allowing nodes to be aliased.
arg | A node to store in a named node map. The node will later be accessible using the value of the namespaceURI and localName attribute of the node. If a node with those namespace URI and local name is already present in the map, it is replaced by the new one. |
---|
DOMException | The exception description. |
---|
Adds a node using its namespaceURI and localName.
arg | A node to store in a named node map. The node will later be accessible using the value of the namespaceURI and localName attribute of the node. If a node with those namespace URI and local name is already present in the map, it is replaced by the new one. |
---|
DOMException |
---|
NON-DOM: copy content of this map into the specified vector
list | Vector to copy information into. |
---|
This findNamePoint is for DOM Level 2 Namespaces.
Subroutine: Locate the named item, or the point at which said item should be added.
name | Name of a node to look up. |
---|
NON-DOM: Remove attribute at specified index
NON-DOM set the ownerDocument of this node, and the attributes it contains