|
|||||||||
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
Field Summary | |
static short |
ATTLIST_DECL_NODE
Attributes list declaration node. |
static short |
ELEMENT_DECL_NODE
Element declaration node. |
static short |
PARAM_ENTITY_NODE
Parameter entity declaration 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 | |
protected |
NodeImpl()
|
protected |
NodeImpl(DocumentImpl owner,
java.lang.String name,
java.lang.String value,
boolean checkName)
Hidden constructor creates a new node. |
Method Summary | |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Insert newChild as the last child of this parent. |
protected org.w3c.dom.Node |
castNewChild(org.w3c.dom.Node newChild)
Checks whether newChild can be added to this node as a child, and if so, performs a necessary cast. |
protected org.w3c.dom.Node |
castOldChild(org.w3c.dom.Node oldChild)
Checks whether oldChild is a direct child of this node, and if so, performs a necessary cast. |
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.NamedNodeMap |
getAttributes()
Return attributes of node. |
org.w3c.dom.Node |
getChild(int index)
Returns the index-th child of this node. |
int |
getChildCount()
Returns the number of children in this node. |
org.w3c.dom.NodeList |
getChildNodes()
Returns a NodeList object that can be used to traverse
this node's children. |
org.w3c.dom.Node |
getFirstChild()
Returns the first child of the node. |
org.w3c.dom.Node |
getLastChild()
Returns the last child of the node. |
java.lang.String |
getLocalName()
|
java.lang.String |
getNamespaceURI()
|
org.w3c.dom.Node |
getNextSibling()
Returns the next sibling of this node. |
java.lang.String |
getNodeName()
Returns the name of the node, set from the constructor. |
abstract short |
getNodeType()
Abstract method must be implemented by each node class. |
java.lang.String |
getNodeValue()
Returns the value of the node. |
org.w3c.dom.Document |
getOwnerDocument()
|
org.w3c.dom.Node |
getParentNode()
Returns the parent node of this node. |
java.lang.String |
getPrefix()
|
org.w3c.dom.Node |
getPreviousSibling()
Returns the previous sibling of this node. |
boolean |
hasAttributes()
|
boolean |
hasChildNodes()
Return true if there are any childern to this node. |
void |
init(DocumentProxy owner,
java.lang.String name,
java.lang.String value,
boolean checkName)
|
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Insert newChild in this parent, before the existing child refChild. |
boolean |
isReadOnly()
Returns true if node is read-only and cannot be modified, or if node belongs to a read-only document. |
boolean |
isSupported(java.lang.String s,
java.lang.String s1)
|
void |
normalize()
|
protected void |
notifyIterators(org.w3c.dom.Node removedChild)
Called to notify all the iterators created from this node that a child of this node has been removed. |
void |
readExternal(java.io.ObjectInput in)
|
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Remove oldChild from this parent. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replace oldChild with newChild, adding the new child and removing the old one. |
void |
setNextSibling(org.w3c.dom.Node nextNode)
|
void |
setNodeName(java.lang.String nodeName)
|
void |
setNodeValue(java.lang.String value)
Changes the value of the node. |
void |
setOwnerDocument(org.w3c.dom.Document owner)
|
void |
setParentNode(org.w3c.dom.Node newParent)
|
void |
setPrefix(java.lang.String prefix)
|
void |
setPreviousSibling(org.w3c.dom.Node prevNode)
|
void |
setReadOnly()
Renders this node read only, preventing it's contents from being modified. |
boolean |
supports(java.lang.String feature,
java.lang.String version)
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class org.ozoneDB.OzoneObject |
container, database, deleteRecursive, equals, getHandle, getObjectID, handle, hashCode, onActivate, onCreate, onDelete, onPassivate, requireWriteLocking, self, setContainer, toString, toXML |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy |
getObjectID |
Methods inherited from interface org.w3c.dom.Node |
cloneNode |
Field Detail |
public static final short ELEMENT_DECL_NODE
public static final short ATTLIST_DECL_NODE
public static final short PARAM_ENTITY_NODE
ParamEntity
).
Constructor Detail |
protected NodeImpl(DocumentImpl owner, java.lang.String name, java.lang.String value, boolean checkName) throws org.w3c.dom.DOMException
DocumentImpl
in which case the document itself becomes its
owner. Name must be supplied, either dynamic or static (e.g. "#document#").
If checkName is true, the supplied named is assumed to be a valid XML name token, one that can contain any Unicode letter and digit, must start with a letter, and may also contain hyphen, underscore, digit or colon.
owner
- Document owner of this node, or nullname
- Name of nodevalue
- Initial value of node or nullcheckName
- True if name is an XML name token
org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR
Node name cannot contain whitespaces or non-printable charactersprotected NodeImpl()
Method Detail |
public boolean supports(java.lang.String feature, java.lang.String version)
public void normalize()
normalize
in interface org.w3c.dom.Node
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface org.w3c.dom.Node
public java.lang.String getPrefix()
getPrefix
in interface org.w3c.dom.Node
public void setPrefix(java.lang.String prefix) throws org.w3c.dom.DOMException
setPrefix
in interface org.w3c.dom.Node
org.w3c.dom.DOMException
public java.lang.String getLocalName()
getLocalName
in interface org.w3c.dom.Node
public abstract short getNodeType()
getNodeType
in interface org.w3c.dom.Node
Node.getNodeType()
public final java.lang.String getNodeName()
getNodeName
in interface org.w3c.dom.Node
Node.getNodeName()
public final void setNodeName(java.lang.String nodeName)
setNodeName
in interface NodeProxy
public final java.lang.String getNodeValue()
Text
),
or always null is node has no notion of a value (e.g. Element
). For complete list of which node types will return
what, see setNodeValue(java.lang.String)
.
getNodeValue
in interface org.w3c.dom.Node
public void setNodeValue(java.lang.String value)
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,
getNodeValue()
will return an empty string instead.
setNodeValue
in interface org.w3c.dom.Node
value
- New value of node
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR
Node is read-only and cannot be modified
org.w3c.dom.DOMException
- NO_DATA_ALLOWED_ERR
This node does not support a valuepublic org.w3c.dom.Node getParentNode()
Document
node is always
parentless.
getParentNode
in interface org.w3c.dom.Node
public void setParentNode(org.w3c.dom.Node newParent)
setParentNode
in interface NodeProxy
protected void notifyIterators(org.w3c.dom.Node removedChild)
The removed node is a direct child of this node. Affected iterators are those that point at the document tree directly below this node, or the tree below one of its parents. Other iterators are not affected by the change. This method also performs a notification on all the parents of this node.
removedChild
- The child node being removedpublic org.w3c.dom.NodeList getChildNodes()
NodeList
object that can be used to traverse
this node's children. The node list is live, so every change to this node
is reflected in it.
If children are not supported by the derived class, an exception is thrown.
getChildNodes
in interface NodeProxy
NodeList
on this node
org.w3c.dom.DOMException
- HIERARCHY_REQUEST_ERR Childern not supported
by this node typeNodeList
,
NodeListImpl
public final org.w3c.dom.Node getFirstChild()
getFirstChild
in interface org.w3c.dom.Node
public final org.w3c.dom.Node getLastChild()
getLastChild
in interface org.w3c.dom.Node
public org.w3c.dom.Node getPreviousSibling()
getPreviousSibling
in interface org.w3c.dom.Node
public void setPreviousSibling(org.w3c.dom.Node prevNode)
setPreviousSibling
in interface NodeProxy
public org.w3c.dom.Node getNextSibling()
getNextSibling
in interface org.w3c.dom.Node
public void setNextSibling(org.w3c.dom.Node nextNode)
setNextSibling
in interface NodeProxy
public org.w3c.dom.NamedNodeMap getAttributes()
Element
, in which case the returned NamedNodeMap
will provide access to all the element's
attributes.
getAttributes
in interface org.w3c.dom.Node
public boolean hasAttributes()
hasAttributes
in interface org.w3c.dom.Node
public final org.w3c.dom.Document getOwnerDocument()
getOwnerDocument
in interface org.w3c.dom.Node
public final boolean hasChildNodes()
hasChildNodes
in interface org.w3c.dom.Node
public final org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
If newChild is null, newChild does not belong to this DOM, or childern are not supported by this node type, an exception is thrown.
newChild is removed from its original parent before adding to this
parent. If newChild is a DocumentFragment
, all
its children are inserted one by one into this parent.
appendChild
in interface org.w3c.dom.Node
newChild
- The new child to add
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR
Node is read-only and cannot be modified
org.w3c.dom.DOMException
- HIERARCHY_REQUEST_ERR
Children are not supported by this node type, or newChild is not
a compatible type for this nodecastNewChild(org.w3c.dom.Node)
,
castOldChild(org.w3c.dom.Node)
public final org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
removeChild
in interface org.w3c.dom.Node
oldChild
- The child to remove
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR
Node is read-only and cannot be modified
org.w3c.dom.DOMException
- HIERARCHY_REQUEST_ERR
Children are not supported by this node type
org.w3c.dom.DOMException
- NOT_FOUND_ERR
oldChild is not a direct child of this nodecastOldChild(org.w3c.dom.Node)
public final org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
If newChild does not belong to this DOM, oldChild is not a direct child of this parent, or childern are not supported by this node type, an exception is thrown.
newChild is removed from its original parent before adding to this
parent. If newChild is a DocumentFragment
, all
its children are inserted one by one into this parent.
replaceChild
in interface org.w3c.dom.Node
newChild
- The new child to addoldChild
- The old child to take away
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR
Node is read-only and cannot be modified
org.w3c.dom.DOMException
- HIERARCHY_REQUEST_ERR
Children are not supported by this node type, or newChild is not
a compatible type for this node
org.w3c.dom.DOMException
- NOT_FOUND_ERR
oldChild is not a direct child of this nodecastNewChild(org.w3c.dom.Node)
,
castOldChild(org.w3c.dom.Node)
public final org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild) throws org.w3c.dom.DOMException
appendChild(org.w3c.dom.Node)
.
If newChild is null, newChild does not belong to this DOM, refChild is not a direct child of this node, or childern are not supported by this node type, an exception is thrown.
newChild is removed from its original parent before adding to this
parent. If newChild is a DocumentFragment
, all
its children are inserted one by one into this parent.
insertBefore
in interface org.w3c.dom.Node
newChild
- The new child to addrefChild
- Insert new child before this child, or insert at the end
if this child is null
org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR
Node is read-only and cannot be modified
org.w3c.dom.DOMException
- HIERARCHY_REQUEST_ERR
Children are not supported by this node type, or newChild is not
a compatible type for this node
org.w3c.dom.DOMException
- NOT_FOUND_ERR
oldChild is not null and not a direct child of this nodecastNewChild(org.w3c.dom.Node)
,
castOldChild(org.w3c.dom.Node)
protected org.w3c.dom.Node castNewChild(org.w3c.dom.Node newChild) throws org.w3c.dom.DOMException
The following rules govern the allowed newChild types:
Attr
, newChild must be either
a Text
or an EntityReference
DocumentType
, newChild must be
either an Entity
or a Notation
.
Element
, a CharacterData
derived type,
a DocumentFragment
, an EntityReference
or a ProcessingInstruction
.
newChild
- New child node
NodeImpl
org.w3c.dom.DOMException
- HIERARCHY_REQUEST_ERR
newChild is null, does not belong to this DOM, or its node type
is not supported for this parentprotected final org.w3c.dom.Node castOldChild(org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
oldChild
- Old child node
NodeImpl
org.w3c.dom.DOMException
- NOT_FOUND_ERR
oldChild is null, or not a direct child of this nodepublic void cloneInto(NodeProxy into, boolean deep)
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
into
- A node into which to duplicate this onedeep
- True if deep cloning is requiredpublic void setOwnerDocument(org.w3c.dom.Document owner)
setOwnerDocument
in interface NodeProxy
public final void setReadOnly()
setReadOnly
in interface NodeProxy
public final boolean isReadOnly()
isReadOnly
in interface NodeProxy
setReadOnly()
public final org.w3c.dom.Node getChild(int index)
NodeListImpl
.
getChild
in interface NodeProxy
index
- Index of child to retrieve
NodeListImpl.item(int)
public final int getChildCount()
NodeListImpl
.
getChildCount
in interface NodeProxy
NodeListImpl.getLength()
public final void init(DocumentProxy owner, java.lang.String name, java.lang.String value, boolean checkName) throws org.w3c.dom.DOMException
init
in interface NodeProxy
org.w3c.dom.DOMException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public boolean isSupported(java.lang.String s, java.lang.String s1)
isSupported
in interface org.w3c.dom.Node
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |