public String toString() { StringWriter buffer = new StringWriter(); PrintWriter pw = new PrintWriter(buffer); encodeAsString(pw); pw.close(); buffer.flush(); return buffer.toString(); }
/** * Encodes itself, wrapping the string into XML CDATA section. * * @since 1.1 */ public void encodeAsXML(XMLEncoder encoder) { encoder.print("<![CDATA["); encodeAsString(encoder.getPrintWriter()); encoder.print("]]>"); }