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
Nested ClassesModifier and TypeClassDescriptionstatic classSimple implementation of DOMException. -
Constructor Summary
ConstructorsConstructorDescriptionDTMNamedNodeMap(DTM dtm, int element) Create a getAttributes NamedNodeMap for a given DTM element node -
Method Summary
Modifier and TypeMethodDescriptionintgetLength.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:
getLengthin interfaceNamedNodeMap- Returns:
- a
Integerobject.
-
getNamedItem
getNamedItem.
- Specified by:
getNamedItemin interfaceNamedNodeMap- Parameters:
name- aStringobject.- Returns:
- a
Attrobject.
-
item
item.
- Specified by:
itemin interfaceNamedNodeMap- Parameters:
i- aIntegerobject.- Returns:
- a
Attrobject.
-
removeNamedItem
removeNamedItem.
- Specified by:
removeNamedItemin interfaceNamedNodeMap- Parameters:
name- aStringobject.- Returns:
- a
Attrobject.
-
getNamedItemNS
getNamedItemNS.
- Specified by:
getNamedItemNSin interfaceNamedNodeMap- Parameters:
namespaceURI- aStringobject.localName- aStringobject.- Returns:
- a
Attrobject.
-
setNamedItemNS
setNamedItemNS.
- Specified by:
setNamedItemNSin interfaceNamedNodeMap- Parameters:
arg- aAttrobject.- Returns:
- a
Attrobject. - Throws:
DOMException
-
removeNamedItemNS
removeNamedItemNS.
- Specified by:
removeNamedItemNSin interfaceNamedNodeMap- Parameters:
namespaceURI- aStringobject.localName- aStringobject.- Returns:
- a
Attrobject. - Throws:
DOMException
-
setNamedItem
Description copied from interface:NamedNodeMapsetNamedItem.
- Specified by:
setNamedItemin interfaceNamedNodeMap- Parameters:
attr- aAttrobject.- Returns:
- a
Attrobject.
-