org.apache.batik.dom
Class CharacterDataWrapper

java.lang.Object
  |
  +--org.apache.batik.dom.NodeWrapper
        |
        +--org.apache.batik.dom.CharacterDataWrapper
All Implemented Interfaces:
CharacterData, EventTarget, Node
Direct Known Subclasses:
CommentWrapper, TextWrapper

public class CharacterDataWrapper
extends NodeWrapper
implements CharacterData

This class implements a wrapper for a CharacterData. All the methods of the underlying document are called in a single thread.


Fields inherited from class org.apache.batik.dom.NodeWrapper
bubblingListeners, capturingListeners, documentWrapper, 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
CharacterDataWrapper(DocumentWrapper dw, CharacterData cd)
          Creates a new CharacterDataWrapper object.
 
Method Summary
 void appendData(java.lang.String arg)
          DOM: Implements CharacterData.appendData(String).
 void deleteData(int offset, int count)
          DOM: Implements CharacterData.deleteData(int,int).
 java.lang.String getData()
          DOM: Implements CharacterData.getData().
 int getLength()
          DOM: Implements CharacterData.getLength().
 void insertData(int offset, java.lang.String arg)
          DOM: Implements CharacterData.insertData(int,String).
 void replaceData(int offset, int count, java.lang.String arg)
          DOM: Implements CharacterData.replaceData(int,int,String).
 void setData(java.lang.String data)
          DOM: Implements CharacterData.setData(String).
 java.lang.String substringData(int offset, int count)
          DOM: Implements CharacterData.substringData(int,int).
 
Methods inherited from class org.apache.batik.dom.NodeWrapper
addEventListener, appendChild, cloneNode, createAttrWrapper, createElementWrapper, createNamedNodeMapWrapper, createNodeListWrapper, createNodeWrapper, createTextWrapper, dispatchEvent, finalize, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, invokeAndWait, invokeLater, isSupported, normalize, removeChild, removeEventListener, replaceChild, setNodeValue, setPrefix
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

CharacterDataWrapper

public CharacterDataWrapper(DocumentWrapper dw,
                            CharacterData cd)
Creates a new CharacterDataWrapper object.
Method Detail

getData

public java.lang.String getData()
                         throws DOMException
DOM: Implements CharacterData.getData().
Specified by:
getData in interface CharacterData
Following copied from interface: org.w3c.dom.CharacterData
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
DOM: Implements CharacterData.setData(String).
Specified by:
setData in interface CharacterData

getLength

public int getLength()
DOM: Implements CharacterData.getLength().
Specified by:
getLength in interface CharacterData

substringData

public java.lang.String substringData(int offset,
                                      int count)
                               throws DOMException
DOM: Implements CharacterData.substringData(int,int).
Specified by:
substringData in interface CharacterData
Following copied from interface: org.w3c.dom.CharacterData
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
DOM: Implements CharacterData.appendData(String).
Specified by:
appendData in interface CharacterData
Following copied from interface: org.w3c.dom.CharacterData
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
DOM: Implements CharacterData.insertData(int,String).
Specified by:
insertData in interface CharacterData
Following copied from interface: org.w3c.dom.CharacterData
Parameters:
offsetThe - character offset at which to insert.
argThe - DOMString to insert.
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.

deleteData

public void deleteData(int offset,
                       int count)
                throws DOMException
DOM: Implements CharacterData.deleteData(int,int).
Specified by:
deleteData in interface CharacterData
Following copied from interface: org.w3c.dom.CharacterData
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
DOM: Implements CharacterData.replaceData(int,int,String).
Specified by:
replaceData in interface CharacterData
Following copied from interface: org.w3c.dom.CharacterData
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.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.