com.gargoylesoftware.htmlunit.html
Class DomCharacterData

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.html.DomNode
      extended by com.gargoylesoftware.htmlunit.html.DomCharacterData
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
DomCData, DomComment, DomText

public abstract class DomCharacterData
extends DomNode

Wrapper for the DOM node CharacterData.

Version:
$Revision: 2132 $
Author:
David K. Taylor, Christian Sell, Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode
DomNode.ChildIterator, DomNode.DescendantElementsIterator
 
Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE
 
Constructor Summary
DomCharacterData(Page page, String data)
          Create an instance of DomCharacterData
 
Method Summary
 void appendData(String newData)
          Append a string to character data.
 void deleteData(int offset, int count)
          Delete characters from character data.
 String getData()
          Get the data character string for this character data.
 int getLength()
          Get the number of characters in the character data.
 String getNodeValue()
          Get the value for the current node.
 void insertData(int offset, String arg)
          Insert a string into character data.
 void replaceData(int offset, int count, String arg)
          Replace characters of character data with a string.
 void setData(String newValue)
          Set the data character string to the new string.
 void setNodeValue(String newValue)
          Set the data character string to the new string.
 String substringData(int offset, int count)
          Extract a substring from character data.
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode
addDomChangeListener, addPropertyChangeListener, appendChild, appendDomChild, asText, asXml, cloneDomNode, cloneNode, fireNodeAdded, fireNodeDeleted, firePropertyChange, getAllHtmlChildElements, getByXPath, getChildIterator, getChildrenAsText, getEndColumnNumber, getEndLineNumber, getEventHandler, getFirstByXPath, getFirstChild, getFirstDomChild, getLastChild, getLastDomChild, getLocalName, getLog, getNamespaceURI, getNativePage, getNextDomSibling, getNextSibling, getNodeName, getNodeType, getPage, getParentDomNode, getParentNode, getPrefix, getPreviousDomSibling, getPreviousSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, hasAttributes, insertBefore, isAncestorOf, isRenderedVisible, isTrimmedText, notifyIncorrectness, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, printXml, reduceWhitespace, remove, removeAllChildren, removeDomChangeListener, removeEventHandler, removePropertyChangeListener, replace, setEventHandler, setEventHandler, setNextSibling, setParentNode, setPrefix, setPreviousSibling, setReadyState, setScriptObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomCharacterData

public DomCharacterData(Page page,
                        String data)
Create an instance of DomCharacterData

Parameters:
page - The Page that contains this element.
data - the data string wrapped by this node
Method Detail

getData

public String getData()
Get the data character string for this character data.

Returns:
The data String.

setData

public void setData(String newValue)
Set the data character string to the new string.

Parameters:
newValue - The new String of data.

setNodeValue

public void setNodeValue(String newValue)
Set the data character string to the new string.

Overrides:
setNodeValue in class DomNode
Parameters:
newValue - The new String of data.

getLength

public int getLength()
Get the number of characters in the character data.

Returns:
The number of characters.

appendData

public void appendData(String newData)
Append a string to character data.

Parameters:
newData - The string to be appended to the character data.

deleteData

public void deleteData(int offset,
                       int count)
Delete characters from character data.

Parameters:
offset - The position of the first character to be deleted.
count - The number of characters to be deleted.

insertData

public void insertData(int offset,
                       String arg)
Insert a string into character data.

Parameters:
offset - The position within the first character at which the string is to be inserted.
arg - The string to insert.

replaceData

public void replaceData(int offset,
                        int count,
                        String arg)
Replace characters of character data with a string.

Parameters:
offset - The position within the first character at which the string is to be replaced.
count - The number of characters to be replaced.
arg - The string that replaces the count characters beginning at the character at offset.

substringData

public String substringData(int offset,
                            int count)
Extract a substring from character data.

Parameters:
offset - The position of the first character to be extracted.
count - The number of characters to be extracted.
Returns:
A string that consists of the count characters of the character data starting from the character at position offset.

getNodeValue

public String getNodeValue()
Description copied from class: DomNode
Get the value for the current node.

Overrides:
getNodeValue in class DomNode
Returns:
the string data held by this node


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.