org.apache.axiom.om.impl.dom
Class NamedNodeMapImpl

java.lang.Object
  extended by org.apache.axiom.om.impl.dom.NamedNodeMapImpl
All Implemented Interfaces:
org.w3c.dom.NamedNodeMap
Direct Known Subclasses:
AttributeMap

public class NamedNodeMapImpl
extends java.lang.Object
implements org.w3c.dom.NamedNodeMap

Most of the implementation is taken from org.apache.xerces.dom.NamedNodeMapImpl


Field Summary
protected static short CHANGED
           
protected  short flags
           
protected static short HASDEFAULTS
           
(package private)  java.util.Vector nodes
           
(package private)  ParentNode ownerNode
           
protected static short READONLY
           
 
Constructor Summary
protected NamedNodeMapImpl(ParentNode ownerNode)
           
 
Method Summary
protected  int addItem(org.w3c.dom.Node arg)
           
(package private)  boolean changed()
           
(package private)  void changed(boolean value)
           
protected  java.util.Vector cloneMap(java.util.Vector list)
          NON-DOM: copy content of this map into the specified vector
protected  int findNamePoint(java.lang.String name, int start)
          From org.apache.xerces.dom.NamedNodeMapImpl

Subroutine: Locates the named item, or the point at which said item should be added.

protected  int findNamePoint(java.lang.String namespaceURI, java.lang.String name)
          This findNamePoint is for DOM Level 2 Namespaces.
protected  java.lang.Object getItem(int index)
           
 int getLength()
          From org.apache.xerces.dom.NamedNodeMapImpl
 org.w3c.dom.Node getNamedItem(java.lang.String name)
           
protected  int getNamedItemIndex(java.lang.String namespaceURI, java.lang.String localName)
           
 org.w3c.dom.Node getNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
          Introduced in DOM Level 2.
(package private)  boolean hasDefaults()
           
(package private)  void hasDefaults(boolean value)
           
(package private)  boolean isReadOnly()
           
(package private)  void isReadOnly(boolean value)
           
 org.w3c.dom.Node item(int index)
          From org.apache.xerces.dom.NamedNodeMapImpl
protected  boolean precedes(org.w3c.dom.Node a, org.w3c.dom.Node b)
           
 void removeAll()
          NON-DOM remove all elements from this map.
protected  void removeItem(int index)
          NON-DOM: Remove attribute at specified index.
 org.w3c.dom.Node removeNamedItem(java.lang.String name)
           
 org.w3c.dom.Node removeNamedItemNS(java.lang.String namespaceURI, java.lang.String name)
          Introduced in DOM Level 2.
 org.w3c.dom.Node setNamedItem(org.w3c.dom.Node arg)
          Adds a node using its nodeName attribute.
 org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node arg)
          Adds a node using its namespaceURI and localName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodes

java.util.Vector nodes

ownerNode

ParentNode ownerNode

flags

protected short flags

READONLY

protected static final short READONLY
See Also:
Constant Field Values

CHANGED

protected static final short CHANGED
See Also:
Constant Field Values

HASDEFAULTS

protected static final short HASDEFAULTS
See Also:
Constant Field Values
Constructor Detail

NamedNodeMapImpl

protected NamedNodeMapImpl(ParentNode ownerNode)
Method Detail

getNamedItem

public org.w3c.dom.Node getNamedItem(java.lang.String name)
Specified by:
getNamedItem in interface org.w3c.dom.NamedNodeMap

item

public org.w3c.dom.Node item(int index)
From org.apache.xerces.dom.NamedNodeMapImpl

Specified by:
item in interface org.w3c.dom.NamedNodeMap

getLength

public int getLength()
From org.apache.xerces.dom.NamedNodeMapImpl

Specified by:
getLength in interface org.w3c.dom.NamedNodeMap

removeNamedItem

public org.w3c.dom.Node removeNamedItem(java.lang.String name)
                                 throws org.w3c.dom.DOMException
Specified by:
removeNamedItem in interface org.w3c.dom.NamedNodeMap
Throws:
org.w3c.dom.DOMException

getNamedItemNS

public org.w3c.dom.Node getNamedItemNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
Introduced in DOM Level 2. Retrieves a node specified by local name and namespace URI.

Specified by:
getNamedItemNS in interface org.w3c.dom.NamedNodeMap
Parameters:
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.
Returns:
Returns s Node (of any type) with the specified name, or null if the specified name did not identify any node in the map.

setNamedItemNS

public org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node arg)
                                throws org.w3c.dom.DOMException
Adds a node using its namespaceURI and localName.

Specified by:
setNamedItemNS in interface org.w3c.dom.NamedNodeMap
Parameters:
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.
Returns:
Returns the replaced Node if the new Node replaces an existing node else returns null.
Throws:
org.w3c.dom.DOMException
See Also:
NamedNodeMap.setNamedItem(org.w3c.dom.Node)

removeNamedItemNS

public org.w3c.dom.Node removeNamedItemNS(java.lang.String namespaceURI,
                                          java.lang.String name)
                                   throws org.w3c.dom.DOMException
Introduced in DOM Level 2. Removes a node specified by local name and namespace URI.

Specified by:
removeNamedItemNS in interface org.w3c.dom.NamedNodeMap
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.
Returns:
Returns the node removed from the map if a node with such a local name and namespace URI exists.
Throws:
NOT_FOUND_ERR: - Raised if there is no node named name in the map.
org.w3c.dom.DOMException

setNamedItem

public org.w3c.dom.Node setNamedItem(org.w3c.dom.Node arg)
                              throws org.w3c.dom.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.

Specified by:
setNamedItem in interface org.w3c.dom.NamedNodeMap
Parameters:
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.
Returns:
Returns the replaced Node if the new Node replaces an existing node, otherwise returns null.
Throws:
org.w3c.dom.DOMException - The exception description.
See Also:
NamedNodeMap.setNamedItem(org.w3c.dom.Node)

isReadOnly

final boolean isReadOnly()

isReadOnly

final void isReadOnly(boolean value)

changed

final boolean changed()

changed

final void changed(boolean value)

hasDefaults

final boolean hasDefaults()

hasDefaults

final void hasDefaults(boolean value)

findNamePoint

protected int findNamePoint(java.lang.String name,
                            int start)
From org.apache.xerces.dom.NamedNodeMapImpl

Subroutine: Locates the named item, or the point at which said item should be added.

Parameters:
name - Name of a node to look up.
Returns:
If positive or zero, the index of the found item. If negative, index of the appropriate point at which to insert the item, encoded as -1-index and hence reconvertable by subtracting it from -1. (Encoding because I don't want to recompare the strings but don't want to burn bytes on a datatype to hold a flagged value.)

findNamePoint

protected int findNamePoint(java.lang.String namespaceURI,
                            java.lang.String name)
This findNamePoint is for DOM Level 2 Namespaces.


precedes

protected boolean precedes(org.w3c.dom.Node a,
                           org.w3c.dom.Node b)

removeItem

protected void removeItem(int index)
NON-DOM: Remove attribute at specified index.


getItem

protected java.lang.Object getItem(int index)

addItem

protected int addItem(org.w3c.dom.Node arg)

cloneMap

protected java.util.Vector cloneMap(java.util.Vector list)
NON-DOM: copy content of this map into the specified vector

Parameters:
list - Vector to copy information into.
Returns:
Returns a copy of this node named map.

getNamedItemIndex

protected int getNamedItemIndex(java.lang.String namespaceURI,
                                java.lang.String localName)

removeAll

public void removeAll()
NON-DOM remove all elements from this map.