org.w3c.tidy
Class DOMCharacterDataImpl

java.lang.Object
  extended by org.w3c.tidy.DOMNodeImpl
      extended by org.w3c.tidy.DOMCharacterDataImpl
All Implemented Interfaces:
org.w3c.dom.CharacterData, org.w3c.dom.Node
Direct Known Subclasses:
DOMCommentImpl, DOMTextImpl

public class DOMCharacterDataImpl
extends DOMNodeImpl
implements org.w3c.dom.CharacterData

DOMCharacterDataImpl (c) 1998-2000 (W3C) MIT, INRIA, Keio University See Tidy.java for the copyright notice. Derived from HTML Tidy Release 4 Aug 2000

Version:
1.7, 1999/12/06 Tidy Release 30 Nov 1999, 1.8, 2000/01/22 Tidy Release 13 Jan 2000, 1.9, 2000/06/03 Tidy Release 30 Apr 2000, 1.10, 2000/07/22 Tidy Release 8 Jul 2000, 1.11, 2000/08/16 Tidy Release 4 Aug 2000
Author:
Dave Raggett , Andy Quick (translation to Java)

Field Summary
 
Fields inherited from class org.w3c.tidy.DOMNodeImpl
adaptee
 
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
protected DOMCharacterDataImpl(Node adaptee)
           
 
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.
 int getLength()
          The number of 16-bit units that are available through data and the substringData method below.
 void insertData(int offset, java.lang.String arg)
          Insert a string at the specified 16-bit unit offset.
 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)
           
 java.lang.String substringData(int offset, int count)
          Extracts a range of data from the node.
 
Methods inherited from class org.w3c.tidy.DOMNodeImpl
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, supports
 
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
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

DOMCharacterDataImpl

protected DOMCharacterDataImpl(Node adaptee)
Method Detail

getData

public java.lang.String getData()
                         throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
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.

Specified by:
getData in interface org.w3c.dom.CharacterData
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
See Also:
CharacterData.getData()

setData

public void setData(java.lang.String data)
             throws org.w3c.dom.DOMException
Specified by:
setData in interface org.w3c.dom.CharacterData
Throws:
org.w3c.dom.DOMException
See Also:
CharacterData.setData(java.lang.String)

getLength

public int getLength()
Description copied from interface: org.w3c.dom.CharacterData
The number of 16-bit units that are available through data and the substringData method below. This may have the value zero, i.e., CharacterData nodes may be empty.

Specified by:
getLength in interface org.w3c.dom.CharacterData
See Also:
CharacterData.getLength()

substringData

public java.lang.String substringData(int offset,
                                      int count)
                               throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
Extracts a range of data from the node.

Specified by:
substringData in interface org.w3c.dom.CharacterData
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:
org.w3c.dom.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.
See Also:
CharacterData.substringData(int, int)

appendData

public void appendData(java.lang.String arg)
                throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
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.

Specified by:
appendData in interface org.w3c.dom.CharacterData
Throws:
org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
See Also:
CharacterData.appendData(java.lang.String)

insertData

public void insertData(int offset,
                       java.lang.String arg)
                throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
Insert a string at the specified 16-bit unit offset.

Specified by:
insertData in interface org.w3c.dom.CharacterData
Throws:
org.w3c.dom.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.
See Also:
CharacterData.insertData(int, java.lang.String)

deleteData

public void deleteData(int offset,
                       int count)
                throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
Remove a range of 16-bit units from the node. Upon success, data and length reflect the change.

Specified by:
deleteData in interface org.w3c.dom.CharacterData
Throws:
org.w3c.dom.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.
See Also:
CharacterData.deleteData(int, int)

replaceData

public void replaceData(int offset,
                        int count,
                        java.lang.String arg)
                 throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.CharacterData
Replace the characters starting at the specified 16-bit unit offset with the specified string.

Specified by:
replaceData in interface org.w3c.dom.CharacterData
Throws:
org.w3c.dom.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.
See Also:
CharacterData.replaceData(int, int, java.lang.String)