org.eclipse.ercp.xml.dom
Class CharacterDataImpl

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
All Implemented Interfaces:
Node, NodeList
Direct Known Subclasses:
ProcessingInstructionImpl, TextImpl

public abstract class CharacterDataImpl
extends TreeNode


Field Summary
protected  java.lang.String 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
CharacterDataImpl(DocumentImpl ownerDocument, java.lang.String data)
          Constructor for CharacterDataImpl
 
Method Summary
 void appendData(java.lang.String arg)
          Append the string to the end of the character data of the node.
 void deleteData(int offset, int count)
          Remove a range of 16-bit units from the node.
 java.lang.String getData()
          The character data of the node that implements this interface.
 java.lang.String getNodeValue()
          The value of this node, depending on its type; see the table above.
 void insertData(int offset, java.lang.String arg)
          Remove a range of 16-bit units from the node.
 void replaceData(int offset, int count, java.lang.String arg)
          Replace the characters starting at the specified 16-bit unit offset with the specified string.
 void setData(java.lang.String data)
           
 void setNodeValue(java.lang.String nodeValue)
           
 java.lang.String substringData(int offset, int count)
          Extracts a range of data from the node.
 
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, getNodeName, 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.Node
cloneNode, getNodeType
 

Field Detail

data

protected java.lang.String data
Constructor Detail

CharacterDataImpl

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

Method Detail

getData

public java.lang.String getData()
                         throws DOMException
The character data of the node that implements this interface. The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a CharacterData node. However, implementation limits may mean that the entirety of a node's data may not fit into a single DOMString. In such cases, the user may call substringData to retrieve the data in appropriately sized pieces.

Throws:
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

setData

public void setData(java.lang.String data)
             throws DOMException
Throws:
DOMException

substringData

public java.lang.String substringData(int offset,
                                      int count)
                               throws DOMException
Extracts a range of data from the node.

Parameters:
offsetStart - offset of substring to extract.
countThe - number of 16-bit units to extract.
Returns:
The specified substring. If the sum of offset and count exceeds the length, then all 16-bit units to the end of the data are returned.
Throws:
DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
DOMSTRING_SIZE_ERR: Raised if the specified range of text does not fit into a DOMString.

appendData

public void appendData(java.lang.String arg)
                throws DOMException
Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the DOMString specified.

Parameters:
argThe - DOMString to append.
Throws:
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

insertData

public void insertData(int offset,
                       java.lang.String arg)
                throws DOMException
Remove a range of 16-bit units from the node. Upon success, data and length reflect the change.

Parameters:
offsetThe - offset from which to start removing.
countThe - number of 16-bit units to delete. If the sum of offset and count exceeds length then all 16-bit units from offset to the end of the data are deleted.
Throws:
DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

deleteData

public void deleteData(int offset,
                       int count)
                throws DOMException
Remove a range of 16-bit units from the node. Upon success, data and length reflect the change.

Parameters:
offsetThe - offset from which to start removing.
countThe - number of 16-bit units to delete. If the sum of offset and count exceeds length then all 16-bit units from offset to the end of the data are deleted.
Throws:
DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

replaceData

public void replaceData(int offset,
                        int count,
                        java.lang.String arg)
                 throws DOMException
Replace the characters starting at the specified 16-bit unit offset with the specified string.

Parameters:
offsetThe - offset from which to start replacing.
countThe - number of 16-bit units to replace. If the sum of offset and count exceeds length, then all 16-bit units to the end of the data are replaced; (i.e., the effect is the same as a remove method call with the same range, followed by an append method invocation).
argThe - DOMString with which the range must be replaced.
Throws:
DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

getNodeValue

public java.lang.String getNodeValue()
                              throws DOMException
The value of this node, depending on its type; see the table above. When it is defined to be null, setting it has no effect.

Specified by:
getNodeValue in interface Node
Overrides:
getNodeValue in class NodeImpl
Throws:
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

setNodeValue

public void setNodeValue(java.lang.String nodeValue)
                  throws DOMException
Specified by:
setNodeValue in interface Node
Overrides:
setNodeValue in class NodeImpl
Throws:
DOMException