BEA Systems, Inc.

com.beasys.commerce.util.dom
Class CharacterDataImpl

java.lang.Object
  |
  +--com.beasys.commerce.util.dom.DOMBase
        |
        +--com.beasys.commerce.util.dom.NodeImpl
              |
              +--com.beasys.commerce.util.dom.CharacterDataImpl
Direct Known Subclasses:
CommentImpl, TextImpl

public abstract class CharacterDataImpl
extends NodeImpl
implements org.w3c.dom.CharacterData

An implementation of the W3C's DOM CharacterData object.

Subclasses need to implement cloneNode(), getNodeType(), and getNodeName().

See Also:
Serialized Form

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(org.w3c.dom.Document doc, org.w3c.dom.Node parent, java.lang.String data)
          Constructor.
 
Method Summary
 void appendData(java.lang.String data)
          Append data to the character data.
protected  void checkCount(int count)
          Check that the given count is valid for editing operations on this character data.
protected  void checkOffset(int offset)
          Check that the given offset is valid for editing operations on this character data.
 void deleteData(int offset, int count)
          Remove a range of character data.
 java.lang.String getData()
          Get the character data.
 int getLength()
          Get the length of the character data.
 java.lang.String getNodeValue()
          Get the node value.
 void insertData(int offset, java.lang.String data)
          Insert new character data.
 void replaceData(int offset, int count, java.lang.String data)
          Replace the character data at offset/count with the new data.
 void setData(java.lang.String data)
          Set the character data.
 void setNodeValue(java.lang.String value)
          Set the node value.
 java.lang.String substringData(int offset, int count)
          Extract a range of the character data.
 
Methods inherited from class com.beasys.commerce.util.dom.NodeImpl
allowsChildren, appendChild, appendChildren, checkAllowChild, cloneNode, cloneNode, getAllowableChildrenTypes, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeType, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, insertChildrenBefore, isAncestor, removeChild, replaceChild, setParentNode
 
Methods inherited from class com.beasys.commerce.util.dom.DOMBase
checkOwnerDocument, checkReadOnly, getOwnerDocument, isReadOnly, setReadOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharacterDataImpl

public CharacterDataImpl(org.w3c.dom.Document doc,
                         org.w3c.dom.Node parent,
                         java.lang.String data)
Constructor.
Parameters:
doc - the owning document.
parent - the parent node.
data - the character data.
Method Detail

getNodeValue

public java.lang.String getNodeValue()
Get the node value.

For all subclasses of CharacterData, the node value is the character data.

Overrides:
getNodeValue in class NodeImpl
See Also:
getData()

setNodeValue

public void setNodeValue(java.lang.String value)
Set the node value.

For all subclasses of CharacterData, the node value is the character data.

Overrides:
setNodeValue in class NodeImpl
See Also:
setData(java.lang.String)

getData

public java.lang.String getData()
Get the character data.
Specified by:
getData in interface org.w3c.dom.CharacterData

setData

public void setData(java.lang.String data)
             throws org.w3c.dom.DOMException
Set the character data.
Specified by:
setData in interface org.w3c.dom.CharacterData
Throws:
org.w3c.dom.DOMException - thrown if the node is readonly

getLength

public int getLength()
Get the length of the character data.
Specified by:
getLength in interface org.w3c.dom.CharacterData

appendData

public void appendData(java.lang.String data)
                throws org.w3c.dom.DOMException
Append data to the character data.
Specified by:
appendData in interface org.w3c.dom.CharacterData
Parameters:
data - the new character data.
Throws:
org.w3c.dom.DOMException - thrown if the node is readonly

checkOffset

protected void checkOffset(int offset)
Check that the given offset is valid for editing operations on this character data.
Throws:
org.w3c.dom.DOMException - thrown if the offset is invalid.

checkCount

protected void checkCount(int count)
Check that the given count is valid for editing operations on this character data.
Throws:
org.w3c.dom.DOMException - thrown if the count is invalid.

deleteData

public void deleteData(int offset,
                       int count)
                throws org.w3c.dom.DOMException
Remove a range of character data.
Specified by:
deleteData in interface org.w3c.dom.CharacterData
Parameters:
offset - the offset in the character data to start removing at.
count - the number of charactere to remove.
Throws:
org.w3c.dom.DOMException - thrown if the data cannot be removed.

insertData

public void insertData(int offset,
                       java.lang.String data)
                throws org.w3c.dom.DOMException
Insert new character data.
Specified by:
insertData in interface org.w3c.dom.CharacterData
Parameters:
offset - the offset in the character data to add at.
data - the data to add.
Throws:
org.w3c.dom.DOMException - thrown if the character data cannot be added.

replaceData

public void replaceData(int offset,
                        int count,
                        java.lang.String data)
                 throws org.w3c.dom.DOMException
Replace the character data at offset/count with the new data.
Specified by:
replaceData in interface org.w3c.dom.CharacterData
Parameters:
offset - the offset in the character data to start replacing at.
count - the number of characters to replace.
data - the data to add.
Throws:
org.w3c.dom.DOMException - thrown if the data cannot be replaced.

substringData

public java.lang.String substringData(int offset,
                                      int count)
                               throws org.w3c.dom.DOMException
Extract a range of the character data.
Specified by:
substringData in interface org.w3c.dom.CharacterData
Parameters:
offset - the offset to start at.
count - the number of character to return.
Throws:
org.w3c.dom.DOMException - thrown if the character data cannot be retrieved.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved