/** * <p>Unescapes any JavaScript literals found in the <code>String</code>.</p> * <p></p> * <p>For example, it will turn a sequence of <code>'\'</code> and <code>'n'</code> * into a newline character, unless the <code>'\'</code> is preceded by another * <code>'\'</code>.</p> * * @param str the <code>String</code> to unescape, may be null * @return A new unescaped <code>String</code>, <code>null</code> if null string input * @see #unescapeJava(String) */ public static String unescapeJavaScript(String str) throws Exception { return unescapeJava(str); }
/** * <p>Unescapes any JavaScript literals found in the <code>String</code> to a * <code>Writer</code>.</p> * <p></p> * <p>For example, it will turn a sequence of <code>'\'</code> and <code>'n'</code> * into a newline character, unless the <code>'\'</code> is preceded by another * <code>'\'</code>.</p> * <p></p> * <p>A <code>null</code> string input has no effect.</p> * * @param out the <code>Writer</code> used to output unescaped characters * @param str the <code>String</code> to unescape, may be null * @throws IllegalArgumentException if the Writer is <code>null</code> * @throws java.io.IOException if error occurs on underlying Writer * @see #unescapeJava(java.io.Writer, String) */ public static void unescapeJavaScript(Writer out, String str) throws Exception { unescapeJava(out, str); }
/** * <p>Unescapes any Java literals found in the <code>String</code>. * For example, it will turn a sequence of <code>'\'</code> and * <code>'n'</code> into a newline character, unless the <code>'\'</code> * is preceded by another <code>'\'</code>.</p> * * @param str the <code>String</code> to unescape, may be null * @return a new unescaped <code>String</code>, <code>null</code> if null string input */ public static String unescapeJava(String str) throws Exception { if (str == null) { return null; } StringWriter writer = new StringWriter(str.length()); unescapeJava(writer, str); return writer.toString(); }
/** * <p>Unescapes any JavaScript literals found in the <code>String</code>.</p> * <p></p> * <p>For example, it will turn a sequence of <code>'\'</code> and <code>'n'</code> * into a newline character, unless the <code>'\'</code> is preceded by another * <code>'\'</code>.</p> * * @param str the <code>String</code> to unescape, may be null * @return A new unescaped <code>String</code>, <code>null</code> if null string input * @see #unescapeJava(String) */ public static String unescapeJavaScript(String str) throws Exception { return unescapeJava(str); }
/** * <p>Unescapes any JavaScript literals found in the <code>String</code> to a * <code>Writer</code>.</p> * <p></p> * <p>For example, it will turn a sequence of <code>'\'</code> and <code>'n'</code> * into a newline character, unless the <code>'\'</code> is preceded by another * <code>'\'</code>.</p> * <p></p> * <p>A <code>null</code> string input has no effect.</p> * * @param out the <code>Writer</code> used to output unescaped characters * @param str the <code>String</code> to unescape, may be null * @throws IllegalArgumentException if the Writer is <code>null</code> * @throws java.io.IOException if error occurs on underlying Writer * @see #unescapeJava(java.io.Writer, String) */ public static void unescapeJavaScript(Writer out, String str) throws Exception { unescapeJava(out, str); }
/** * <p>Unescapes any Java literals found in the <code>String</code>. * For example, it will turn a sequence of <code>'\'</code> and * <code>'n'</code> into a newline character, unless the <code>'\'</code> * is preceded by another <code>'\'</code>.</p> * * @param str the <code>String</code> to unescape, may be null * @return a new unescaped <code>String</code>, <code>null</code> if null string input */ public static String unescapeJava(String str) throws Exception { if (str == null) { return null; } StringWriter writer = new StringWriter(str.length()); unescapeJava(writer, str); return writer.toString(); }