Class DomCDataSection

All Implemented Interfaces:
Serializable, Cloneable, CDATASection, CharacterData, Node, Text

public class DomCDataSection extends DomText implements CDATASection
Representation of a CDATA node in the HTML DOM.
See Also:
  • Constructor Details

    • DomCDataSection

      public DomCDataSection(SgmlPage page, String data)
      Creates a new instance.
      Parameters:
      page - the Page that contains this element
      data - the string data held by this node
  • Method Details

    • getNodeType

      public short getNodeType()
      Specified by:
      getNodeType in interface Node
      Overrides:
      getNodeType in class DomText
      Returns:
      the node type constant, in this case Node.CDATA_SECTION_NODE
    • getNodeName

      public String getNodeName()
      Specified by:
      getNodeName in interface Node
      Overrides:
      getNodeName in class DomText
      Returns:
      the node name, in this case DomText.NODE_NAME
    • printXml

      protected void printXml(String indent, PrintWriter printWriter)
      Recursively writes the XML data for the node tree starting at node.
      Overrides:
      printXml in class DomText
      Parameters:
      indent - white space to indent child nodes
      printWriter - writer where child nodes are written
    • createSplitTextNode

      protected DomText createSplitTextNode(int offset)
      Creates a new text node split from another text node. This method allows the derived type of the new text node to match the original node type.
      Overrides:
      createSplitTextNode in class DomText
      Parameters:
      offset - the character position at which to split the DomText node
      Returns:
      the newly created Text node