org.eclipse.ercp.xml.dom
Class TextImpl

java.lang.Object
  extended by org.eclipse.ercp.xml.dom.NodeImpl
      extended by org.eclipse.ercp.xml.dom.NSNodeImpl
          extended by org.eclipse.ercp.xml.dom.TreeNode
              extended by org.eclipse.ercp.xml.dom.CharacterDataImpl
                  extended by org.eclipse.ercp.xml.dom.TextImpl
All Implemented Interfaces:
CharacterData, Node, NodeList, Text
Direct Known Subclasses:
CDATASectionImpl

public class TextImpl
extends CharacterDataImpl
implements Text


Field Summary
 
Fields inherited from class org.eclipse.ercp.xml.dom.CharacterDataImpl
data
 
Fields inherited from class org.eclipse.ercp.xml.dom.TreeNode
firstChild, lastChild, length, nextSibling, parentNode, previousSibling
 
Fields inherited from class org.eclipse.ercp.xml.dom.NSNodeImpl
localName, namespaceURI, prefix, qualifiedName
 
Fields inherited from class org.eclipse.ercp.xml.dom.NodeImpl
ownerDocument
 
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(DocumentImpl ownerDocument, java.lang.String data)
          Constructor for TextImpl
 
Method Summary
 Node cloneNode(boolean deep)
          Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
 java.lang.String getNodeName()
          The name of this node, depending on its type; see the table above.
 short getNodeType()
          A code representing the type of the underlying object, as defined above.
 Text splitText(int offset)
          Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings.
 
Methods inherited from class org.eclipse.ercp.xml.dom.CharacterDataImpl
appendData, deleteData, getData, getNodeValue, insertData, replaceData, setData, setNodeValue, substringData
 
Methods inherited from class org.eclipse.ercp.xml.dom.TreeNode
appendChild, getElementByTagName, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getLastChild, getLength, getNextSibling, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, item, normalize, removeChild, replaceChild
 
Methods inherited from class org.eclipse.ercp.xml.dom.NSNodeImpl
getLocalName, getNamespaceURI, getPrefix, setPrefix
 
Methods inherited from class org.eclipse.ercp.xml.dom.NodeImpl
getAttributes, getChildNodes, getOwnerDocument, hasAttributes, isSupported, spreadOwnerDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

TextImpl

public TextImpl(DocumentImpl ownerDocument,
                java.lang.String data)
Constructor for TextImpl

Method Detail

splitText

public Text splitText(int offset)
               throws DOMException
Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings. After being split, this node will contain all the content up to the offset point. A new node of the same type, which contains all the content at and after the offset point, is returned. If the original node had a parent node, the new node is inserted as the next sibling of the original node. When the offset is equal to the length of this node, the new node has no data.

Specified by:
splitText in interface Text
Parameters:
offsetThe - 16-bit unit offset at which to split, starting from 0.
Returns:
The new node, of the same type as this node.
Throws:
DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

getNodeType

public short getNodeType()
Description copied from interface: Node
A code representing the type of the underlying object, as defined above.

Specified by:
getNodeType in interface Node

getNodeName

public java.lang.String getNodeName()
Description copied from class: NSNodeImpl
The name of this node, depending on its type; see the table above.

Specified by:
getNodeName in interface Node
Overrides:
getNodeName in class NSNodeImpl

cloneNode

public Node cloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; ( parentNode is null.).
Cloning an Element copies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a child Text node. Cloning an Attribute directly, as opposed to be cloned as part of an Element cloning operation, returns a specified attribute ( specified is true). Cloning any other type of node simply returns a copy of this node.
Note that cloning an immutable subtree results in a mutable copy, but the children of an EntityReference clone are readonly . In addition, clones of unspecified Attr nodes are specified. And, cloning Document, DocumentType, Entity, and Notation nodes is implementation dependent.

Specified by:
cloneNode in interface Node
Parameters:
deepIf - true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element).
Returns:
The duplicate node.