예제 #1
0
 /** Convenience for <code>XWriter.safe(this, c, escapeWhitespace)</code>. */
 public final XWriter safe(int c, boolean escapeWhitespace) {
   try {
     XWriter.safe(this, c, escapeWhitespace);
     return this;
   } catch (IOException e) {
     throw error(e);
   }
 }
예제 #2
0
 /** Convenience for <code>XWriter.safe(this, s, escapeWhitespace)</code>. */
 public final XWriter safe(String s, boolean escapeWhitespace) {
   try {
     XWriter.safe(xout, s, escapeWhitespace);
     return this;
   } catch (IOException e) {
     throw error(e);
   }
 }
예제 #3
0
 /** Convenience for <code>XWriter.safe(this, s, true)</code>. */
 public final XWriter safe(String s) {
   try {
     XWriter.safe(xout, s, true);
     return this;
   } catch (IOException e) {
     throw error(e);
   }
 }
예제 #4
0
 /** Write an attribute pair <code>name="value"</code> where the value is written using safe(). */
 public final XWriter attr(String name, String value) {
   write(name);
   write('=');
   write('"');
   safe(value);
   write('"');
   return this;
 }
예제 #5
0
 /**
  * This writes each character in the string to the output stream using the <code>
  * safe(Writer, int, boolean)</code> method.
  */
 public static void safe(Writer out, String s, boolean escapeWhitespace) throws IOException {
   int len = s.length();
   for (int i = 0; i < len; ++i) safe(out, s.charAt(i), escapeWhitespace);
 }