|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.xml.NodeImpl
org.enhydra.xml.CharacterDataImpl
org.enhydra.xml.TextImpl
Namespaces are ignored in this implementation. The terms "tag name" and "node name" are always considered to be synonymous.
Field Summary |
Fields inherited from class org.enhydra.xml.NodeImpl |
firstChild, lastChild, nextSibling, nodeName, nodeValue, numChildren, ownerDocument, parent, previousSibling, type |
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 | |
TextImpl(org.w3c.dom.Node node)
Constructs a TextImpl from a given node,
as a Node |
|
TextImpl(java.lang.String value)
Constructs a TextImpl from the given node value. |
|
TextImpl(TextImpl node)
Constructs a TextImpl from the given node. |
Method Summary | |
org.w3c.dom.Node |
appendChild(org.w3c.dom.Node newChild)
Adds the node newChild to the end of the list of
children of this node. |
void |
appendData(java.lang.String arg)
Appends data to the node's value. |
protected void |
beginToString(java.lang.StringBuffer sb,
Indent indent)
Method beginToString for this class writes the value of this node (text).It should replace all special characters with their escape entitys. |
protected void |
checkNode(org.w3c.dom.Node node)
Check that the node is either null or an
NodeImpl . |
org.w3c.dom.Node |
cloneNode(boolean deep)
Returns a duplicate of this node. |
short |
compareDocumentPosition(org.w3c.dom.Node other)
|
void |
deleteData(int offset,
int count)
Deletes characters from the node's value string. |
protected void |
endToString(java.lang.StringBuffer sb,
Indent indent)
Method endToString does nothing. |
org.w3c.dom.NamedNodeMap |
getAttributes()
Returns all attribute nodes of this node. |
java.lang.String |
getBaseURI()
|
org.w3c.dom.NodeList |
getChildNodes()
Returns all child nodes of this node, or null if
the node has no children. |
java.lang.String |
getData()
Returns node value. |
java.lang.Object |
getFeature(java.lang.String feature,
java.lang.String version)
|
org.w3c.dom.Node |
getFirstChild()
Returns the first child of this node, or null if
the node has no children. |
org.w3c.dom.Node |
getLastChild()
Returns the last child of this node, or null if
the node has no children. |
int |
getLength()
Returns number of child nodes. |
java.lang.String |
getLocalName()
Equivalent to getNodeName . |
java.lang.String |
getNamespaceURI()
Returns the namespace of the node. |
org.w3c.dom.Node |
getNextSibling()
Returns the next sibling of this node, or null if
the node has no next sibling. |
java.lang.String |
getNodeName()
Returns the name ("#text") associated with this node. |
short |
getNodeType()
Returns the node type. |
java.lang.String |
getNodeValue()
Returns the trimed node value associated with this node. |
org.w3c.dom.Document |
getOwnerDocument()
Returns null , since NodeImpl s
do not belong to any Document . |
org.w3c.dom.Node |
getParentNode()
Returns the parent of this node. |
java.lang.String |
getPrefix()
Returns null , since namespaces are not supported. |
org.w3c.dom.Node |
getPreviousSibling()
Returns the previous sibling of this node, or null
if this node has no previous sibling. |
java.lang.String |
getTextContent()
|
java.lang.Object |
getUserData(java.lang.String key)
|
java.lang.String |
getWholeText()
|
boolean |
hasAttributes()
Returns true , if this node has attributes, otherwise
false . |
boolean |
hasChildNodes()
Returns true if this node has child nodes. |
protected void |
initNodeImplChildren(org.w3c.dom.Node node)
Creates the children subtree and adds to this node. |
org.w3c.dom.Node |
insertBefore(org.w3c.dom.Node newChild,
org.w3c.dom.Node refChild)
Inserts the node newChild before the existing
child node refChild . |
void |
insertData(int offset,
java.lang.String arg)
Inserts substring into node's value string. |
boolean |
isDefaultNamespace(java.lang.String namespaceURI)
|
boolean |
isElementContentWhitespace()
|
boolean |
isEqualNode(org.w3c.dom.Node arg)
|
boolean |
isSameNode(org.w3c.dom.Node other)
|
boolean |
isSupported(java.lang.String feature,
java.lang.String version)
Returns false since DOM features are not
supported. |
org.w3c.dom.Node |
item(int index)
Returns child node with the given index. |
java.lang.String |
lookupNamespaceURI(java.lang.String prefix)
|
java.lang.String |
lookupPrefix(java.lang.String namespaceURI)
|
protected org.w3c.dom.Node |
newCommentInstance(org.w3c.dom.Node node)
Creates new instance of the CommentImpl class. |
protected org.w3c.dom.Node |
newDefaultInstance(org.w3c.dom.Node node)
Creates new instance of the NodeImpl class. |
protected org.w3c.dom.Node |
newElementInstance(org.w3c.dom.Node node)
Creates new instance of the ElementImpl class. |
protected org.w3c.dom.Node |
newTextInstance(org.w3c.dom.Node node)
Creates new instance of the TextImpl class. |
void |
normalize()
Does nothing, since NodeImpl s do not
contain Text children. |
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Removes the child node indicated by oldChild from
the list of children, and returns it. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replaces the child node oldChild with
newChild in the list of children, and returns the
oldChild node. |
void |
replaceData(int offset,
int count,
java.lang.String arg)
Replaces characters in the node's value string. |
org.w3c.dom.Text |
replaceWholeText(java.lang.String content)
|
void |
setData(java.lang.String data)
Sets the new value of this node. |
void |
setNodeValue(java.lang.String nodeValue)
Sets the node value of this node. |
void |
setPrefix(java.lang.String prefix)
Does nothing, since namespaces are not supported. |
void |
setTextContent(java.lang.String textContent)
|
java.lang.Object |
setUserData(java.lang.String key,
java.lang.Object data,
UserDataHandler handler)
|
org.w3c.dom.Text |
splitText(int offset)
|
java.lang.String |
substringData(int offset,
int count)
Returns the substring from the node's value. |
java.lang.String |
toString()
Returns String representation of this node. |
java.lang.String |
toString(java.lang.String tab)
Returns String representation of this node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TextImpl(TextImpl node)
TextImpl
from the given node.
node
- , as a TextImpl
.public TextImpl(java.lang.String value)
TextImpl
from the given node value.
value
- , as a String
.public TextImpl(org.w3c.dom.Node node)
TextImpl
from a given node,
as a Node
node
- , as Node
.Method Detail |
public short getNodeType()
getNodeType
in interface org.w3c.dom.Node
getNodeType
in class NodeImpl
TEXT_NODE
node type.public java.lang.String getNodeName()
getNodeName
in interface org.w3c.dom.Node
getNodeName
in class NodeImpl
String
.public java.lang.String getNodeValue() throws org.w3c.dom.DOMException
getNodeValue
in interface org.w3c.dom.Node
getNodeValue
in class NodeImpl
String
.
org.w3c.dom.DOMException
protected void beginToString(java.lang.StringBuffer sb, Indent indent)
beginToString
in class NodeImpl
sb
- string buffer to add resulting string.indent
- used in formating the output.protected void endToString(java.lang.StringBuffer sb, Indent indent)
endToString
in class NodeImpl
sb
- is StringBufferindent
- is indentationpublic org.w3c.dom.Text splitText(int offset) throws org.w3c.dom.DOMException
splitText
in interface org.w3c.dom.Text
offset
- The offset at which to split. If offset is at the
end of the available data, the second node will be empty.
DOMException(INDEX_SIZE_ERR)
- if offset is <0 or >length.
org.w3c.dom.DOMException
- (NO_MODIFICATION_ALLOWED_ERR) if node is read-only.Break a text node into two sibling nodes. (Note that if the
current node has no parent, they won't wind up as "siblings" --
they'll both be orphans.)
public java.lang.String getWholeText()
public boolean isElementContentWhitespace()
public org.w3c.dom.Text replaceWholeText(java.lang.String content) throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
public void appendData(java.lang.String arg)
CharacterDataImpl
appendData
in interface org.w3c.dom.CharacterData
appendData
in class CharacterDataImpl
arg
- the data to append to the node's value.CharacterData.appendData(String).
public void deleteData(int offset, int count) throws org.w3c.dom.DOMException
CharacterDataImpl
deleteData
in interface org.w3c.dom.CharacterData
deleteData
in class CharacterDataImpl
offset
- the begin index of the substring.count
- the number of characters.
org.w3c.dom.DOMException
CharacterData.deleteData(int, int).
public java.lang.String getData() throws org.w3c.dom.DOMException
CharacterDataImpl
getData
in interface org.w3c.dom.CharacterData
getData
in class CharacterDataImpl
String
.
org.w3c.dom.DOMException
CharacterData.getData().
public java.lang.String getNamespaceURI()
CharacterDataImpl
getNamespaceURI
in interface org.w3c.dom.Node
getNamespaceURI
in class CharacterDataImpl
Node.getNamespaceURI().
public void insertData(int offset, java.lang.String arg) throws org.w3c.dom.DOMException
CharacterDataImpl
insertData
in interface org.w3c.dom.CharacterData
insertData
in class CharacterDataImpl
offset
- the begin index of the substring.arg
- the String
to insert.
org.w3c.dom.DOMException
CharacterData.insertData(int, String).
public void replaceData(int offset, int count, java.lang.String arg) throws org.w3c.dom.DOMException
CharacterDataImpl
replaceData
in interface org.w3c.dom.CharacterData
replaceData
in class CharacterDataImpl
offset
- the begin index of the substring.count
- the number of characters.arg
- the String
to insert.
org.w3c.dom.DOMException
CharacterData.replaceData(int, int, String).
public void setData(java.lang.String data) throws org.w3c.dom.DOMException
CharacterDataImpl
setData
in interface org.w3c.dom.CharacterData
setData
in class CharacterDataImpl
data
- the new data
org.w3c.dom.DOMException
CharacterData.setData(String).
public java.lang.String substringData(int offset, int count) throws org.w3c.dom.DOMException
CharacterDataImpl
substringData
in interface org.w3c.dom.CharacterData
substringData
in class CharacterDataImpl
offset
- the begin index of the substring.count
- the number of characters.
org.w3c.dom.DOMException
CharacterData.substringData(int, int).
public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
NodeImpl
newChild
to the end of the list of
children of this node.
appendChild
in interface org.w3c.dom.Node
appendChild
in class NodeImpl
newChild
- the Node
to insert.
protected void checkNode(org.w3c.dom.Node node) throws org.w3c.dom.DOMException
NodeImpl
null
or an
NodeImpl
.
checkNode
in class NodeImpl
node
- , as a Node
.
org.w3c.dom.DOMException
- if node is not an instance of NodeImpl
.public org.w3c.dom.Node cloneNode(boolean deep)
NodeImpl
getParentNode
returns null
).
If a shallow clone is being performed (deep
is
false
), the new node will not have any children or
siblings. If a deep clone is being performed, the new node
will form the root of a complete cloned subtree.
cloneNode
in interface org.w3c.dom.Node
cloneNode
in class NodeImpl
deep
- if true
, recursively clone the subtree
under the specified node; if false
, clone only the
node itself.
public short compareDocumentPosition(org.w3c.dom.Node other) throws org.w3c.dom.DOMException
compareDocumentPosition
in class NodeImpl
org.w3c.dom.DOMException
public org.w3c.dom.NamedNodeMap getAttributes()
NodeImpl
getAttributes
in interface org.w3c.dom.Node
getAttributes
in class NodeImpl
public java.lang.String getBaseURI()
getBaseURI
in class NodeImpl
public org.w3c.dom.NodeList getChildNodes()
NodeImpl
null
if
the node has no children.
getChildNodes
in interface org.w3c.dom.Node
getChildNodes
in class NodeImpl
Node
, or
null
.public java.lang.Object getFeature(java.lang.String feature, java.lang.String version)
getFeature
in class NodeImpl
public org.w3c.dom.Node getFirstChild()
NodeImpl
null
if
the node has no children.
getFirstChild
in interface org.w3c.dom.Node
getFirstChild
in class NodeImpl
Node
, or
null
public org.w3c.dom.Node getLastChild()
NodeImpl
null
if
the node has no children.
getLastChild
in interface org.w3c.dom.Node
getLastChild
in class NodeImpl
Node
, or
null
.public int getLength()
NodeImpl
getLength
in interface org.w3c.dom.CharacterData
getLength
in class NodeImpl
public java.lang.String getLocalName()
NodeImpl
getNodeName
.
getLocalName
in interface org.w3c.dom.Node
getLocalName
in class NodeImpl
String
.public org.w3c.dom.Node getNextSibling()
NodeImpl
null
if
the node has no next sibling.
getNextSibling
in interface org.w3c.dom.Node
getNextSibling
in class NodeImpl
Node
, or
null
.public org.w3c.dom.Document getOwnerDocument()
NodeImpl
null
, since NodeImpl
s
do not belong to any Document
.
getOwnerDocument
in interface org.w3c.dom.Node
getOwnerDocument
in class NodeImpl
Document
.public org.w3c.dom.Node getParentNode()
NodeImpl
null
value
indicates that the node is the root of its own tree. To add a
node to an existing tree, use one of the
insertBefore
, replaceChild
, or
appendChild
methods.
getParentNode
in interface org.w3c.dom.Node
getParentNode
in class NodeImpl
Node
.NodeImpl.insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
,
NodeImpl.replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
,
NodeImpl.appendChild(org.w3c.dom.Node)
public java.lang.String getPrefix()
NodeImpl
null
, since namespaces are not supported.
getPrefix
in interface org.w3c.dom.Node
getPrefix
in class NodeImpl
null
.NodeImpl.setPrefix(java.lang.String)
public org.w3c.dom.Node getPreviousSibling()
NodeImpl
null
if this node has no previous sibling.
getPreviousSibling
in interface org.w3c.dom.Node
getPreviousSibling
in class NodeImpl
Node
, or
null
.public java.lang.String getTextContent() throws org.w3c.dom.DOMException
getTextContent
in class NodeImpl
org.w3c.dom.DOMException
public java.lang.Object getUserData(java.lang.String key)
getUserData
in class NodeImpl
public boolean hasAttributes()
NodeImpl
true
, if this node has attributes, otherwise
false
.
hasAttributes
in interface org.w3c.dom.Node
hasAttributes
in class NodeImpl
true
if node has attributes, otherwise false
..public boolean hasChildNodes()
NodeImpl
true
if this node has child nodes.
hasChildNodes
in interface org.w3c.dom.Node
hasChildNodes
in class NodeImpl
true
if this node has children.protected void initNodeImplChildren(org.w3c.dom.Node node)
NodeImpl
initNodeImplChildren
in class NodeImpl
node
- a Node
.public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
NodeImpl
newChild
before the existing
child node refChild
. If refChild
is
null
, insert newChild
at the end of
the list of children.
insertBefore
in interface org.w3c.dom.Node
insertBefore
in class NodeImpl
newChild
- the Node
to insert.refChild
- the reference Node
.
public boolean isDefaultNamespace(java.lang.String namespaceURI)
isDefaultNamespace
in class NodeImpl
public boolean isEqualNode(org.w3c.dom.Node arg)
isEqualNode
in class NodeImpl
public boolean isSameNode(org.w3c.dom.Node other)
isSameNode
in class NodeImpl
public boolean isSupported(java.lang.String feature, java.lang.String version)
NodeImpl
false
since DOM features are not
supported.
isSupported
in interface org.w3c.dom.Node
isSupported
in class NodeImpl
feature
- a String
, which is ignored.version
- a String
, which is ignored.
false
.public org.w3c.dom.Node item(int index)
NodeImpl
item
in interface org.w3c.dom.NodeList
item
in class NodeImpl
index
- represents index
public java.lang.String lookupNamespaceURI(java.lang.String prefix)
lookupNamespaceURI
in class NodeImpl
public java.lang.String lookupPrefix(java.lang.String namespaceURI)
lookupPrefix
in class NodeImpl
protected org.w3c.dom.Node newCommentInstance(org.w3c.dom.Node node)
NodeImpl
newCommentInstance
in class NodeImpl
node
- , as a Node
.
protected org.w3c.dom.Node newDefaultInstance(org.w3c.dom.Node node)
NodeImpl
newDefaultInstance
in class NodeImpl
node
- , as a Node
.
protected org.w3c.dom.Node newElementInstance(org.w3c.dom.Node node)
NodeImpl
newElementInstance
in class NodeImpl
node
- , as a Node
.
protected org.w3c.dom.Node newTextInstance(org.w3c.dom.Node node)
NodeImpl
newTextInstance
in class NodeImpl
node
- , as a Node
.
public void normalize()
NodeImpl
NodeImpl
s do not
contain Text
children.
normalize
in interface org.w3c.dom.Node
normalize
in class NodeImpl
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
NodeImpl
oldChild
from
the list of children, and returns it.
removeChild
in interface org.w3c.dom.Node
removeChild
in class NodeImpl
oldChild
- the Node
to be removed.
public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
NodeImpl
oldChild
with
newChild
in the list of children, and returns the
oldChild
node.
replaceChild
in interface org.w3c.dom.Node
replaceChild
in class NodeImpl
newChild
- the Node
to insert.oldChild
- the Node
to be replaced.
public void setNodeValue(java.lang.String nodeValue)
NodeImpl
setNodeValue
in interface org.w3c.dom.Node
setNodeValue
in class NodeImpl
nodeValue
- new node value, as a String
.public void setPrefix(java.lang.String prefix)
NodeImpl
setPrefix
in interface org.w3c.dom.Node
setPrefix
in class NodeImpl
prefix
- a String
, which is ignored.NodeImpl.getPrefix()
public void setTextContent(java.lang.String textContent) throws org.w3c.dom.DOMException
setTextContent
in class NodeImpl
org.w3c.dom.DOMException
public java.lang.Object setUserData(java.lang.String key, java.lang.Object data, UserDataHandler handler)
setUserData
in class NodeImpl
public java.lang.String toString()
NodeImpl
String
representation of this node.
toString
in class NodeImpl
String
representation of this node.public java.lang.String toString(java.lang.String tab)
NodeImpl
String
representation of this node.
toString
in class NodeImpl
tab
- tab for node indentation.
String
representation of this node.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |