electric.xml
Class Text

java.lang.Object
  extended byelectric.xml.Node
      extended byelectric.xml.Child
          extended byelectric.xml.CharacterData
              extended byelectric.xml.Text
All Implemented Interfaces:
org.w3c.dom.CharacterData, java.lang.Cloneable, IDOMConstants, IXMLConstants, org.w3c.dom.Node, java.io.Serializable, org.w3c.dom.Text
Direct Known Subclasses:
CData

public class Text
extends CharacterData
implements org.w3c.dom.Text

Text represents a piece of XML text.

Author:
webMethods
See Also:
Serialized Form

Field Summary
protected  boolean raw
           
 
Fields inherited from class electric.xml.CharacterData
string
 
Fields inherited from class electric.xml.Child
parent
 
Fields inherited from class electric.xml.Node
list, next, prev
 
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
 
Fields inherited from interface electric.xml.IXMLConstants
ATTLIST_START, ATTLIST_STOP, CDATA, CDATA_START, CDATA_STOP, CLOSE_TAG, COLON, COMMENT_START, COMMENT_STOP, DOCTYPE_START, DOCTYPE_STOP, ELEMENTDECL_START, ELEMENTDECL_STOP, ENCODING, ENTITYDECL_START, ENTITYDECL_STOP, ID, ID_CASE, INSTRUCTION_START, INSTRUCTION_STOP, NEGATIVE_INFINITY, NOT_A_NUMBER, NOTATIONDECL_START, NOTATIONDECL_STOP, NULL, OPEN_TAG, POSITIVE_INFINITY, PUBLIC, SPECIALS, STANDALONE, SUBSTITUTES, SYSTEM, UNDEFINED, VERSION, XML, XML_NAMESPACE, XMLDECL_START, XMLDECL_STOP, XMLNS, XMLNS_NAMESPACE
 
Fields inherited from interface electric.xml.IDOMConstants
CDATA_SECTION_NAME, COMMENT_NAME, CORE, DOCUMENT_FRAGMENT_NAME, DOCUMENT_NAME, HIERARCHY_REQUEST_ERR, TEXT_NAME
 
Constructor Summary
Text(Parent parent)
          Construct a Text with the specified parent.
Text(java.lang.String string)
          Construct a Text with the specified string.
Text(Text text)
          Construct a copy of the specified Text.
 
Method Summary
 java.lang.Object clone()
          Return a clone of this Text.
 java.lang.String getNodeName()
          Return "#text".
 short getNodeType()
          Return TEXT_NODE.
 boolean getRaw()
          Return my raw mode.
 java.lang.String getString()
          Return my string.
 void read(NodeReader reader)
           
 void setRaw(boolean flag)
          Set my raw mode.
 void setString(java.lang.String string)
          Set my string.
 org.w3c.dom.Text splitText(int offset)
          Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings.
 void write(NodeWriter writer)
          Write myself to the specified writer.
static void writeWithSubstitution(NodeWriter writer, java.lang.String string)
          Write the specified string to the specified Writer, substituting the special characters &, < and >, ' and " for their &, <, >, ' and " equivalents.
 
Methods inherited from class electric.xml.CharacterData
appendData, deleteData, getData, getLength, getNodeValue, insertData, replaceData, setData, setNodeValue, size, substringData
 
Methods inherited from class electric.xml.Child
cloneNode, getByteArray, getByteArray, getByteArray, getBytes, getBytes, getBytes, getDocument, getNextSiblingChild, getOwnerDocument, getParent, getParentNode, getPreviousSiblingChild, getRoot, replaceWith, setNextSiblingChild, setParent, setPreviousSiblingChild, toString, toString, write, write, write
 
Methods inherited from class electric.xml.Node
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNextSiblingNode, getNode, getNode, getNodes, getPrefix, getPreviousSibling, getPreviousSiblingNode, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, remove, removeChild, replaceChild, setNextSiblingNode, setPrefix, setPreviousSiblingNode
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.CharacterData
appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Field Detail

raw

protected boolean raw
Constructor Detail

Text

public Text(java.lang.String string)
Construct a Text with the specified string.

Parameters:
string - The comment string.

Text

public Text(Text text)
Construct a copy of the specified Text.

Parameters:
text - The Text to copy.

Text

public Text(Parent parent)
Construct a Text with the specified parent.

Parameters:
parent - The parent.
Method Detail

clone

public java.lang.Object clone()
Return a clone of this Text.

Specified by:
clone in class Child

getString

public java.lang.String getString()
Return my string.


setString

public void setString(java.lang.String string)
Set my string.

Parameters:
string - The new string value.

setRaw

public void setRaw(boolean flag)
Set my raw mode. If true, subsitutions are disabled when I am written.

Parameters:
flag - The new raw value.

getRaw

public boolean getRaw()
Return my raw mode.


read

public void read(NodeReader reader)
          throws java.io.IOException,
                 NamespaceException
Overrides:
read in class Node
Parameters:
reader -
Throws:
java.io.IOException
NamespaceException

write

public void write(NodeWriter writer)
           throws java.io.IOException
Write myself to the specified writer.

Overrides:
write in class Node
Parameters:
writer - The nodeWriter.
Throws:
java.io.IOException - If an I/O exception occurs.

writeWithSubstitution

public static void writeWithSubstitution(NodeWriter writer,
                                         java.lang.String string)
                                  throws java.io.IOException
Write the specified string to the specified Writer, substituting the special characters &, < and >, ' and " for their &, <, >, ' and " equivalents.

Parameters:
writer - The nodeWriter.
string - The String.
Throws:
java.io.IOException - If an I/O exception occurs.

getNodeType

public short getNodeType()
Return TEXT_NODE.

Specified by:
getNodeType in interface org.w3c.dom.Node
Overrides:
getNodeType in class Node

getNodeName

public java.lang.String getNodeName()
Return "#text".

Specified by:
getNodeName in interface org.w3c.dom.Node
Overrides:
getNodeName in class Node

splitText

public org.w3c.dom.Text splitText(int offset)
Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings. After being split, this node will contain all the content up to the offset point. A new node of the same type, which contains all the content at and after the offset point, is returned. If the original node had a parent node, the new node is inserted as the next sibling of the original node. When the offset is equal to the length of this node, the new node has no data.

Specified by:
splitText in interface org.w3c.dom.Text
Parameters:
offset - The offset.


copyright© 2001-2004 by webMethods All Rights Reserved.