Class DTMNamedNodeMap
java.lang.Object
org.loboevolution.apache.xml.dtm.ref.DTMNamedNodeMap
- All Implemented Interfaces:
NamedNodeMap
DTMNamedNodeMap is a quickie (as opposed to quick) implementation of the DOM's NamedNodeMap
interface, intended to support DTMProxy's getAttributes() call.
***** Note: this does _not_ current attempt to cache any of the data; if you ask for attribute 27 and then 28, you'll have to rescan the first 27. It should probably at least keep track of the last one retrieved, and possibly buffer the whole array.
***** Also note that there's no fastpath for the by-name query; we search linearly until we find it or fail to find it. Again, that could be optimized at some cost in object creation/storage.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Simple implementation of DOMException. -
Constructor Summary
ConstructorDescriptionDTMNamedNodeMap
(DTM dtm, int element) Create a getAttributes NamedNodeMap for a given DTM element node -
Method Summary
Modifier and TypeMethodDescriptionint
getLength.getNamedItem
(String name) getNamedItem.getNamedItemNS
(String namespaceURI, String localName) getNamedItemNS.item
(int i) item.removeNamedItem
(String name) removeNamedItem.removeNamedItemNS
(String namespaceURI, String localName) removeNamedItemNS.setNamedItem
(Node attr) setNamedItem.setNamedItemNS
(Node arg) setNamedItemNS.
-
Constructor Details
-
DTMNamedNodeMap
Create a getAttributes NamedNodeMap for a given DTM element node- Parameters:
dtm
- The DTM Reference, must be non-null.element
- The DTM element handle.
-
-
Method Details
-
getLength
public int getLength()getLength.
- Specified by:
getLength
in interfaceNamedNodeMap
- Returns:
- a
Integer
object.
-
getNamedItem
getNamedItem.
- Specified by:
getNamedItem
in interfaceNamedNodeMap
- Parameters:
name
- aString
object.- Returns:
- a
Attr
object.
-
item
item.
- Specified by:
item
in interfaceNamedNodeMap
- Parameters:
i
- aInteger
object.- Returns:
- a
Attr
object.
-
removeNamedItem
removeNamedItem.
- Specified by:
removeNamedItem
in interfaceNamedNodeMap
- Parameters:
name
- aString
object.- Returns:
- a
Attr
object.
-
getNamedItemNS
getNamedItemNS.
- Specified by:
getNamedItemNS
in interfaceNamedNodeMap
- Parameters:
namespaceURI
- aString
object.localName
- aString
object.- Returns:
- a
Attr
object.
-
setNamedItemNS
setNamedItemNS.
- Specified by:
setNamedItemNS
in interfaceNamedNodeMap
- Parameters:
arg
- aAttr
object.- Returns:
- a
Attr
object. - Throws:
DOMException
-
removeNamedItemNS
removeNamedItemNS.
- Specified by:
removeNamedItemNS
in interfaceNamedNodeMap
- Parameters:
namespaceURI
- aString
object.localName
- aString
object.- Returns:
- a
Attr
object. - Throws:
DOMException
-
setNamedItem
Description copied from interface:NamedNodeMap
setNamedItem.
- Specified by:
setNamedItem
in interfaceNamedNodeMap
- Parameters:
attr
- aAttr
object.- Returns:
- a
Attr
object.
-