com.japisoft.fastparser.dom
Class TextImpl

java.lang.Object
  |
  +--com.japisoft.fastparser.node.SimpleNode
        |
        +--com.japisoft.fastparser.dom.NodeImpl
              |
              +--com.japisoft.fastparser.dom.CharacterDataImpl
                    |
                    +--com.japisoft.fastparser.dom.TextImpl
All Implemented Interfaces:
CharacterData, MutableNode, Node, Text, ViewableNode

public class TextImpl
extends CharacterDataImpl
implements Text

Text

Version:
1.0
Author:
(c) 2002-2003 JAPISOFT

Field Summary
 
Fields inherited from class com.japisoft.fastparser.dom.NodeImpl
nameSpaceURI
 
Fields inherited from class com.japisoft.fastparser.node.SimpleNode
COMMENT_NODE, TAG_NODE, TEXT_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
TextImpl(java.lang.String content)
           
 
Method Summary
 Text splitText(int offset)
          Breaks this Text node into two Text nodes at the specified offset, keeping both in the tree as siblings.
 
Methods inherited from class com.japisoft.fastparser.dom.CharacterDataImpl
appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData
 
Methods inherited from class com.japisoft.fastparser.dom.NodeImpl
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNamespaceURI, setNodeValue, setOwnerDocument, setPrefix
 
Methods inherited from class com.japisoft.fastparser.node.SimpleNode
addChildNode, addNameSpaceDeclaration, addNode, childAt, childCount, childNodeIndex, clone, getAllChild, getAttribute, getAttribute, getContent, getDefaultNamespace, getDocument, getLine, getNameSpaceDeclaration, getNameSpaceDeclarationURI, getNamespaceDeclared, getNameSpacePrefix, getNameSpaceURI, getNodeByCriteria, getNodeByName, getNodeContent, getNodeForXPathLocation, getSimpleParent, getType, getViewAttribute, getViewAttributes, getViewChildAt, getViewChildCount, getViewContent, getXPathLocation, getXPathLocation, hasAttribute, insertChildNode, isComment, isLeaf, isNamespaceDeclared, isRoot, isTag, isText, isViewComment, isViewLeaf, isViewText, removeChildNode, removeNameSpaceDeclaration, setAttribute, setContent, setDefaultNamespace, setDocument, setLine, setNameSpace, setNodeAttribute, setNodeContent, setNodeParent, setSimpleParent, setType, toString
 
Methods inherited from class java.lang.Object
equals, 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, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, removeChild, replaceChild, setNodeValue
 

Constructor Detail

TextImpl

public TextImpl(java.lang.String content)
Method Detail

splitText

public Text splitText(int offset)
               throws DOMException
Breaks this Text node into two Text nodes at the specified offset, keeping both in the tree as siblings. This node then only contains all the content up to the offset point. And a new Text node, which is inserted as the next sibling of this node, contains all the content at and after the offset point.

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