Пример #1
0
 public String toString() {
   StringWriter buffer = new StringWriter();
   PrintWriter pw = new PrintWriter(buffer);
   encodeAsString(pw);
   pw.close();
   buffer.flush();
   return buffer.toString();
 }
Пример #2
0
 /**
  * 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("]]>");
 }