org.apache.crimson.tree
Class CDataNode

java.lang.Object
  extended byorg.apache.crimson.tree.NodeBase
      extended byorg.apache.crimson.tree.DataNode
          extended byorg.apache.crimson.tree.TextNode
              extended byorg.apache.crimson.tree.CDataNode
All Implemented Interfaces:
org.w3c.dom.CDATASection, org.w3c.dom.CharacterData, org.w3c.dom.Node, NodeEx, org.w3c.dom.NodeList, org.w3c.dom.Text, XmlWritable

class CDataNode
extends TextNode
implements org.w3c.dom.CDATASection

Node representing XML CDATA text, which is just like other text except for its delimiters (<[CDATA[text]]>). CDATA is used to embed markup, program source code, and other kinds of text that use XML markup delimiters (< and &) for their own nefarious purposes.

Author:
David Brownell

Nested Class Summary
 
Nested classes inherited from class org.apache.crimson.tree.TextNode
DataNode.NodeListImpl
 
Field Summary
 
Fields inherited from class org.apache.crimson.tree.TextNode
childNodes, data, ownerDocument, readonly
 
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
CDataNode()
          Constructs a CDATA text object with no text.
CDataNode(char[] buf, int offset, int len)
          Constructs CDATA text object by copying text from the input buffer.
CDataNode(String s)
          Constructs a CDATA text object by copying text from the string.
 
Method Summary
 org.w3c.dom.Node cloneNode(boolean deep)
          Returns a new CDATA section with the same content as this.
 String getNodeName()
          Returns the string "#cdata-section".
 short getNodeType()
          DOM: Returns the CDATA_SECTION_NODE node type constant.
 void writeXml(XmlWriteContext context)
          Writes the text, breaking this into multiple CDATA sections if necessary to escape [[< in the data.
 
Methods inherited from class org.apache.crimson.tree.TextNode
appendChild, appendData, deleteData, getAttributes, getChildNodes, getData, getFirstChild, getIndexOf, getInheritedAttribute, getLanguage, getLastChild, getLength, getLocalName, getMessage, getMessage, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentImpl, getParentNode, getPrefix, getPreviousSibling, getText, hasAttributes, hasChildNodes, insertBefore, insertData, isReadonly, isSupported, item, joinNextText, normalize, removeChild, replaceChild, replaceData, setData, setNodeValue, setOwnerDocument, setParentNode, setPrefix, setReadonly, setText, splitText, substringData, toString, writeChildrenXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Text
splitText
 
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, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

CDataNode

public CDataNode()
Constructs a CDATA text object with no text.


CDataNode

public CDataNode(char[] buf,
                 int offset,
                 int len)
Constructs CDATA text object by copying text from the input buffer.


CDataNode

public CDataNode(String s)
Constructs a CDATA text object by copying text from the string.

Method Detail

writeXml

public void writeXml(XmlWriteContext context)
              throws IOException
Writes the text, breaking this into multiple CDATA sections if necessary to escape [[< in the data.

Specified by:
writeXml in interface XmlWritable
Overrides:
writeXml in class TextNode
Throws:
IOException

getNodeType

public short getNodeType()
DOM: Returns the CDATA_SECTION_NODE node type constant.

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

cloneNode

public org.w3c.dom.Node cloneNode(boolean deep)
Returns a new CDATA section with the same content as this.

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

getNodeName

public String getNodeName()
Returns the string "#cdata-section".

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