EAF 7.6 Util

org.enhydra.xml
Class TextImpl

java.lang.Object
  extended by org.enhydra.xml.NodeImpl
      extended by org.enhydra.xml.CharacterDataImpl
          extended by org.enhydra.xml.TextImpl
All Implemented Interfaces:
org.w3c.dom.CharacterData, org.w3c.dom.Node, org.w3c.dom.NodeList, org.w3c.dom.Text

public class TextImpl
extends CharacterDataImpl
implements org.w3c.dom.Text

Version:
1.0
Author:
Tweety A class representing a node in a meta-data tree, which implements the

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_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, 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
protected  void beginToString(java.lang.StringBuffer sb, Indent indent)
          Method beginToString for this class writes the value of this node (text).
protected  void endToString(java.lang.StringBuffer sb, Indent indent)
          Method endToString does nothing.
 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.
 java.lang.String getWholeText()
           
 boolean isElementContentWhitespace()
           
 org.w3c.dom.Text replaceWholeText(java.lang.String arg0)
           
 org.w3c.dom.Text splitText(int offset)
           
 
Methods inherited from class org.enhydra.xml.CharacterDataImpl
appendData, deleteData, getData, getNamespaceURI, insertData, replaceData, setData, substringData
 
Methods inherited from class org.enhydra.xml.NodeImpl
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLength, getLocalName, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, initNodeImplChildren, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, newCommentInstance, newDefaultInstance, newElementInstance, newTextInstance, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.CharacterData
appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Constructor Detail

TextImpl

public TextImpl(TextImpl node)
Constructs a TextImpl from the given node.

Parameters:
node, - as a TextImpl.

TextImpl

public TextImpl(java.lang.String value)
Constructs a TextImpl from the given node value.

Parameters:
value, - as a String.

TextImpl

public TextImpl(org.w3c.dom.Node node)
Constructs a TextImpl from a given node, as a Node

Parameters:
node, - as Node.
Method Detail

getNodeType

public short getNodeType()
Returns the node type.

Specified by:
getNodeType in interface org.w3c.dom.Node
Overrides:
getNodeType in class NodeImpl
Returns:
the TEXT_NODE node type.

getNodeName

public java.lang.String getNodeName()
Returns the name ("#text") associated with this node.

Specified by:
getNodeName in interface org.w3c.dom.Node
Overrides:
getNodeName in class NodeImpl
Returns:
the name, as a String.

getNodeValue

public java.lang.String getNodeValue()
                              throws org.w3c.dom.DOMException
Returns the trimed node value associated with this node.

Specified by:
getNodeValue in interface org.w3c.dom.Node
Overrides:
getNodeValue in class NodeImpl
Returns:
the node value, as a String.
Throws:
org.w3c.dom.DOMException

beginToString

protected void beginToString(java.lang.StringBuffer sb,
                             Indent indent)
Method beginToString for this class writes the value of this node (text).

Overrides:
beginToString in class NodeImpl
Parameters:
sb - string buffer to add resulting string.
indent - used in formating the output.

endToString

protected void endToString(java.lang.StringBuffer sb,
                           Indent indent)
Method endToString does nothing.

Overrides:
endToString in class NodeImpl
Parameters:
sb - string buffer to add resulting string.
indent - used in formating the output.

splitText

public org.w3c.dom.Text splitText(int offset)
                           throws org.w3c.dom.DOMException
Specified by:
splitText in interface org.w3c.dom.Text
Parameters:
offset - The offset at which to split. If offset is at the end of the available data, the second node will be empty.
Throws:
DOMException(INDEX_SIZE_ERR) - if offset is <0 or >length.
DOMException(NO_MODIFICATION_ALLOWED_ERR) - if node is read-only.
org.w3c.dom.DOMException
See Also:
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.)

isElementContentWhitespace

public boolean isElementContentWhitespace()
Specified by:
isElementContentWhitespace in interface org.w3c.dom.Text

getWholeText

public java.lang.String getWholeText()
Specified by:
getWholeText in interface org.w3c.dom.Text

replaceWholeText

public org.w3c.dom.Text replaceWholeText(java.lang.String arg0)
                                  throws org.w3c.dom.DOMException
Specified by:
replaceWholeText in interface org.w3c.dom.Text
Throws:
org.w3c.dom.DOMException

EAF 7.6 Util