oracle.xml.parser.v2
Class XMLText

oracle.xml.parser.v2.XMLText
Direct Known Subclasses:
XMLCDATA

public class XMLText
implements Text, java.io.Serializable, java.io.Externalizable, CXMLConstants

This class implements the DOM Text interface.

See Also:
Text, NodeFactory, DOMParser.setNodeFactory(oracle.xml.parser.v2.NodeFactory), Serialized Form

Fields inherited from interface oracle.xml.comp.CXMLConstants
ATTR_DEF, ATTR_TOKEN, ATTRDECL_DEF, CDATA_DEF, CHAR_DEF, COMMENT_DEF, CXML_VERSION, cXMLFILE, cXMLFILE_LEN, DEBUG, DTD_DEF, ELEMENTDECL_DEF, END, ENTITY_DEF, ENTITYREF_DEF, META_ID_MAX, names, NOTATION_DEF, NS_DEF, NULLSTR, PI_DEF, PREFIX_DEF, TAG_DEF, TAG_TOKEN, TOKEN_ONLY, XMLDECL_DEF
 
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
XMLText()
          Deprecated. use createTextNode(String) of XMLDocument
XMLText(java.lang.String text)
          Deprecated. use createTextNode(String) method of XMLDocument
 
Method Summary
TypeMethod
 void addText(char[] ch, int start, int length)
          Adds text to the data of the text node, similar to appendData
 java.lang.String getData()
          The character data of the node that implements this interface.
 java.lang.String getNodeName()
          Gets the name of the XMLText
 short getNodeType()
          Gets a code representing the type of the underlying object
 java.lang.String getNodeValue()
          Gets a value of this text node
 boolean isWhiteSpaceNode()
          Check is the text node is a whitespace node
 void readExternal(java.io.ObjectInput inArg)
          This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.
 void readExternal(oracle.xml.io.XMLObjectInput in, oracle.xml.comp.CXMLContext cxmlContext)
          This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.
 void reportSAXEvents(ContentHandler cntHandler)
          Report SAX Events from a DOM Tree
 Text splitText(int offset)
          Breaks Text node into two Text nodes at specified offset, so they are both siblings, and the node only contains content up to the offset.
 void writeExternal(java.io.ObjectOutput outArg)
          This method saves the state of the object by creating a binary compressed stream with information about this object.
 

Constructor Detail

XMLText

public XMLText()
Deprecated. use createTextNode(String) of XMLDocument

Default constructor. Note that this constructor is used only during deserialization/decompression of this DOM node. In order to deserialize this node to construct the DOM node from the serialized/ compressed stream, it is required to create a handle of the object.

XMLText

public XMLText(java.lang.String text)
Deprecated. use createTextNode(String) method of XMLDocument

Method Detail

splitText

public Text splitText(int offset)
               throws DOMException
Breaks Text node into two Text nodes at specified offset, so they are both siblings, and the node only contains content up to the offset. New node inserted as next sibling contains all content at and after the offset point.
Specified by:
splitText in interface Text
Parameters:
offset - Offset at which to split, starting from 0
Returns:
New Text node
Throws:
DOMException - INDEX_SIZE_ERR: Raised if specified offset is negative or greater than number of characters in data.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

getNodeName

public java.lang.String getNodeName()
Gets the name of the XMLText
Returns:
name of the node

getNodeType

public short getNodeType()
Gets a code representing the type of the underlying object
Returns:
type of the node

getNodeValue

public java.lang.String getNodeValue()
                              throws DOMException
Gets a value of this text node
Returns:
String value of the node
Throws:
DOMException - in any error occurs when retrieving the value

isWhiteSpaceNode

public boolean isWhiteSpaceNode()
Check is the text node is a whitespace node
Returns:
boolean

addText

public void addText(char[] ch,
                    int start,
                    int length)
Adds text to the data of the text node, similar to appendData
Parameters:
ch - char array to be appended
start - start index
length - length of the char array

getData

public java.lang.String getData()
                         throws DOMException
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 Text 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.
Throws:
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
DOMException - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

reportSAXEvents

public void reportSAXEvents(ContentHandler cntHandler)
                     throws SAXException
Report SAX Events from a DOM Tree
Parameters:
ContentHandler - cntHandler
Throws:
SAXException - thrown by SAX Callback functions

writeExternal

public void writeExternal(java.io.ObjectOutput outArg)
                   throws java.io.IOException
This method saves the state of the object by creating a binary compressed stream with information about this object.
Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - The ObjectOutput stream used to write the compressed stream.
Throws:
java.io.IOException - is thrown when there is an exception while writing the compressed stream.

readExternal

public void readExternal(java.io.ObjectInput inArg)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly. This method is called if XMLText object is deserialized (or read) as an independent node and not called from some other DOM node.
Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - The ObjectInput stream used for reading the compressed stream
Throws:
java.io.IOException - is thrown when there is an error in reading the input stream.
java.lang.ClassNotFoundException - is thrown when the class is not found

readExternal

public void readExternal(oracle.xml.io.XMLObjectInput in,
                         oracle.xml.comp.CXMLContext cxmlContext)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.
Parameters:
in - The XMLObjectInput stream used for reading the compressed stream
Throws:
java.io.IOException - is thrown when there is an error in reading the input stream.
java.lang.ClassNotFoundException - is thrown when the class is not found