com.gargoylesoftware.htmlunit.activex.javascript.msxml
Class XMLDOMCharacterData

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLScriptable
              extended by com.gargoylesoftware.htmlunit.activex.javascript.msxml.XMLDOMNode
                  extended by com.gargoylesoftware.htmlunit.activex.javascript.msxml.XMLDOMCharacterData
All Implemented Interfaces:
Serializable, Cloneable, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable
Direct Known Subclasses:
XMLDOMComment, XMLDOMText

public class XMLDOMCharacterData
extends XMLDOMNode

A JavaScript object for MSXML's (ActiveX) XMLDOMCharacterData.
Provides text manipulation methods that are used by several objects.

Version:
$Revision: 9017 $
Author:
David K. Taylor, Chris Erskine, Frank Danek
See Also:
MSDN documentation, Serialized Form

Field Summary
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
XMLDOMCharacterData()
          Creates an instance.
 
Method Summary
 void appendData(String data)
          Appends the supplied string to the existing string data.
 void deleteData(int offset, int count)
          Deletes specified data.
 Object getData()
          Returns the node data depending on the node type.
 DomCharacterData getDomNodeOrDie()
          Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found.
 int getLength()
          Returns the length, in characters, of the data.
 Object getXml()
          Returns the XML representation of the node and all its descendants.
 void insertData(int offset, String data)
          Inserts a string at the specified offset.
 void replaceData(int offset, int count, String data)
          Replaces the specified number of characters with the supplied string.
 void setData(String newData)
          Sets the node data depending on the node type.
 void setText(Object newText)
          Sets the text contained in the node.
 String substringData(int offset, int count)
          Retrieves a substring of the full string from the specified range.
 
Methods inherited from class com.gargoylesoftware.htmlunit.activex.javascript.msxml.XMLDOMNode
appendChild, cloneNode, getAttributes, getBaseName, getChildNodes, getDataType, getDefinition, getFirstChild, getJavaScriptNode, getLastChild, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getText, hasChildNodes, insertBefore, insertBeforeImpl, removeChild, replaceChild, selectNodes, selectSingleNode, setNodeValue
 
Methods inherited from class com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLScriptable
getClassName, getEnvironment, getPrototype, makeScriptableFor, setEnvironment, setParentScope
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getDefaultValue, getDomNodeOrNull, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setPrototype, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDOMCharacterData

public XMLDOMCharacterData()
Creates an instance. JavaScript objects must have a default constructor.

Method Detail

getData

public Object getData()
Returns the node data depending on the node type.

Returns:
the node data depending on the node type

setData

public void setData(String newData)
Sets the node data depending on the node type.

Parameters:
newData - the node data depending on the node type

getLength

public int getLength()
Returns the length, in characters, of the data.

Returns:
the length of the data

setText

public void setText(Object newText)
Sets the text contained in the node.

Overrides:
setText in class XMLDOMNode
Parameters:
newText - the text contained in the node

getXml

public Object getXml()
Returns the XML representation of the node and all its descendants.

Overrides:
getXml in class XMLDOMNode
Returns:
the XML representation of the node and all its descendants

appendData

public void appendData(String data)
Appends the supplied string to the existing string data.

Parameters:
data - the data that is to be appended to the existing string

deleteData

public void deleteData(int offset,
                       int count)
Deletes specified data.

Parameters:
offset - the offset, in characters, at which to start deleting string data
count - the number of characters to delete

insertData

public void insertData(int offset,
                       String data)
Inserts a string at the specified offset.

Parameters:
offset - the offset, in characters, at which to insert the supplied string data
data - the data that is to be inserted into the existing string

replaceData

public void replaceData(int offset,
                        int count,
                        String data)
Replaces the specified number of characters with the supplied string.

Parameters:
offset - the offset, in characters, at which to start replacing string data
count - the number of characters to replace
data - the new data that replaces the old string data

substringData

public String substringData(int offset,
                            int count)
Retrieves a substring of the full string from the specified range.

Parameters:
offset - the offset, in characters, from the beginning of the string. An offset of zero indicates copying from the start of the data
count - the number of characters to retrieve from the specified offset
Returns:
the substring

getDomNodeOrDie

public DomCharacterData getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found.

Overrides:
getDomNodeOrDie in class SimpleScriptable
Returns:
the DOM node


Copyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.