|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ozoneDB.OzoneObject
org.ozoneDB.xml.dom.NodeImpl
org.ozoneDB.xml.dom.ElementImpl
The most common node type, Element
inherits the generic
Node
interface and adds support for retrieving and setting attributes
either as nodes or as strings.
Notes:
Node.ELEMENT_NODE
To speed up implementation, all attributes are implemented as double-linked
list implemented using NodeImpl#_parent
, NodeImpl#_nextNode
and
NodeImpl#_prevNode
. This support is provided to through getNamedAttr(java.lang.String)
, appendAttr(org.ozoneDB.xml.dom.AttrProxy)
and removeAttr(org.ozoneDB.xml.dom.AttrProxy)
methods.
Element
,
Attr
,
NamedNodeMap
,
AttrImpl
,
Serialized FormField Summary |
Fields inherited from class org.ozoneDB.xml.dom.NodeImpl |
ATTLIST_DECL_NODE, ELEMENT_DECL_NODE, PARAM_ENTITY_NODE |
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Constructor Summary | |
ElementImpl()
|
|
ElementImpl(DocumentImpl owner,
java.lang.String name)
Constructor requires only owner document and tag name of element. |
Method Summary | |
AttrProxy |
appendAttr(AttrProxy newAttr)
Append newAttr as the last attribute of this element. |
java.lang.Object |
clone()
|
void |
cloneInto(NodeProxy into,
boolean deep)
This clone method is called after a new node has been constructed to copy the contents of this node into the new one. |
org.w3c.dom.Node |
cloneNode(boolean deep)
|
java.util.Enumeration |
elements()
|
boolean |
equals(java.lang.Object other)
|
java.lang.String |
getAttribute(java.lang.String name)
|
org.w3c.dom.Attr |
getAttributeNode(java.lang.String name)
|
org.w3c.dom.Attr |
getAttributeNodeNS(java.lang.String namespaceURI,
java.lang.String localName)
|
java.lang.String |
getAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
|
org.w3c.dom.NamedNodeMap |
getAttributes()
Return attributes of node. |
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String tagName)
Returns a list of elements extracted based on their tag name (or all of them if the tag name is "*"). |
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
|
int |
getLength()
|
org.w3c.dom.Attr |
getNamedAttr(java.lang.String name)
Returns the named attribute or null if attribute not found. |
org.w3c.dom.Node |
getNamedItem(java.lang.String name)
|
org.w3c.dom.Node |
getNamedItemNS(java.lang.String namespaceURI,
java.lang.String localName)
|
short |
getNodeType()
Abstract method must be implemented by each node class. |
java.lang.String |
getTagName()
Returns the name of the tag, same as calling NodeImpl.getNodeName() .
|
boolean |
hasAttribute(java.lang.String name)
|
boolean |
hasAttributeNS(java.lang.String namespaceURI,
java.lang.String localname)
|
boolean |
hasAttributes()
|
void |
init(NodeProxy owner,
java.util.Dictionary dictionary)
|
org.w3c.dom.Node |
item(int index)
|
void |
normalize()
|
void |
onDelete()
|
void |
readExternal(java.io.ObjectInput in)
|
AttrProxy |
removeAttr(AttrProxy oldAttr)
Remove oldAttr from this element. |
void |
removeAttribute(java.lang.String name)
|
org.w3c.dom.Attr |
removeAttributeNode(org.w3c.dom.Attr oldAttr)
|
void |
removeAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
|
org.w3c.dom.Node |
removeNamedItem(java.lang.String name)
|
org.w3c.dom.Node |
removeNamedItemNS(java.lang.String namespaceURI,
java.lang.String localName)
|
void |
setAttrCount(int count)
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
|
org.w3c.dom.Attr |
setAttributeNode(org.w3c.dom.Attr newAttr)
|
org.w3c.dom.Attr |
setAttributeNodeNS(org.w3c.dom.Attr newAttr)
|
void |
setAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName,
java.lang.String value)
|
void |
setFirstAttr(org.w3c.dom.Attr attribute)
|
void |
setLastAttr(org.w3c.dom.Attr attribute)
|
org.w3c.dom.Node |
setNamedItem(org.w3c.dom.Node arg)
|
org.w3c.dom.Node |
setNamedItemNS(org.w3c.dom.Node arg)
|
void |
setNodeValue(java.lang.String value)
Changes the value of the node. |
protected boolean |
supportsChildern()
|
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.ozoneDB.xml.dom.NodeImpl |
appendChild, castNewChild, castOldChild, getChild, getChildCount, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, init, insertBefore, isReadOnly, isSupported, notifyIterators, removeChild, replaceChild, setNextSibling, setNodeName, setOwnerDocument, setParentNode, setPrefix, setPreviousSibling, setReadOnly, supports |
Methods inherited from class org.ozoneDB.OzoneObject |
container, database, deleteRecursive, getHandle, getObjectID, handle, hashCode, onActivate, onCreate, onPassivate, requireWriteLocking, self, setContainer, toXML |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy |
getObjectID |
Methods inherited from interface org.w3c.dom.Node |
appendChild, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, insertBefore, isSupported, removeChild, replaceChild, setPrefix |
Methods inherited from interface org.ozoneDB.xml.dom.NodeProxy |
getChild, getChildCount, getChildNodes, init, isReadOnly, setNextSibling, setNodeName, setOwnerDocument, setParentNode, setPreviousSibling, setReadOnly |
Constructor Detail |
public ElementImpl(DocumentImpl owner, java.lang.String name)
owner
- Owner document of this elementname
- The tag name of the elementpublic ElementImpl()
Method Detail |
public org.w3c.dom.Node getNamedItemNS(java.lang.String namespaceURI, java.lang.String localName)
getNamedItemNS
in interface org.w3c.dom.NamedNodeMap
public org.w3c.dom.Node setNamedItemNS(org.w3c.dom.Node arg) throws org.w3c.dom.DOMException
setNamedItemNS
in interface org.w3c.dom.NamedNodeMap
org.w3c.dom.DOMException
public org.w3c.dom.Node removeNamedItemNS(java.lang.String namespaceURI, java.lang.String localName) throws org.w3c.dom.DOMException
removeNamedItemNS
in interface org.w3c.dom.NamedNodeMap
org.w3c.dom.DOMException
public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
getAttributeNodeNS
in interface org.w3c.dom.Element
public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr) throws org.w3c.dom.DOMException
setAttributeNodeNS
in interface org.w3c.dom.Element
org.w3c.dom.DOMException
public java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
getAttributeNS
in interface org.w3c.dom.Element
public void setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value) throws org.w3c.dom.DOMException
setAttributeNS
in interface org.w3c.dom.Element
org.w3c.dom.DOMException
public void removeAttributeNS(java.lang.String namespaceURI, java.lang.String localName) throws org.w3c.dom.DOMException
removeAttributeNS
in interface org.w3c.dom.Element
org.w3c.dom.DOMException
public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
getElementsByTagNameNS
in interface org.w3c.dom.Element
public boolean hasAttributes()
hasAttributes
in interface org.w3c.dom.Node
hasAttributes
in class NodeImpl
public boolean hasAttribute(java.lang.String name)
hasAttribute
in interface org.w3c.dom.Element
public boolean hasAttributeNS(java.lang.String namespaceURI, java.lang.String localname)
hasAttributeNS
in interface org.w3c.dom.Element
public final short getNodeType()
NodeImpl
getNodeType
in interface org.w3c.dom.Node
getNodeType
in class NodeImpl
Node.getNodeType()
public final java.util.Enumeration elements()
elements
in interface NamedNodeMapProxy
public void setFirstAttr(org.w3c.dom.Attr attribute)
setFirstAttr
in interface ElementProxy
public void setLastAttr(org.w3c.dom.Attr attribute)
setLastAttr
in interface ElementProxy
public void setAttrCount(int count)
setAttrCount
in interface ElementProxy
public final java.lang.String getTagName()
NodeImpl.getNodeName()
.
In XML documents, the return value preserves case. In HTML documents,
the return value is always upper case regardless of the original value.
getTagName
in interface org.w3c.dom.Element
public final void setNodeValue(java.lang.String value)
NodeImpl
Element Not supported Attr Value supported Text Value supported CDATASection Value supported EntityReference Not supported Entity Not supported ProcessingInstruction Value supported Comment Value supported Document Not supported DocumentType Not supported DocumentFragment Not supported Notation Not supportedFor most node types, if the value is set to null,
NodeImpl.getNodeValue()
will return an empty string instead.
setNodeValue
in interface org.w3c.dom.Node
setNodeValue
in class NodeImpl
value
- New value of nodepublic final org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagName)
getElementsByTagName
in interface org.w3c.dom.Element
tagName
- The element tag name to look for or "*" for all elements
public final void normalize()
normalize
in interface org.w3c.dom.Node
normalize
in class NodeImpl
public final org.w3c.dom.NamedNodeMap getAttributes()
NodeImpl
Element
, in which case the returned NamedNodeMap
will provide access to all the element's
attributes.
getAttributes
in interface org.w3c.dom.Node
getAttributes
in class NodeImpl
public final java.lang.String getAttribute(java.lang.String name)
getAttribute
in interface org.w3c.dom.Element
public final void setAttribute(java.lang.String name, java.lang.String value) throws org.w3c.dom.DOMException
setAttribute
in interface org.w3c.dom.Element
org.w3c.dom.DOMException
public final void removeAttribute(java.lang.String name)
removeAttribute
in interface org.w3c.dom.Element
public final org.w3c.dom.Attr getAttributeNode(java.lang.String name)
getAttributeNode
in interface org.w3c.dom.Element
public final org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr) throws org.w3c.dom.DOMException
setAttributeNode
in interface org.w3c.dom.Element
org.w3c.dom.DOMException
public final org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
removeAttributeNode
in interface org.w3c.dom.Element
public final org.w3c.dom.Node getNamedItem(java.lang.String name)
getNamedItem
in interface NamedNodeMapProxy
public final org.w3c.dom.Node setNamedItem(org.w3c.dom.Node arg) throws org.w3c.dom.DOMException
setNamedItem
in interface org.w3c.dom.NamedNodeMap
org.w3c.dom.DOMException
public final org.w3c.dom.Node removeNamedItem(java.lang.String name) throws org.w3c.dom.DOMException
removeNamedItem
in interface org.w3c.dom.NamedNodeMap
org.w3c.dom.DOMException
public final org.w3c.dom.Node item(int index)
item
in interface org.w3c.dom.NamedNodeMap
public int getLength()
getLength
in interface ElementProxy
public boolean equals(java.lang.Object other)
public final java.lang.Object clone()
public final org.w3c.dom.Node cloneNode(boolean deep)
cloneNode
in interface org.w3c.dom.Node
public java.lang.String toString()
public void cloneInto(NodeProxy into, boolean deep)
NodeImpl
OzoneObject.equals(java.lang.Object)
).
into must be a valid node of the exact same class as this one. deep is true if deep cloning (includes all children nodes) is to be performed. If deep is false, the clone might not pass the equality test.
Derived classes override and call this method to add per-class variable
copying. This method is called by Node.cloneNode(boolean)
and the default
Object.clone()
method.
Contents cloning duplicates the node's name and value, and its children. It does not duplicate it's context, that is, the node's parent or sibling. Initially a clone node has no parents or siblings. However, the node does belong to the same document, since all nodes must belong to some document. The cloned node is never read-only.
cloneInto
in interface NodeProxy
cloneInto
in class NodeImpl
into
- A node into which to duplicate this onedeep
- True if deep cloning is requiredprotected boolean supportsChildern()
public final org.w3c.dom.Attr getNamedAttr(java.lang.String name)
getNamedAttr
in interface ElementProxy
name
- The name of the attribute to return
public final AttrProxy appendAttr(AttrProxy newAttr)
appendAttr
in interface ElementProxy
newAttr
- The new attribute to add
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR
Node is read-only and cannot be modified
org.w3c.dom.DOMException
- WRONG_DOCUMENT_ERR
newAttr is not an attribute in this DOM
org.w3c.dom.DOMException
- INUSE_ATTRIBUTE_ERR
newAttr is already in use by some other elementpublic final AttrProxy removeAttr(AttrProxy oldAttr) throws org.w3c.dom.DOMException
oldAttr
- The attribute to remove
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR
Node is read-only and cannot be modified
org.w3c.dom.DOMException
- NOT_FOUND_ERR
oldAttr is not an attribute of this elementpublic void init(NodeProxy owner, java.util.Dictionary dictionary)
init
in interface NamedNodeMapProxy
public void onDelete()
onDelete
in interface org.ozoneDB.OzoneCompatible
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class NodeImpl
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class NodeImpl
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |