gnu.xml.dom

Class DomNamedNodeMap

public class DomNamedNodeMap extends Object implements NamedNodeMap

"NamedNodeMap" implementation.

Used mostly to hold element attributes, but sometimes also to list notations or entities.

Version: $Date: 2001/11/20 04:46:24 $

Author: David Brownell

Constructor Summary
DomNamedNodeMap(Document owner)
Constructs an empty map associated with the specified document.
Method Summary
voidcompact()
Reduces space utilization for this object.
intgetLength()
DOM L1 Returns the length of the map.
NodegetNamedItem(String name)
DOM L1 Returns the named item from the map, or null; names are just the nodeName property.
NodegetNamedItemNS(String namespaceURI, String localName)
DOM L2 Returns the named item from the map, or null; names are the localName and namespaceURI properties, ignoring any prefix.
booleanisReadonly()
Exposes the internal "readonly" flag.
Nodeitem(int index)
DOM L1 Returns the indexed item from the map, or null.
voidmakeReadonly()
Sets the internal "readonly" flag so the node and its children can't be changed.
NoderemoveNamedItem(String name)
DOM L1 Removes the named item from the map, or reports an exception; names are just the nodeName property.
NoderemoveNamedItemNS(String namespaceURI, String localName)
DOM L2 Removes the named item from the map, or reports an exception; names are the localName and namespaceURI properties.
NodesetNamedItem(Node arg)
DOM L1 Stores the named item into the map, optionally overwriting any existing node with that name.
NodesetNamedItemNS(Node arg)
DOM L2 Stores the named item into the map, optionally overwriting any existing node with that fully qualified name.

Constructor Detail

DomNamedNodeMap

public DomNamedNodeMap(Document owner)
Constructs an empty map associated with the specified document.

Method Detail

compact

public void compact()
Reduces space utilization for this object.

getLength

public int getLength()
DOM L1 Returns the length of the map.

getNamedItem

public Node getNamedItem(String name)
DOM L1 Returns the named item from the map, or null; names are just the nodeName property.

getNamedItemNS

public Node getNamedItemNS(String namespaceURI, String localName)
DOM L2 Returns the named item from the map, or null; names are the localName and namespaceURI properties, ignoring any prefix.

isReadonly

public final boolean isReadonly()
Exposes the internal "readonly" flag. In DOM, all NamedNodeMap objects found in a DocumentType object are read-only (after they are fully constructed), and those holding attributes of a readonly element will also be readonly.

item

public Node item(int index)
DOM L1 Returns the indexed item from the map, or null.

makeReadonly

public void makeReadonly()
Sets the internal "readonly" flag so the node and its children can't be changed.

removeNamedItem

public Node removeNamedItem(String name)
DOM L1 Removes the named item from the map, or reports an exception; names are just the nodeName property.

removeNamedItemNS

public Node removeNamedItemNS(String namespaceURI, String localName)
DOM L2 Removes the named item from the map, or reports an exception; names are the localName and namespaceURI properties.

setNamedItem

public Node setNamedItem(Node arg)
DOM L1 Stores the named item into the map, optionally overwriting any existing node with that name. The name used is just the nodeName attribute.

setNamedItemNS

public Node setNamedItemNS(Node arg)
DOM L2 Stores the named item into the map, optionally overwriting any existing node with that fully qualified name. The name used incorporates the localName and namespaceURI properties, and ignores any prefix.

Source code is under GPL (with library exception) in the JAXP project at http://www.gnu.org/software/classpathx/jaxp
This documentation was derived from that source code on 2013-01-12.