org.apache.batik.dom
Class AbstractCharacterData

java.lang.Object
  |
  +--org.apache.batik.dom.AbstractNode
        |
        +--org.apache.batik.dom.AbstractChildNode
              |
              +--org.apache.batik.dom.AbstractCharacterData
All Implemented Interfaces:
CharacterData, EventTarget, ExtendedNode, Node, NodeEventTarget, java.io.Serializable
Direct Known Subclasses:
AbstractComment, AbstractText

public abstract class AbstractCharacterData
extends AbstractChildNode
implements CharacterData

This class implements the CharacterData interface.

See Also:
Serialized Form

Field Summary
protected  java.lang.String nodeValue
          The value of this node.
 
Fields inherited from class org.apache.batik.dom.AbstractChildNode
nextSibling, parentNode, previousSibling
 
Fields inherited from class org.apache.batik.dom.AbstractNode
EMPTY_NODE_LIST, eventSupport, ownerDocument
 
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
AbstractCharacterData()
           
 
Method Summary
 void appendData(java.lang.String arg)
          DOM: Implements CharacterData.appendData(String).
protected  void checkOffsetCount(int offset, int count)
          Checks the given offset and count validity.
protected  Node copyInto(Node n)
          Copy the fields of the current node into the given node.
protected  Node deepCopyInto(Node n)
          Deeply copy the fields of the current node into the given node.
protected  Node deepExport(Node n, AbstractDocument d)
          Deeply exports this node to the given document.
 void deleteData(int offset, int count)
          DOM: Implements CharacterData.deleteData(int,int).
protected  Node export(Node n, AbstractDocument d)
          Exports this node to the given document.
 java.lang.String getData()
          DOM: Implements CharacterData.getData().
 int getLength()
          DOM: Implements CharacterData.getLength().
 java.lang.String getNodeValue()
          DOM: Implements Node.getNodeValue().
 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).
 void setNodeValue(java.lang.String nodeValue)
          DOM: Implements Node.setNodeValue(String).
 java.lang.String substringData(int offset, int count)
          DOM: Implements CharacterData.substringData(int,int).
 
Methods inherited from class org.apache.batik.dom.AbstractChildNode
getNextSibling, getParentNode, getPreviousSibling, setNextSibling, setParentNode, setPreviousSibling
 
Methods inherited from class org.apache.batik.dom.AbstractNode
addEventListener, appendChild, checkChildType, cloneNode, createDOMException, dispatchEvent, fireDOMCharacterDataModifiedEvent, fireDOMNodeInsertedIntoDocumentEvent, fireDOMNodeRemovedFromDocumentEvent, getAttributes, getChildNodes, getCurrentDocument, getEventSupport, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getOwnerDocument, getParentNodeEventTarget, getPrefix, hasAttributes, hasChildNodes, insertBefore, isSupported, newNode, normalize, removeChild, removeEventListener, replaceChild, setNodeName, setOwnerDocument, setPrefix, setSpecified
 
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, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setPrefix
 
Methods inherited from interface org.apache.batik.dom.ExtendedNode
isReadonly, setReadonly
 

Field Detail

nodeValue

protected java.lang.String nodeValue
The value of this node.
Constructor Detail

AbstractCharacterData

public AbstractCharacterData()
Method Detail

getNodeValue

public java.lang.String getNodeValue()
                              throws DOMException
DOM: Implements Node.getNodeValue().
Specified by:
getNodeValue in interface Node
Overrides:
getNodeValue in class AbstractNode
Returns:
nodeValue.

setNodeValue

public void setNodeValue(java.lang.String nodeValue)
                  throws DOMException
DOM: Implements Node.setNodeValue(String).
Specified by:
setNodeValue in interface Node
Overrides:
setNodeValue in class AbstractNode

getData

public java.lang.String getData()
                         throws DOMException
DOM: Implements CharacterData.getData().
Specified by:
getData in interface CharacterData
Returns:
getNodeValue().

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
Returns:
nodeValue.length().

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.

checkOffsetCount

protected void checkOffsetCount(int offset,
                                int count)
                         throws DOMException
Checks the given offset and count validity.

export

protected Node export(Node n,
                      AbstractDocument d)
Exports this node to the given document.
Overrides:
export in class AbstractNode

deepExport

protected Node deepExport(Node n,
                          AbstractDocument d)
Deeply exports this node to the given document.
Overrides:
deepExport in class AbstractNode

copyInto

protected Node copyInto(Node n)
Copy the fields of the current node into the given node.
Overrides:
copyInto in class AbstractNode
Parameters:
n - a node of the type of this.

deepCopyInto

protected Node deepCopyInto(Node n)
Deeply copy the fields of the current node into the given node.
Overrides:
deepCopyInto in class AbstractNode
Parameters:
n - a node of the type of this.


Copyright © 2002 Apache Software Foundation. All Rights Reserved.