Class CData

java.lang.Object
com.oorian.xml.CData
All Implemented Interfaces:
XmlNode

public class CData extends Object implements XmlNode
Represents a CDATA section in an XML document.

CDATA sections contain text that should not be parsed for XML markup.

  • Constructor Details

    • CData

      public CData(String content)
      Constructs a new CData section with the specified content.
      Parameters:
      content - the CDATA content.
  • Method Details

    • setContent

      public void setContent(String content)
      Sets the CDATA content.
      Parameters:
      content - The new content
    • getContent

      public String getContent()
      Returns the CDATA content.
      Returns:
      The content
    • toXmlString

      public String toXmlString(int indent)
      Description copied from interface: XmlNode
      Returns the XML string representation of this node with the specified indentation level.
      Specified by:
      toXmlString in interface XmlNode
      Parameters:
      indent - the indentation level (number of two-space indents).
      Returns:
      the formatted XML string.
    • toString

      public String toString()
      Overrides:
      toString in class Object