001package org.jsoup.nodes; 002 003import org.jsoup.internal.QuietAppendable; 004 005/** 006 * A Character Data node, to support CDATA sections. 007 */ 008public class CDataNode extends TextNode { 009 public CDataNode(String text) { 010 super(text); 011 } 012 013 @Override 014 public String nodeName() { 015 return "#cdata"; 016 } 017 018 /** 019 * Get the un-encoded, <b>non-normalized</b> text content of this CDataNode. 020 * @return un-encoded, non-normalized text 021 */ 022 @Override 023 public String text() { 024 return getWholeText(); 025 } 026 027 @Override 028 void outerHtmlHead(QuietAppendable accum, Document.OutputSettings out) { 029 accum 030 .append("<![CDATA[") 031 .append(getWholeText()) 032 .append("]]>"); 033 } 034 035 @Override 036 public CDataNode clone() { 037 return (CDataNode) super.clone(); 038 } 039}