commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject svn commit: r1022144 [14/19] - in /websites/production/commons/content/proper/commons-text/javadocs/api-release: ./ org/apache/commons/text/ org/apache/commons/text/class-use/ org/apache/commons/text/diff/ org/apache/commons/text/diff/class-use/ org/ap...
Date Tue, 12 Dec 2017 14:33:52 GMT
Modified: websites/production/commons/content/proper/commons-text/javadocs/api-release/src-html/org/apache/commons/text/StringEscapeUtils.Builder.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/javadocs/api-release/src-html/org/apache/commons/text/StringEscapeUtils.Builder.html (original)
+++ websites/production/commons/content/proper/commons-text/javadocs/api-release/src-html/org/apache/commons/text/StringEscapeUtils.Builder.html Tue Dec 12 14:33:51 2017
@@ -69,7 +69,7 @@
 <span class="sourceLineNo">061</span>     */<a name="line.61"></a>
 <span class="sourceLineNo">062</span>    public static final CharSequenceTranslator ESCAPE_JAVA;<a name="line.62"></a>
 <span class="sourceLineNo">063</span>    static {<a name="line.63"></a>
-<span class="sourceLineNo">064</span>        Map&lt;CharSequence, CharSequence&gt; escapeJavaMap = new HashMap&lt;&gt;();<a name="line.64"></a>
+<span class="sourceLineNo">064</span>        final Map&lt;CharSequence, CharSequence&gt; escapeJavaMap = new HashMap&lt;&gt;();<a name="line.64"></a>
 <span class="sourceLineNo">065</span>        escapeJavaMap.put("\"", "\\\"");<a name="line.65"></a>
 <span class="sourceLineNo">066</span>        escapeJavaMap.put("\\", "\\\\");<a name="line.66"></a>
 <span class="sourceLineNo">067</span>        ESCAPE_JAVA = new AggregateTranslator(<a name="line.67"></a>
@@ -88,7 +88,7 @@
 <span class="sourceLineNo">080</span>     */<a name="line.80"></a>
 <span class="sourceLineNo">081</span>    public static final CharSequenceTranslator ESCAPE_ECMASCRIPT;<a name="line.81"></a>
 <span class="sourceLineNo">082</span>    static {<a name="line.82"></a>
-<span class="sourceLineNo">083</span>        Map&lt;CharSequence, CharSequence&gt; escapeEcmaScriptMap = new HashMap&lt;&gt;();<a name="line.83"></a>
+<span class="sourceLineNo">083</span>        final Map&lt;CharSequence, CharSequence&gt; escapeEcmaScriptMap = new HashMap&lt;&gt;();<a name="line.83"></a>
 <span class="sourceLineNo">084</span>        escapeEcmaScriptMap.put("'", "\\'");<a name="line.84"></a>
 <span class="sourceLineNo">085</span>        escapeEcmaScriptMap.put("\"", "\\\"");<a name="line.85"></a>
 <span class="sourceLineNo">086</span>        escapeEcmaScriptMap.put("\\", "\\\\");<a name="line.86"></a>
@@ -109,7 +109,7 @@
 <span class="sourceLineNo">101</span>     */<a name="line.101"></a>
 <span class="sourceLineNo">102</span>    public static final CharSequenceTranslator ESCAPE_JSON;<a name="line.102"></a>
 <span class="sourceLineNo">103</span>    static {<a name="line.103"></a>
-<span class="sourceLineNo">104</span>        Map&lt;CharSequence, CharSequence&gt; escapeJsonMap = new HashMap&lt;&gt;();<a name="line.104"></a>
+<span class="sourceLineNo">104</span>        final Map&lt;CharSequence, CharSequence&gt; escapeJsonMap = new HashMap&lt;&gt;();<a name="line.104"></a>
 <span class="sourceLineNo">105</span>        escapeJsonMap.put("\"", "\\\"");<a name="line.105"></a>
 <span class="sourceLineNo">106</span>        escapeJsonMap.put("\\", "\\\\");<a name="line.106"></a>
 <span class="sourceLineNo">107</span>        escapeJsonMap.put("/", "\\/");<a name="line.107"></a>
@@ -129,7 +129,7 @@
 <span class="sourceLineNo">121</span>     */<a name="line.121"></a>
 <span class="sourceLineNo">122</span>    public static final CharSequenceTranslator ESCAPE_XML10;<a name="line.122"></a>
 <span class="sourceLineNo">123</span>    static {<a name="line.123"></a>
-<span class="sourceLineNo">124</span>        Map&lt;CharSequence, CharSequence&gt; escapeXml10Map = new HashMap&lt;&gt;();<a name="line.124"></a>
+<span class="sourceLineNo">124</span>        final Map&lt;CharSequence, CharSequence&gt; escapeXml10Map = new HashMap&lt;&gt;();<a name="line.124"></a>
 <span class="sourceLineNo">125</span>        escapeXml10Map.put("\u0000", StringUtils.EMPTY);<a name="line.125"></a>
 <span class="sourceLineNo">126</span>        escapeXml10Map.put("\u0001", StringUtils.EMPTY);<a name="line.126"></a>
 <span class="sourceLineNo">127</span>        escapeXml10Map.put("\u0002", StringUtils.EMPTY);<a name="line.127"></a>
@@ -180,7 +180,7 @@
 <span class="sourceLineNo">172</span>     */<a name="line.172"></a>
 <span class="sourceLineNo">173</span>    public static final CharSequenceTranslator ESCAPE_XML11;<a name="line.173"></a>
 <span class="sourceLineNo">174</span>    static {<a name="line.174"></a>
-<span class="sourceLineNo">175</span>        Map&lt;CharSequence, CharSequence&gt; escapeXml11Map = new HashMap&lt;&gt;();<a name="line.175"></a>
+<span class="sourceLineNo">175</span>        final Map&lt;CharSequence, CharSequence&gt; escapeXml11Map = new HashMap&lt;&gt;();<a name="line.175"></a>
 <span class="sourceLineNo">176</span>        escapeXml11Map.put("\u0000", StringUtils.EMPTY);<a name="line.176"></a>
 <span class="sourceLineNo">177</span>        escapeXml11Map.put("\u000b", "&amp;#11;");<a name="line.177"></a>
 <span class="sourceLineNo">178</span>        escapeXml11Map.put("\u000c", "&amp;#12;");<a name="line.178"></a>
@@ -241,7 +241,7 @@
 <span class="sourceLineNo">233</span>     */<a name="line.233"></a>
 <span class="sourceLineNo">234</span>    public static final CharSequenceTranslator ESCAPE_XSI;<a name="line.234"></a>
 <span class="sourceLineNo">235</span>    static {<a name="line.235"></a>
-<span class="sourceLineNo">236</span>        Map&lt;CharSequence, CharSequence&gt; escapeXsiMap = new HashMap&lt;&gt;();<a name="line.236"></a>
+<span class="sourceLineNo">236</span>        final Map&lt;CharSequence, CharSequence&gt; escapeXsiMap = new HashMap&lt;&gt;();<a name="line.236"></a>
 <span class="sourceLineNo">237</span>        escapeXsiMap.put("|", "\\|");<a name="line.237"></a>
 <span class="sourceLineNo">238</span>        escapeXsiMap.put("&amp;", "\\&amp;");<a name="line.238"></a>
 <span class="sourceLineNo">239</span>        escapeXsiMap.put(";", "\\;");<a name="line.239"></a>
@@ -281,7 +281,7 @@
 <span class="sourceLineNo">273</span>     */<a name="line.273"></a>
 <span class="sourceLineNo">274</span>    public static final CharSequenceTranslator UNESCAPE_JAVA;<a name="line.274"></a>
 <span class="sourceLineNo">275</span>    static {<a name="line.275"></a>
-<span class="sourceLineNo">276</span>        Map&lt;CharSequence, CharSequence&gt; unescapeJavaMap = new HashMap&lt;&gt;();<a name="line.276"></a>
+<span class="sourceLineNo">276</span>        final Map&lt;CharSequence, CharSequence&gt; unescapeJavaMap = new HashMap&lt;&gt;();<a name="line.276"></a>
 <span class="sourceLineNo">277</span>        unescapeJavaMap.put("\\\\", "\\");<a name="line.277"></a>
 <span class="sourceLineNo">278</span>        unescapeJavaMap.put("\\\"", "\"");<a name="line.278"></a>
 <span class="sourceLineNo">279</span>        unescapeJavaMap.put("\\'", "'");<a name="line.279"></a>
@@ -310,569 +310,576 @@
 <span class="sourceLineNo">302</span>     * object allows the Json unescaping functionality to be used<a name="line.302"></a>
 <span class="sourceLineNo">303</span>     * as the foundation for a custom translator.<a name="line.303"></a>
 <span class="sourceLineNo">304</span>     */<a name="line.304"></a>
-<span class="sourceLineNo">305</span>    public static final CharSequenceTranslator UNESCAPE_JSON = UNESCAPE_JAVA;<a name="line.305"></a>
-<span class="sourceLineNo">306</span><a name="line.306"></a>
-<span class="sourceLineNo">307</span>    /**<a name="line.307"></a>
-<span class="sourceLineNo">308</span>     * Translator object for unescaping escaped HTML 3.0.<a name="line.308"></a>
-<span class="sourceLineNo">309</span>     *<a name="line.309"></a>
-<span class="sourceLineNo">310</span>     * While {@link #unescapeHtml3(String)} is the expected method of use, this<a name="line.310"></a>
-<span class="sourceLineNo">311</span>     * object allows the HTML unescaping functionality to be used<a name="line.311"></a>
-<span class="sourceLineNo">312</span>     * as the foundation for a custom translator.<a name="line.312"></a>
-<span class="sourceLineNo">313</span>     */<a name="line.313"></a>
-<span class="sourceLineNo">314</span>    public static final CharSequenceTranslator UNESCAPE_HTML3 =<a name="line.314"></a>
-<span class="sourceLineNo">315</span>            new AggregateTranslator(<a name="line.315"></a>
-<span class="sourceLineNo">316</span>                    new LookupTranslator(EntityArrays.BASIC_UNESCAPE),<a name="line.316"></a>
-<span class="sourceLineNo">317</span>                    new LookupTranslator(EntityArrays.ISO8859_1_UNESCAPE),<a name="line.317"></a>
-<span class="sourceLineNo">318</span>                    new NumericEntityUnescaper()<a name="line.318"></a>
-<span class="sourceLineNo">319</span>            );<a name="line.319"></a>
-<span class="sourceLineNo">320</span><a name="line.320"></a>
-<span class="sourceLineNo">321</span>    /**<a name="line.321"></a>
-<span class="sourceLineNo">322</span>     * Translator object for unescaping escaped HTML 4.0.<a name="line.322"></a>
-<span class="sourceLineNo">323</span>     *<a name="line.323"></a>
-<span class="sourceLineNo">324</span>     * While {@link #unescapeHtml4(String)} is the expected method of use, this<a name="line.324"></a>
-<span class="sourceLineNo">325</span>     * object allows the HTML unescaping functionality to be used<a name="line.325"></a>
-<span class="sourceLineNo">326</span>     * as the foundation for a custom translator.<a name="line.326"></a>
-<span class="sourceLineNo">327</span>     */<a name="line.327"></a>
-<span class="sourceLineNo">328</span>    public static final CharSequenceTranslator UNESCAPE_HTML4 =<a name="line.328"></a>
-<span class="sourceLineNo">329</span>            new AggregateTranslator(<a name="line.329"></a>
-<span class="sourceLineNo">330</span>                    new LookupTranslator(EntityArrays.BASIC_UNESCAPE),<a name="line.330"></a>
-<span class="sourceLineNo">331</span>                    new LookupTranslator(EntityArrays.ISO8859_1_UNESCAPE),<a name="line.331"></a>
-<span class="sourceLineNo">332</span>                    new LookupTranslator(EntityArrays.HTML40_EXTENDED_UNESCAPE),<a name="line.332"></a>
-<span class="sourceLineNo">333</span>                    new NumericEntityUnescaper()<a name="line.333"></a>
-<span class="sourceLineNo">334</span>            );<a name="line.334"></a>
-<span class="sourceLineNo">335</span><a name="line.335"></a>
-<span class="sourceLineNo">336</span>    /**<a name="line.336"></a>
-<span class="sourceLineNo">337</span>     * Translator object for unescaping escaped XML.<a name="line.337"></a>
-<span class="sourceLineNo">338</span>     *<a name="line.338"></a>
-<span class="sourceLineNo">339</span>     * While {@link #unescapeXml(String)} is the expected method of use, this<a name="line.339"></a>
-<span class="sourceLineNo">340</span>     * object allows the XML unescaping functionality to be used<a name="line.340"></a>
-<span class="sourceLineNo">341</span>     * as the foundation for a custom translator.<a name="line.341"></a>
-<span class="sourceLineNo">342</span>     */<a name="line.342"></a>
-<span class="sourceLineNo">343</span>    public static final CharSequenceTranslator UNESCAPE_XML =<a name="line.343"></a>
-<span class="sourceLineNo">344</span>            new AggregateTranslator(<a name="line.344"></a>
-<span class="sourceLineNo">345</span>                    new LookupTranslator(EntityArrays.BASIC_UNESCAPE),<a name="line.345"></a>
-<span class="sourceLineNo">346</span>                    new LookupTranslator(EntityArrays.APOS_UNESCAPE),<a name="line.346"></a>
-<span class="sourceLineNo">347</span>                    new NumericEntityUnescaper()<a name="line.347"></a>
-<span class="sourceLineNo">348</span>            );<a name="line.348"></a>
-<span class="sourceLineNo">349</span><a name="line.349"></a>
-<span class="sourceLineNo">350</span>    /**<a name="line.350"></a>
-<span class="sourceLineNo">351</span>     * Translator object for unescaping escaped Comma Separated Value entries.<a name="line.351"></a>
-<span class="sourceLineNo">352</span>     *<a name="line.352"></a>
-<span class="sourceLineNo">353</span>     * While {@link #unescapeCsv(String)} is the expected method of use, this<a name="line.353"></a>
-<span class="sourceLineNo">354</span>     * object allows the CSV unescaping functionality to be used<a name="line.354"></a>
-<span class="sourceLineNo">355</span>     * as the foundation for a custom translator.<a name="line.355"></a>
-<span class="sourceLineNo">356</span>     */<a name="line.356"></a>
-<span class="sourceLineNo">357</span>    public static final CharSequenceTranslator UNESCAPE_CSV = new CsvTranslators.CsvUnescaper();<a name="line.357"></a>
-<span class="sourceLineNo">358</span><a name="line.358"></a>
-<span class="sourceLineNo">359</span>    /**<a name="line.359"></a>
-<span class="sourceLineNo">360</span>     * Translator object for unescaping escaped XSI Value entries.<a name="line.360"></a>
-<span class="sourceLineNo">361</span>     *<a name="line.361"></a>
-<span class="sourceLineNo">362</span>     * While {@link #unescapeXSI(String)}  is the expected method of use, this<a name="line.362"></a>
-<span class="sourceLineNo">363</span>     * object allows the XSI unescaping functionality to be used<a name="line.363"></a>
-<span class="sourceLineNo">364</span>     * as the foundation for a custom translator.<a name="line.364"></a>
-<span class="sourceLineNo">365</span>     */<a name="line.365"></a>
-<span class="sourceLineNo">366</span>    public static final CharSequenceTranslator UNESCAPE_XSI = new XsiUnescaper();<a name="line.366"></a>
-<span class="sourceLineNo">367</span><a name="line.367"></a>
-<span class="sourceLineNo">368</span>    /**<a name="line.368"></a>
-<span class="sourceLineNo">369</span>     * Translator object for unescaping backslash escaped entries.<a name="line.369"></a>
-<span class="sourceLineNo">370</span>     */<a name="line.370"></a>
-<span class="sourceLineNo">371</span>    static class XsiUnescaper extends CharSequenceTranslator {<a name="line.371"></a>
-<span class="sourceLineNo">372</span><a name="line.372"></a>
-<span class="sourceLineNo">373</span>        /**<a name="line.373"></a>
-<span class="sourceLineNo">374</span>         * Escaped backslash constant.<a name="line.374"></a>
-<span class="sourceLineNo">375</span>         */<a name="line.375"></a>
-<span class="sourceLineNo">376</span>        private static final char BACKSLASH = '\\';<a name="line.376"></a>
-<span class="sourceLineNo">377</span><a name="line.377"></a>
-<span class="sourceLineNo">378</span>        @Override<a name="line.378"></a>
-<span class="sourceLineNo">379</span>        public int translate(final CharSequence input, final int index, final Writer out) throws IOException {<a name="line.379"></a>
-<span class="sourceLineNo">380</span><a name="line.380"></a>
-<span class="sourceLineNo">381</span>            if (index != 0) {<a name="line.381"></a>
-<span class="sourceLineNo">382</span>                throw new IllegalStateException("XsiUnescaper should never reach the [1] index");<a name="line.382"></a>
-<span class="sourceLineNo">383</span>            }<a name="line.383"></a>
+<span class="sourceLineNo">305</span>    public static final CharSequenceTranslator UNESCAPE_JSON;<a name="line.305"></a>
+<span class="sourceLineNo">306</span>    static {<a name="line.306"></a>
+<span class="sourceLineNo">307</span>        UNESCAPE_JSON = new AggregateTranslator(<a name="line.307"></a>
+<span class="sourceLineNo">308</span>                new OctalUnescaper(),     // .between('\1', '\377'),<a name="line.308"></a>
+<span class="sourceLineNo">309</span>                new UnicodeUnescaper(),<a name="line.309"></a>
+<span class="sourceLineNo">310</span>                new LookupTranslator(EntityArrays.JAVA_CTRL_CHARS_UNESCAPE)<a name="line.310"></a>
+<span class="sourceLineNo">311</span>        );<a name="line.311"></a>
+<span class="sourceLineNo">312</span>    }<a name="line.312"></a>
+<span class="sourceLineNo">313</span><a name="line.313"></a>
+<span class="sourceLineNo">314</span>    /**<a name="line.314"></a>
+<span class="sourceLineNo">315</span>     * Translator object for unescaping escaped HTML 3.0.<a name="line.315"></a>
+<span class="sourceLineNo">316</span>     *<a name="line.316"></a>
+<span class="sourceLineNo">317</span>     * While {@link #unescapeHtml3(String)} is the expected method of use, this<a name="line.317"></a>
+<span class="sourceLineNo">318</span>     * object allows the HTML unescaping functionality to be used<a name="line.318"></a>
+<span class="sourceLineNo">319</span>     * as the foundation for a custom translator.<a name="line.319"></a>
+<span class="sourceLineNo">320</span>     */<a name="line.320"></a>
+<span class="sourceLineNo">321</span>    public static final CharSequenceTranslator UNESCAPE_HTML3 =<a name="line.321"></a>
+<span class="sourceLineNo">322</span>            new AggregateTranslator(<a name="line.322"></a>
+<span class="sourceLineNo">323</span>                    new LookupTranslator(EntityArrays.BASIC_UNESCAPE),<a name="line.323"></a>
+<span class="sourceLineNo">324</span>                    new LookupTranslator(EntityArrays.ISO8859_1_UNESCAPE),<a name="line.324"></a>
+<span class="sourceLineNo">325</span>                    new NumericEntityUnescaper()<a name="line.325"></a>
+<span class="sourceLineNo">326</span>            );<a name="line.326"></a>
+<span class="sourceLineNo">327</span><a name="line.327"></a>
+<span class="sourceLineNo">328</span>    /**<a name="line.328"></a>
+<span class="sourceLineNo">329</span>     * Translator object for unescaping escaped HTML 4.0.<a name="line.329"></a>
+<span class="sourceLineNo">330</span>     *<a name="line.330"></a>
+<span class="sourceLineNo">331</span>     * While {@link #unescapeHtml4(String)} is the expected method of use, this<a name="line.331"></a>
+<span class="sourceLineNo">332</span>     * object allows the HTML unescaping functionality to be used<a name="line.332"></a>
+<span class="sourceLineNo">333</span>     * as the foundation for a custom translator.<a name="line.333"></a>
+<span class="sourceLineNo">334</span>     */<a name="line.334"></a>
+<span class="sourceLineNo">335</span>    public static final CharSequenceTranslator UNESCAPE_HTML4 =<a name="line.335"></a>
+<span class="sourceLineNo">336</span>            new AggregateTranslator(<a name="line.336"></a>
+<span class="sourceLineNo">337</span>                    new LookupTranslator(EntityArrays.BASIC_UNESCAPE),<a name="line.337"></a>
+<span class="sourceLineNo">338</span>                    new LookupTranslator(EntityArrays.ISO8859_1_UNESCAPE),<a name="line.338"></a>
+<span class="sourceLineNo">339</span>                    new LookupTranslator(EntityArrays.HTML40_EXTENDED_UNESCAPE),<a name="line.339"></a>
+<span class="sourceLineNo">340</span>                    new NumericEntityUnescaper()<a name="line.340"></a>
+<span class="sourceLineNo">341</span>            );<a name="line.341"></a>
+<span class="sourceLineNo">342</span><a name="line.342"></a>
+<span class="sourceLineNo">343</span>    /**<a name="line.343"></a>
+<span class="sourceLineNo">344</span>     * Translator object for unescaping escaped XML.<a name="line.344"></a>
+<span class="sourceLineNo">345</span>     *<a name="line.345"></a>
+<span class="sourceLineNo">346</span>     * While {@link #unescapeXml(String)} is the expected method of use, this<a name="line.346"></a>
+<span class="sourceLineNo">347</span>     * object allows the XML unescaping functionality to be used<a name="line.347"></a>
+<span class="sourceLineNo">348</span>     * as the foundation for a custom translator.<a name="line.348"></a>
+<span class="sourceLineNo">349</span>     */<a name="line.349"></a>
+<span class="sourceLineNo">350</span>    public static final CharSequenceTranslator UNESCAPE_XML =<a name="line.350"></a>
+<span class="sourceLineNo">351</span>            new AggregateTranslator(<a name="line.351"></a>
+<span class="sourceLineNo">352</span>                    new LookupTranslator(EntityArrays.BASIC_UNESCAPE),<a name="line.352"></a>
+<span class="sourceLineNo">353</span>                    new LookupTranslator(EntityArrays.APOS_UNESCAPE),<a name="line.353"></a>
+<span class="sourceLineNo">354</span>                    new NumericEntityUnescaper()<a name="line.354"></a>
+<span class="sourceLineNo">355</span>            );<a name="line.355"></a>
+<span class="sourceLineNo">356</span><a name="line.356"></a>
+<span class="sourceLineNo">357</span>    /**<a name="line.357"></a>
+<span class="sourceLineNo">358</span>     * Translator object for unescaping escaped Comma Separated Value entries.<a name="line.358"></a>
+<span class="sourceLineNo">359</span>     *<a name="line.359"></a>
+<span class="sourceLineNo">360</span>     * While {@link #unescapeCsv(String)} is the expected method of use, this<a name="line.360"></a>
+<span class="sourceLineNo">361</span>     * object allows the CSV unescaping functionality to be used<a name="line.361"></a>
+<span class="sourceLineNo">362</span>     * as the foundation for a custom translator.<a name="line.362"></a>
+<span class="sourceLineNo">363</span>     */<a name="line.363"></a>
+<span class="sourceLineNo">364</span>    public static final CharSequenceTranslator UNESCAPE_CSV = new CsvTranslators.CsvUnescaper();<a name="line.364"></a>
+<span class="sourceLineNo">365</span><a name="line.365"></a>
+<span class="sourceLineNo">366</span>    /**<a name="line.366"></a>
+<span class="sourceLineNo">367</span>     * Translator object for unescaping escaped XSI Value entries.<a name="line.367"></a>
+<span class="sourceLineNo">368</span>     *<a name="line.368"></a>
+<span class="sourceLineNo">369</span>     * While {@link #unescapeXSI(String)}  is the expected method of use, this<a name="line.369"></a>
+<span class="sourceLineNo">370</span>     * object allows the XSI unescaping functionality to be used<a name="line.370"></a>
+<span class="sourceLineNo">371</span>     * as the foundation for a custom translator.<a name="line.371"></a>
+<span class="sourceLineNo">372</span>     */<a name="line.372"></a>
+<span class="sourceLineNo">373</span>    public static final CharSequenceTranslator UNESCAPE_XSI = new XsiUnescaper();<a name="line.373"></a>
+<span class="sourceLineNo">374</span><a name="line.374"></a>
+<span class="sourceLineNo">375</span>    /**<a name="line.375"></a>
+<span class="sourceLineNo">376</span>     * Translator object for unescaping backslash escaped entries.<a name="line.376"></a>
+<span class="sourceLineNo">377</span>     */<a name="line.377"></a>
+<span class="sourceLineNo">378</span>    static class XsiUnescaper extends CharSequenceTranslator {<a name="line.378"></a>
+<span class="sourceLineNo">379</span><a name="line.379"></a>
+<span class="sourceLineNo">380</span>        /**<a name="line.380"></a>
+<span class="sourceLineNo">381</span>         * Escaped backslash constant.<a name="line.381"></a>
+<span class="sourceLineNo">382</span>         */<a name="line.382"></a>
+<span class="sourceLineNo">383</span>        private static final char BACKSLASH = '\\';<a name="line.383"></a>
 <span class="sourceLineNo">384</span><a name="line.384"></a>
-<span class="sourceLineNo">385</span>            String s = input.toString();<a name="line.385"></a>
-<span class="sourceLineNo">386</span><a name="line.386"></a>
-<span class="sourceLineNo">387</span>            int segmentStart = 0;<a name="line.387"></a>
-<span class="sourceLineNo">388</span>            int searchOffset = 0;<a name="line.388"></a>
-<span class="sourceLineNo">389</span>            while (true) {<a name="line.389"></a>
-<span class="sourceLineNo">390</span>                int pos = s.indexOf(BACKSLASH, searchOffset);<a name="line.390"></a>
-<span class="sourceLineNo">391</span>                if (pos == -1) {<a name="line.391"></a>
-<span class="sourceLineNo">392</span>                    if (segmentStart &lt; s.length()) {<a name="line.392"></a>
-<span class="sourceLineNo">393</span>                        out.write(s.substring(segmentStart));<a name="line.393"></a>
-<span class="sourceLineNo">394</span>                    }<a name="line.394"></a>
-<span class="sourceLineNo">395</span>                    break;<a name="line.395"></a>
-<span class="sourceLineNo">396</span>                }<a name="line.396"></a>
-<span class="sourceLineNo">397</span>                if (pos &gt; segmentStart) {<a name="line.397"></a>
-<span class="sourceLineNo">398</span>                    out.write(s.substring(segmentStart, pos));<a name="line.398"></a>
-<span class="sourceLineNo">399</span>                }<a name="line.399"></a>
-<span class="sourceLineNo">400</span>                segmentStart = pos + 1;<a name="line.400"></a>
-<span class="sourceLineNo">401</span>                searchOffset = pos + 2;<a name="line.401"></a>
-<span class="sourceLineNo">402</span>            }<a name="line.402"></a>
-<span class="sourceLineNo">403</span><a name="line.403"></a>
-<span class="sourceLineNo">404</span>            return Character.codePointCount(input, 0, input.length());<a name="line.404"></a>
-<span class="sourceLineNo">405</span>        }<a name="line.405"></a>
-<span class="sourceLineNo">406</span>    }<a name="line.406"></a>
-<span class="sourceLineNo">407</span><a name="line.407"></a>
-<span class="sourceLineNo">408</span>    /* Helper functions */<a name="line.408"></a>
-<span class="sourceLineNo">409</span><a name="line.409"></a>
-<span class="sourceLineNo">410</span>    /**<a name="line.410"></a>
-<span class="sourceLineNo">411</span>     * &lt;p&gt;{@code StringEscapeUtils} instances should NOT be constructed in<a name="line.411"></a>
-<span class="sourceLineNo">412</span>     * standard programming.&lt;/p&gt;<a name="line.412"></a>
-<span class="sourceLineNo">413</span>     *<a name="line.413"></a>
-<span class="sourceLineNo">414</span>     * &lt;p&gt;Instead, the class should be used as:&lt;/p&gt;<a name="line.414"></a>
-<span class="sourceLineNo">415</span>     * &lt;pre&gt;StringEscapeUtils.escapeJava("foo");&lt;/pre&gt;<a name="line.415"></a>
-<span class="sourceLineNo">416</span>     *<a name="line.416"></a>
-<span class="sourceLineNo">417</span>     * &lt;p&gt;This constructor is public to permit tools that require a JavaBean<a name="line.417"></a>
-<span class="sourceLineNo">418</span>     * instance to operate.&lt;/p&gt;<a name="line.418"></a>
-<span class="sourceLineNo">419</span>     */<a name="line.419"></a>
-<span class="sourceLineNo">420</span>    public StringEscapeUtils() {<a name="line.420"></a>
-<span class="sourceLineNo">421</span>        super();<a name="line.421"></a>
-<span class="sourceLineNo">422</span>    }<a name="line.422"></a>
-<span class="sourceLineNo">423</span><a name="line.423"></a>
-<span class="sourceLineNo">424</span>    /**<a name="line.424"></a>
-<span class="sourceLineNo">425</span>     * &lt;p&gt;Convenience wrapper for {@link java.lang.StringBuilder} providing escape methods.&lt;/p&gt;<a name="line.425"></a>
-<span class="sourceLineNo">426</span>     *<a name="line.426"></a>
-<span class="sourceLineNo">427</span>     * &lt;p&gt;Example:&lt;/p&gt;<a name="line.427"></a>
-<span class="sourceLineNo">428</span>     * &lt;pre&gt;<a name="line.428"></a>
-<span class="sourceLineNo">429</span>     * new Builder(ESCAPE_HTML4)<a name="line.429"></a>
-<span class="sourceLineNo">430</span>     *      .append("&amp;lt;p&amp;gt;")<a name="line.430"></a>
-<span class="sourceLineNo">431</span>     *      .escape("This is paragraph 1 and special chars like &amp;amp; get escaped.")<a name="line.431"></a>
-<span class="sourceLineNo">432</span>     *      .append("&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;")<a name="line.432"></a>
-<span class="sourceLineNo">433</span>     *      .escape("This is paragraph 2 &amp;amp; more...")<a name="line.433"></a>
-<span class="sourceLineNo">434</span>     *      .append("&amp;lt;/p&amp;gt;")<a name="line.434"></a>
-<span class="sourceLineNo">435</span>     *      .toString()<a name="line.435"></a>
-<span class="sourceLineNo">436</span>     * &lt;/pre&gt;<a name="line.436"></a>
-<span class="sourceLineNo">437</span>     *<a name="line.437"></a>
-<span class="sourceLineNo">438</span>     */<a name="line.438"></a>
-<span class="sourceLineNo">439</span>    public static final class Builder {<a name="line.439"></a>
-<span class="sourceLineNo">440</span><a name="line.440"></a>
-<span class="sourceLineNo">441</span>        /**<a name="line.441"></a>
-<span class="sourceLineNo">442</span>         * StringBuilder to be used in the Builder class.<a name="line.442"></a>
-<span class="sourceLineNo">443</span>         */<a name="line.443"></a>
-<span class="sourceLineNo">444</span>        private final StringBuilder sb;<a name="line.444"></a>
-<span class="sourceLineNo">445</span><a name="line.445"></a>
-<span class="sourceLineNo">446</span>        /**<a name="line.446"></a>
-<span class="sourceLineNo">447</span>         * CharSequenceTranslator to be used in the Builder class.<a name="line.447"></a>
-<span class="sourceLineNo">448</span>         */<a name="line.448"></a>
-<span class="sourceLineNo">449</span>        private final CharSequenceTranslator translator;<a name="line.449"></a>
-<span class="sourceLineNo">450</span><a name="line.450"></a>
-<span class="sourceLineNo">451</span>        /**<a name="line.451"></a>
-<span class="sourceLineNo">452</span>         * Builder constructor.<a name="line.452"></a>
-<span class="sourceLineNo">453</span>         *<a name="line.453"></a>
-<span class="sourceLineNo">454</span>         * @param translator a CharSequenceTranslator.<a name="line.454"></a>
+<span class="sourceLineNo">385</span>        @Override<a name="line.385"></a>
+<span class="sourceLineNo">386</span>        public int translate(final CharSequence input, final int index, final Writer out) throws IOException {<a name="line.386"></a>
+<span class="sourceLineNo">387</span><a name="line.387"></a>
+<span class="sourceLineNo">388</span>            if (index != 0) {<a name="line.388"></a>
+<span class="sourceLineNo">389</span>                throw new IllegalStateException("XsiUnescaper should never reach the [1] index");<a name="line.389"></a>
+<span class="sourceLineNo">390</span>            }<a name="line.390"></a>
+<span class="sourceLineNo">391</span><a name="line.391"></a>
+<span class="sourceLineNo">392</span>            final String s = input.toString();<a name="line.392"></a>
+<span class="sourceLineNo">393</span><a name="line.393"></a>
+<span class="sourceLineNo">394</span>            int segmentStart = 0;<a name="line.394"></a>
+<span class="sourceLineNo">395</span>            int searchOffset = 0;<a name="line.395"></a>
+<span class="sourceLineNo">396</span>            while (true) {<a name="line.396"></a>
+<span class="sourceLineNo">397</span>                final int pos = s.indexOf(BACKSLASH, searchOffset);<a name="line.397"></a>
+<span class="sourceLineNo">398</span>                if (pos == -1) {<a name="line.398"></a>
+<span class="sourceLineNo">399</span>                    if (segmentStart &lt; s.length()) {<a name="line.399"></a>
+<span class="sourceLineNo">400</span>                        out.write(s.substring(segmentStart));<a name="line.400"></a>
+<span class="sourceLineNo">401</span>                    }<a name="line.401"></a>
+<span class="sourceLineNo">402</span>                    break;<a name="line.402"></a>
+<span class="sourceLineNo">403</span>                }<a name="line.403"></a>
+<span class="sourceLineNo">404</span>                if (pos &gt; segmentStart) {<a name="line.404"></a>
+<span class="sourceLineNo">405</span>                    out.write(s.substring(segmentStart, pos));<a name="line.405"></a>
+<span class="sourceLineNo">406</span>                }<a name="line.406"></a>
+<span class="sourceLineNo">407</span>                segmentStart = pos + 1;<a name="line.407"></a>
+<span class="sourceLineNo">408</span>                searchOffset = pos + 2;<a name="line.408"></a>
+<span class="sourceLineNo">409</span>            }<a name="line.409"></a>
+<span class="sourceLineNo">410</span><a name="line.410"></a>
+<span class="sourceLineNo">411</span>            return Character.codePointCount(input, 0, input.length());<a name="line.411"></a>
+<span class="sourceLineNo">412</span>        }<a name="line.412"></a>
+<span class="sourceLineNo">413</span>    }<a name="line.413"></a>
+<span class="sourceLineNo">414</span><a name="line.414"></a>
+<span class="sourceLineNo">415</span>    /* Helper functions */<a name="line.415"></a>
+<span class="sourceLineNo">416</span><a name="line.416"></a>
+<span class="sourceLineNo">417</span>    /**<a name="line.417"></a>
+<span class="sourceLineNo">418</span>     * &lt;p&gt;{@code StringEscapeUtils} instances should NOT be constructed in<a name="line.418"></a>
+<span class="sourceLineNo">419</span>     * standard programming.&lt;/p&gt;<a name="line.419"></a>
+<span class="sourceLineNo">420</span>     *<a name="line.420"></a>
+<span class="sourceLineNo">421</span>     * &lt;p&gt;Instead, the class should be used as:&lt;/p&gt;<a name="line.421"></a>
+<span class="sourceLineNo">422</span>     * &lt;pre&gt;StringEscapeUtils.escapeJava("foo");&lt;/pre&gt;<a name="line.422"></a>
+<span class="sourceLineNo">423</span>     *<a name="line.423"></a>
+<span class="sourceLineNo">424</span>     * &lt;p&gt;This constructor is public to permit tools that require a JavaBean<a name="line.424"></a>
+<span class="sourceLineNo">425</span>     * instance to operate.&lt;/p&gt;<a name="line.425"></a>
+<span class="sourceLineNo">426</span>     */<a name="line.426"></a>
+<span class="sourceLineNo">427</span>    public StringEscapeUtils() {<a name="line.427"></a>
+<span class="sourceLineNo">428</span>        super();<a name="line.428"></a>
+<span class="sourceLineNo">429</span>    }<a name="line.429"></a>
+<span class="sourceLineNo">430</span><a name="line.430"></a>
+<span class="sourceLineNo">431</span>    /**<a name="line.431"></a>
+<span class="sourceLineNo">432</span>     * &lt;p&gt;Convenience wrapper for {@link java.lang.StringBuilder} providing escape methods.&lt;/p&gt;<a name="line.432"></a>
+<span class="sourceLineNo">433</span>     *<a name="line.433"></a>
+<span class="sourceLineNo">434</span>     * &lt;p&gt;Example:&lt;/p&gt;<a name="line.434"></a>
+<span class="sourceLineNo">435</span>     * &lt;pre&gt;<a name="line.435"></a>
+<span class="sourceLineNo">436</span>     * new Builder(ESCAPE_HTML4)<a name="line.436"></a>
+<span class="sourceLineNo">437</span>     *      .append("&amp;lt;p&amp;gt;")<a name="line.437"></a>
+<span class="sourceLineNo">438</span>     *      .escape("This is paragraph 1 and special chars like &amp;amp; get escaped.")<a name="line.438"></a>
+<span class="sourceLineNo">439</span>     *      .append("&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;")<a name="line.439"></a>
+<span class="sourceLineNo">440</span>     *      .escape("This is paragraph 2 &amp;amp; more...")<a name="line.440"></a>
+<span class="sourceLineNo">441</span>     *      .append("&amp;lt;/p&amp;gt;")<a name="line.441"></a>
+<span class="sourceLineNo">442</span>     *      .toString()<a name="line.442"></a>
+<span class="sourceLineNo">443</span>     * &lt;/pre&gt;<a name="line.443"></a>
+<span class="sourceLineNo">444</span>     *<a name="line.444"></a>
+<span class="sourceLineNo">445</span>     */<a name="line.445"></a>
+<span class="sourceLineNo">446</span>    public static final class Builder {<a name="line.446"></a>
+<span class="sourceLineNo">447</span><a name="line.447"></a>
+<span class="sourceLineNo">448</span>        /**<a name="line.448"></a>
+<span class="sourceLineNo">449</span>         * StringBuilder to be used in the Builder class.<a name="line.449"></a>
+<span class="sourceLineNo">450</span>         */<a name="line.450"></a>
+<span class="sourceLineNo">451</span>        private final StringBuilder sb;<a name="line.451"></a>
+<span class="sourceLineNo">452</span><a name="line.452"></a>
+<span class="sourceLineNo">453</span>        /**<a name="line.453"></a>
+<span class="sourceLineNo">454</span>         * CharSequenceTranslator to be used in the Builder class.<a name="line.454"></a>
 <span class="sourceLineNo">455</span>         */<a name="line.455"></a>
-<span class="sourceLineNo">456</span>        private Builder(final CharSequenceTranslator translator) {<a name="line.456"></a>
-<span class="sourceLineNo">457</span>            this.sb = new StringBuilder();<a name="line.457"></a>
-<span class="sourceLineNo">458</span>            this.translator = translator;<a name="line.458"></a>
-<span class="sourceLineNo">459</span>        }<a name="line.459"></a>
-<span class="sourceLineNo">460</span><a name="line.460"></a>
-<span class="sourceLineNo">461</span>        /**<a name="line.461"></a>
-<span class="sourceLineNo">462</span>         * &lt;p&gt;Escape {@code input} according to the given {@link CharSequenceTranslator}.&lt;/p&gt;<a name="line.462"></a>
-<span class="sourceLineNo">463</span>         *<a name="line.463"></a>
-<span class="sourceLineNo">464</span>         * @param input the String to escape<a name="line.464"></a>
-<span class="sourceLineNo">465</span>         * @return {@code this}, to enable chaining<a name="line.465"></a>
-<span class="sourceLineNo">466</span>         */<a name="line.466"></a>
-<span class="sourceLineNo">467</span>        public Builder escape(final String input) {<a name="line.467"></a>
-<span class="sourceLineNo">468</span>            sb.append(translator.translate(input));<a name="line.468"></a>
-<span class="sourceLineNo">469</span>            return this;<a name="line.469"></a>
-<span class="sourceLineNo">470</span>        }<a name="line.470"></a>
-<span class="sourceLineNo">471</span><a name="line.471"></a>
-<span class="sourceLineNo">472</span>        /**<a name="line.472"></a>
-<span class="sourceLineNo">473</span>         * Literal append, no escaping being done.<a name="line.473"></a>
-<span class="sourceLineNo">474</span>         *<a name="line.474"></a>
-<span class="sourceLineNo">475</span>         * @param input the String to append<a name="line.475"></a>
-<span class="sourceLineNo">476</span>         * @return {@code this}, to enable chaining<a name="line.476"></a>
-<span class="sourceLineNo">477</span>         */<a name="line.477"></a>
-<span class="sourceLineNo">478</span>        public Builder append(final String input) {<a name="line.478"></a>
-<span class="sourceLineNo">479</span>            sb.append(input);<a name="line.479"></a>
-<span class="sourceLineNo">480</span>            return this;<a name="line.480"></a>
-<span class="sourceLineNo">481</span>        }<a name="line.481"></a>
-<span class="sourceLineNo">482</span><a name="line.482"></a>
-<span class="sourceLineNo">483</span>        /**<a name="line.483"></a>
-<span class="sourceLineNo">484</span>         * &lt;p&gt;Return the escaped string.&lt;/p&gt;<a name="line.484"></a>
-<span class="sourceLineNo">485</span>         *<a name="line.485"></a>
-<span class="sourceLineNo">486</span>         * @return the escaped string<a name="line.486"></a>
-<span class="sourceLineNo">487</span>         */<a name="line.487"></a>
-<span class="sourceLineNo">488</span>        @Override<a name="line.488"></a>
-<span class="sourceLineNo">489</span>        public String toString() {<a name="line.489"></a>
-<span class="sourceLineNo">490</span>            return sb.toString();<a name="line.490"></a>
-<span class="sourceLineNo">491</span>        }<a name="line.491"></a>
-<span class="sourceLineNo">492</span>    }<a name="line.492"></a>
-<span class="sourceLineNo">493</span><a name="line.493"></a>
-<span class="sourceLineNo">494</span>    /**<a name="line.494"></a>
-<span class="sourceLineNo">495</span>     * Get a {@link Builder}.<a name="line.495"></a>
-<span class="sourceLineNo">496</span>     * @param translator the text translator<a name="line.496"></a>
-<span class="sourceLineNo">497</span>     * @return {@link Builder}<a name="line.497"></a>
-<span class="sourceLineNo">498</span>     */<a name="line.498"></a>
-<span class="sourceLineNo">499</span>    public static StringEscapeUtils.Builder builder(final CharSequenceTranslator translator) {<a name="line.499"></a>
-<span class="sourceLineNo">500</span>        return new Builder(translator);<a name="line.500"></a>
-<span class="sourceLineNo">501</span>    }<a name="line.501"></a>
-<span class="sourceLineNo">502</span><a name="line.502"></a>
-<span class="sourceLineNo">503</span>    // Java and JavaScript<a name="line.503"></a>
-<span class="sourceLineNo">504</span>    //--------------------------------------------------------------------------<a name="line.504"></a>
-<span class="sourceLineNo">505</span>    /**<a name="line.505"></a>
-<span class="sourceLineNo">506</span>     * &lt;p&gt;Escapes the characters in a {@code String} using Java String rules.&lt;/p&gt;<a name="line.506"></a>
-<span class="sourceLineNo">507</span>     *<a name="line.507"></a>
-<span class="sourceLineNo">508</span>     * &lt;p&gt;Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) &lt;/p&gt;<a name="line.508"></a>
-<span class="sourceLineNo">509</span>     *<a name="line.509"></a>
-<span class="sourceLineNo">510</span>     * &lt;p&gt;So a tab becomes the characters {@code '\\'} and<a name="line.510"></a>
-<span class="sourceLineNo">511</span>     * {@code 't'}.&lt;/p&gt;<a name="line.511"></a>
-<span class="sourceLineNo">512</span>     *<a name="line.512"></a>
-<span class="sourceLineNo">513</span>     * &lt;p&gt;The only difference between Java strings and JavaScript strings<a name="line.513"></a>
-<span class="sourceLineNo">514</span>     * is that in JavaScript, a single quote and forward-slash (/) are escaped.&lt;/p&gt;<a name="line.514"></a>
-<span class="sourceLineNo">515</span>     *<a name="line.515"></a>
-<span class="sourceLineNo">516</span>     * &lt;p&gt;Example:&lt;/p&gt;<a name="line.516"></a>
-<span class="sourceLineNo">517</span>     * &lt;pre&gt;<a name="line.517"></a>
-<span class="sourceLineNo">518</span>     * input string: He didn't say, "Stop!"<a name="line.518"></a>
-<span class="sourceLineNo">519</span>     * output string: He didn't say, \"Stop!\"<a name="line.519"></a>
-<span class="sourceLineNo">520</span>     * &lt;/pre&gt;<a name="line.520"></a>
-<span class="sourceLineNo">521</span>     *<a name="line.521"></a>
-<span class="sourceLineNo">522</span>     * @param input  String to escape values in, may be null<a name="line.522"></a>
-<span class="sourceLineNo">523</span>     * @return String with escaped values, {@code null} if null string input<a name="line.523"></a>
-<span class="sourceLineNo">524</span>     */<a name="line.524"></a>
-<span class="sourceLineNo">525</span>    public static final String escapeJava(final String input) {<a name="line.525"></a>
-<span class="sourceLineNo">526</span>        return ESCAPE_JAVA.translate(input);<a name="line.526"></a>
-<span class="sourceLineNo">527</span>    }<a name="line.527"></a>
-<span class="sourceLineNo">528</span><a name="line.528"></a>
-<span class="sourceLineNo">529</span>    /**<a name="line.529"></a>
-<span class="sourceLineNo">530</span>     * &lt;p&gt;Escapes the characters in a {@code String} using EcmaScript String rules.&lt;/p&gt;<a name="line.530"></a>
-<span class="sourceLineNo">531</span>     * &lt;p&gt;Escapes any values it finds into their EcmaScript String form.<a name="line.531"></a>
-<span class="sourceLineNo">532</span>     * Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) &lt;/p&gt;<a name="line.532"></a>
-<span class="sourceLineNo">533</span>     *<a name="line.533"></a>
-<span class="sourceLineNo">534</span>     * &lt;p&gt;So a tab becomes the characters {@code '\\'} and<a name="line.534"></a>
-<span class="sourceLineNo">535</span>     * {@code 't'}.&lt;/p&gt;<a name="line.535"></a>
-<span class="sourceLineNo">536</span>     *<a name="line.536"></a>
-<span class="sourceLineNo">537</span>     * &lt;p&gt;The only difference between Java strings and EcmaScript strings<a name="line.537"></a>
-<span class="sourceLineNo">538</span>     * is that in EcmaScript, a single quote and forward-slash (/) are escaped.&lt;/p&gt;<a name="line.538"></a>
-<span class="sourceLineNo">539</span>     *<a name="line.539"></a>
-<span class="sourceLineNo">540</span>     * &lt;p&gt;Note that EcmaScript is best known by the JavaScript and ActionScript dialects. &lt;/p&gt;<a name="line.540"></a>
-<span class="sourceLineNo">541</span>     *<a name="line.541"></a>
-<span class="sourceLineNo">542</span>     * &lt;p&gt;Example:&lt;/p&gt;<a name="line.542"></a>
-<span class="sourceLineNo">543</span>     * &lt;pre&gt;<a name="line.543"></a>
-<span class="sourceLineNo">544</span>     * input string: He didn't say, "Stop!"<a name="line.544"></a>
-<span class="sourceLineNo">545</span>     * output string: He didn\'t say, \"Stop!\"<a name="line.545"></a>
-<span class="sourceLineNo">546</span>     * &lt;/pre&gt;<a name="line.546"></a>
-<span class="sourceLineNo">547</span>     *<a name="line.547"></a>
-<span class="sourceLineNo">548</span>     * &lt;b&gt;Security Note.&lt;/b&gt; We only provide backslash escaping in this method. For example, {@code '\"'} has the output<a name="line.548"></a>
-<span class="sourceLineNo">549</span>     * {@code '\\\"'} which could result in potential issues in the case where the string being escaped is being used<a name="line.549"></a>
-<span class="sourceLineNo">550</span>     * in an HTML tag like {@code &lt;select onmouseover="..." /&gt;}. If you wish to have more rigorous string escaping, you<a name="line.550"></a>
-<span class="sourceLineNo">551</span>     * may consider the<a name="line.551"></a>
-<span class="sourceLineNo">552</span>     * &lt;a href="https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API_JAVA"&gt;ESAPI Libraries&lt;/a&gt;.<a name="line.552"></a>
-<span class="sourceLineNo">553</span>     * Further, you can view the &lt;a href="https://github.com/esapi"&gt;ESAPI GitHub Org&lt;/a&gt;.<a name="line.553"></a>
+<span class="sourceLineNo">456</span>        private final CharSequenceTranslator translator;<a name="line.456"></a>
+<span class="sourceLineNo">457</span><a name="line.457"></a>
+<span class="sourceLineNo">458</span>        /**<a name="line.458"></a>
+<span class="sourceLineNo">459</span>         * Builder constructor.<a name="line.459"></a>
+<span class="sourceLineNo">460</span>         *<a name="line.460"></a>
+<span class="sourceLineNo">461</span>         * @param translator a CharSequenceTranslator.<a name="line.461"></a>
+<span class="sourceLineNo">462</span>         */<a name="line.462"></a>
+<span class="sourceLineNo">463</span>        private Builder(final CharSequenceTranslator translator) {<a name="line.463"></a>
+<span class="sourceLineNo">464</span>            this.sb = new StringBuilder();<a name="line.464"></a>
+<span class="sourceLineNo">465</span>            this.translator = translator;<a name="line.465"></a>
+<span class="sourceLineNo">466</span>        }<a name="line.466"></a>
+<span class="sourceLineNo">467</span><a name="line.467"></a>
+<span class="sourceLineNo">468</span>        /**<a name="line.468"></a>
+<span class="sourceLineNo">469</span>         * &lt;p&gt;Escape {@code input} according to the given {@link CharSequenceTranslator}.&lt;/p&gt;<a name="line.469"></a>
+<span class="sourceLineNo">470</span>         *<a name="line.470"></a>
+<span class="sourceLineNo">471</span>         * @param input the String to escape<a name="line.471"></a>
+<span class="sourceLineNo">472</span>         * @return {@code this}, to enable chaining<a name="line.472"></a>
+<span class="sourceLineNo">473</span>         */<a name="line.473"></a>
+<span class="sourceLineNo">474</span>        public Builder escape(final String input) {<a name="line.474"></a>
+<span class="sourceLineNo">475</span>            sb.append(translator.translate(input));<a name="line.475"></a>
+<span class="sourceLineNo">476</span>            return this;<a name="line.476"></a>
+<span class="sourceLineNo">477</span>        }<a name="line.477"></a>
+<span class="sourceLineNo">478</span><a name="line.478"></a>
+<span class="sourceLineNo">479</span>        /**<a name="line.479"></a>
+<span class="sourceLineNo">480</span>         * Literal append, no escaping being done.<a name="line.480"></a>
+<span class="sourceLineNo">481</span>         *<a name="line.481"></a>
+<span class="sourceLineNo">482</span>         * @param input the String to append<a name="line.482"></a>
+<span class="sourceLineNo">483</span>         * @return {@code this}, to enable chaining<a name="line.483"></a>
+<span class="sourceLineNo">484</span>         */<a name="line.484"></a>
+<span class="sourceLineNo">485</span>        public Builder append(final String input) {<a name="line.485"></a>
+<span class="sourceLineNo">486</span>            sb.append(input);<a name="line.486"></a>
+<span class="sourceLineNo">487</span>            return this;<a name="line.487"></a>
+<span class="sourceLineNo">488</span>        }<a name="line.488"></a>
+<span class="sourceLineNo">489</span><a name="line.489"></a>
+<span class="sourceLineNo">490</span>        /**<a name="line.490"></a>
+<span class="sourceLineNo">491</span>         * &lt;p&gt;Return the escaped string.&lt;/p&gt;<a name="line.491"></a>
+<span class="sourceLineNo">492</span>         *<a name="line.492"></a>
+<span class="sourceLineNo">493</span>         * @return the escaped string<a name="line.493"></a>
+<span class="sourceLineNo">494</span>         */<a name="line.494"></a>
+<span class="sourceLineNo">495</span>        @Override<a name="line.495"></a>
+<span class="sourceLineNo">496</span>        public String toString() {<a name="line.496"></a>
+<span class="sourceLineNo">497</span>            return sb.toString();<a name="line.497"></a>
+<span class="sourceLineNo">498</span>        }<a name="line.498"></a>
+<span class="sourceLineNo">499</span>    }<a name="line.499"></a>
+<span class="sourceLineNo">500</span><a name="line.500"></a>
+<span class="sourceLineNo">501</span>    /**<a name="line.501"></a>
+<span class="sourceLineNo">502</span>     * Get a {@link Builder}.<a name="line.502"></a>
+<span class="sourceLineNo">503</span>     * @param translator the text translator<a name="line.503"></a>
+<span class="sourceLineNo">504</span>     * @return {@link Builder}<a name="line.504"></a>
+<span class="sourceLineNo">505</span>     */<a name="line.505"></a>
+<span class="sourceLineNo">506</span>    public static StringEscapeUtils.Builder builder(final CharSequenceTranslator translator) {<a name="line.506"></a>
+<span class="sourceLineNo">507</span>        return new Builder(translator);<a name="line.507"></a>
+<span class="sourceLineNo">508</span>    }<a name="line.508"></a>
+<span class="sourceLineNo">509</span><a name="line.509"></a>
+<span class="sourceLineNo">510</span>    // Java and JavaScript<a name="line.510"></a>
+<span class="sourceLineNo">511</span>    //--------------------------------------------------------------------------<a name="line.511"></a>
+<span class="sourceLineNo">512</span>    /**<a name="line.512"></a>
+<span class="sourceLineNo">513</span>     * &lt;p&gt;Escapes the characters in a {@code String} using Java String rules.&lt;/p&gt;<a name="line.513"></a>
+<span class="sourceLineNo">514</span>     *<a name="line.514"></a>
+<span class="sourceLineNo">515</span>     * &lt;p&gt;Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) &lt;/p&gt;<a name="line.515"></a>
+<span class="sourceLineNo">516</span>     *<a name="line.516"></a>
+<span class="sourceLineNo">517</span>     * &lt;p&gt;So a tab becomes the characters {@code '\\'} and<a name="line.517"></a>
+<span class="sourceLineNo">518</span>     * {@code 't'}.&lt;/p&gt;<a name="line.518"></a>
+<span class="sourceLineNo">519</span>     *<a name="line.519"></a>
+<span class="sourceLineNo">520</span>     * &lt;p&gt;The only difference between Java strings and JavaScript strings<a name="line.520"></a>
+<span class="sourceLineNo">521</span>     * is that in JavaScript, a single quote and forward-slash (/) are escaped.&lt;/p&gt;<a name="line.521"></a>
+<span class="sourceLineNo">522</span>     *<a name="line.522"></a>
+<span class="sourceLineNo">523</span>     * &lt;p&gt;Example:&lt;/p&gt;<a name="line.523"></a>
+<span class="sourceLineNo">524</span>     * &lt;pre&gt;<a name="line.524"></a>
+<span class="sourceLineNo">525</span>     * input string: He didn't say, "Stop!"<a name="line.525"></a>
+<span class="sourceLineNo">526</span>     * output string: He didn't say, \"Stop!\"<a name="line.526"></a>
+<span class="sourceLineNo">527</span>     * &lt;/pre&gt;<a name="line.527"></a>
+<span class="sourceLineNo">528</span>     *<a name="line.528"></a>
+<span class="sourceLineNo">529</span>     * @param input  String to escape values in, may be null<a name="line.529"></a>
+<span class="sourceLineNo">530</span>     * @return String with escaped values, {@code null} if null string input<a name="line.530"></a>
+<span class="sourceLineNo">531</span>     */<a name="line.531"></a>
+<span class="sourceLineNo">532</span>    public static final String escapeJava(final String input) {<a name="line.532"></a>
+<span class="sourceLineNo">533</span>        return ESCAPE_JAVA.translate(input);<a name="line.533"></a>
+<span class="sourceLineNo">534</span>    }<a name="line.534"></a>
+<span class="sourceLineNo">535</span><a name="line.535"></a>
+<span class="sourceLineNo">536</span>    /**<a name="line.536"></a>
+<span class="sourceLineNo">537</span>     * &lt;p&gt;Escapes the characters in a {@code String} using EcmaScript String rules.&lt;/p&gt;<a name="line.537"></a>
+<span class="sourceLineNo">538</span>     * &lt;p&gt;Escapes any values it finds into their EcmaScript String form.<a name="line.538"></a>
+<span class="sourceLineNo">539</span>     * Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) &lt;/p&gt;<a name="line.539"></a>
+<span class="sourceLineNo">540</span>     *<a name="line.540"></a>
+<span class="sourceLineNo">541</span>     * &lt;p&gt;So a tab becomes the characters {@code '\\'} and<a name="line.541"></a>
+<span class="sourceLineNo">542</span>     * {@code 't'}.&lt;/p&gt;<a name="line.542"></a>
+<span class="sourceLineNo">543</span>     *<a name="line.543"></a>
+<span class="sourceLineNo">544</span>     * &lt;p&gt;The only difference between Java strings and EcmaScript strings<a name="line.544"></a>
+<span class="sourceLineNo">545</span>     * is that in EcmaScript, a single quote and forward-slash (/) are escaped.&lt;/p&gt;<a name="line.545"></a>
+<span class="sourceLineNo">546</span>     *<a name="line.546"></a>
+<span class="sourceLineNo">547</span>     * &lt;p&gt;Note that EcmaScript is best known by the JavaScript and ActionScript dialects. &lt;/p&gt;<a name="line.547"></a>
+<span class="sourceLineNo">548</span>     *<a name="line.548"></a>
+<span class="sourceLineNo">549</span>     * &lt;p&gt;Example:&lt;/p&gt;<a name="line.549"></a>
+<span class="sourceLineNo">550</span>     * &lt;pre&gt;<a name="line.550"></a>
+<span class="sourceLineNo">551</span>     * input string: He didn't say, "Stop!"<a name="line.551"></a>
+<span class="sourceLineNo">552</span>     * output string: He didn\'t say, \"Stop!\"<a name="line.552"></a>
+<span class="sourceLineNo">553</span>     * &lt;/pre&gt;<a name="line.553"></a>
 <span class="sourceLineNo">554</span>     *<a name="line.554"></a>
-<span class="sourceLineNo">555</span>     * @param input  String to escape values in, may be null<a name="line.555"></a>
-<span class="sourceLineNo">556</span>     * @return String with escaped values, {@code null} if null string input<a name="line.556"></a>
-<span class="sourceLineNo">557</span>     */<a name="line.557"></a>
-<span class="sourceLineNo">558</span>    public static final String escapeEcmaScript(final String input) {<a name="line.558"></a>
-<span class="sourceLineNo">559</span>        return ESCAPE_ECMASCRIPT.translate(input);<a name="line.559"></a>
-<span class="sourceLineNo">560</span>    }<a name="line.560"></a>
-<span class="sourceLineNo">561</span><a name="line.561"></a>
-<span class="sourceLineNo">562</span>    /**<a name="line.562"></a>
-<span class="sourceLineNo">563</span>     * &lt;p&gt;Escapes the characters in a {@code String} using Json String rules.&lt;/p&gt;<a name="line.563"></a>
-<span class="sourceLineNo">564</span>     * &lt;p&gt;Escapes any values it finds into their Json String form.<a name="line.564"></a>
-<span class="sourceLineNo">565</span>     * Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) &lt;/p&gt;<a name="line.565"></a>
-<span class="sourceLineNo">566</span>     *<a name="line.566"></a>
-<span class="sourceLineNo">567</span>     * &lt;p&gt;So a tab becomes the characters {@code '\\'} and<a name="line.567"></a>
-<span class="sourceLineNo">568</span>     * {@code 't'}.&lt;/p&gt;<a name="line.568"></a>
-<span class="sourceLineNo">569</span>     *<a name="line.569"></a>
-<span class="sourceLineNo">570</span>     * &lt;p&gt;The only difference between Java strings and Json strings<a name="line.570"></a>
-<span class="sourceLineNo">571</span>     * is that in Json, forward-slash (/) is escaped.&lt;/p&gt;<a name="line.571"></a>
-<span class="sourceLineNo">572</span>     *<a name="line.572"></a>
-<span class="sourceLineNo">573</span>     * &lt;p&gt;See http://www.ietf.org/rfc/rfc4627.txt for further details. &lt;/p&gt;<a name="line.573"></a>
-<span class="sourceLineNo">574</span>     *<a name="line.574"></a>
-<span class="sourceLineNo">575</span>     * &lt;p&gt;Example:&lt;/p&gt;<a name="line.575"></a>
-<span class="sourceLineNo">576</span>     * &lt;pre&gt;<a name="line.576"></a>
-<span class="sourceLineNo">577</span>     * input string: He didn't say, "Stop!"<a name="line.577"></a>
-<span class="sourceLineNo">578</span>     * output string: He didn't say, \"Stop!\"<a name="line.578"></a>
-<span class="sourceLineNo">579</span>     * &lt;/pre&gt;<a name="line.579"></a>
-<span class="sourceLineNo">580</span>     *<a name="line.580"></a>
-<span class="sourceLineNo">581</span>     * @param input  String to escape values in, may be null<a name="line.581"></a>
-<span class="sourceLineNo">582</span>     * @return String with escaped values, {@code null} if null string input<a name="line.582"></a>
-<span class="sourceLineNo">583</span>     */<a name="line.583"></a>
-<span class="sourceLineNo">584</span>    public static final String escapeJson(final String input) {<a name="line.584"></a>
-<span class="sourceLineNo">585</span>        return ESCAPE_JSON.translate(input);<a name="line.585"></a>
-<span class="sourceLineNo">586</span>    }<a name="line.586"></a>
-<span class="sourceLineNo">587</span><a name="line.587"></a>
-<span class="sourceLineNo">588</span>    /**<a name="line.588"></a>
-<span class="sourceLineNo">589</span>     * &lt;p&gt;Unescapes any Java literals found in the {@code String}.<a name="line.589"></a>
-<span class="sourceLineNo">590</span>     * For example, it will turn a sequence of {@code '\'} and<a name="line.590"></a>
-<span class="sourceLineNo">591</span>     * {@code 'n'} into a newline character, unless the {@code '\'}<a name="line.591"></a>
-<span class="sourceLineNo">592</span>     * is preceded by another {@code '\'}.&lt;/p&gt;<a name="line.592"></a>
-<span class="sourceLineNo">593</span>     *<a name="line.593"></a>
-<span class="sourceLineNo">594</span>     * @param input  the {@code String} to unescape, may be null<a name="line.594"></a>
-<span class="sourceLineNo">595</span>     * @return a new unescaped {@code String}, {@code null} if null string input<a name="line.595"></a>
-<span class="sourceLineNo">596</span>     */<a name="line.596"></a>
-<span class="sourceLineNo">597</span>    public static final String unescapeJava(final String input) {<a name="line.597"></a>
-<span class="sourceLineNo">598</span>        return UNESCAPE_JAVA.translate(input);<a name="line.598"></a>
-<span class="sourceLineNo">599</span>    }<a name="line.599"></a>
-<span class="sourceLineNo">600</span><a name="line.600"></a>
-<span class="sourceLineNo">601</span>    /**<a name="line.601"></a>
-<span class="sourceLineNo">602</span>     * &lt;p&gt;Unescapes any EcmaScript literals found in the {@code String}.&lt;/p&gt;<a name="line.602"></a>
-<span class="sourceLineNo">603</span>     *<a name="line.603"></a>
-<span class="sourceLineNo">604</span>     * &lt;p&gt;For example, it will turn a sequence of {@code '\'} and {@code 'n'}<a name="line.604"></a>
-<span class="sourceLineNo">605</span>     * into a newline character, unless the {@code '\'} is preceded by another<a name="line.605"></a>
-<span class="sourceLineNo">606</span>     * {@code '\'}.&lt;/p&gt;<a name="line.606"></a>
-<span class="sourceLineNo">607</span>     *<a name="line.607"></a>
-<span class="sourceLineNo">608</span>     * @see #unescapeJava(String)<a name="line.608"></a>
-<span class="sourceLineNo">609</span>     * @param input  the {@code String} to unescape, may be null<a name="line.609"></a>
-<span class="sourceLineNo">610</span>     * @return A new unescaped {@code String}, {@code null} if null string input<a name="line.610"></a>
-<span class="sourceLineNo">611</span>     */<a name="line.611"></a>
-<span class="sourceLineNo">612</span>    public static final String unescapeEcmaScript(final String input) {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>        return UNESCAPE_ECMASCRIPT.translate(input);<a name="line.613"></a>
-<span class="sourceLineNo">614</span>    }<a name="line.614"></a>
-<span class="sourceLineNo">615</span><a name="line.615"></a>
-<span class="sourceLineNo">616</span>    /**<a name="line.616"></a>
-<span class="sourceLineNo">617</span>     * &lt;p&gt;Unescapes any Json literals found in the {@code String}.&lt;/p&gt;<a name="line.617"></a>
-<span class="sourceLineNo">618</span>     *<a name="line.618"></a>
-<span class="sourceLineNo">619</span>     * &lt;p&gt;For example, it will turn a sequence of {@code '\'} and {@code 'n'}<a name="line.619"></a>
-<span class="sourceLineNo">620</span>     * into a newline character, unless the {@code '\'} is preceded by another<a name="line.620"></a>
-<span class="sourceLineNo">621</span>     * {@code '\'}.&lt;/p&gt;<a name="line.621"></a>
-<span class="sourceLineNo">622</span>     *<a name="line.622"></a>
-<span class="sourceLineNo">623</span>     * @see #unescapeJava(String)<a name="line.623"></a>
-<span class="sourceLineNo">624</span>     * @param input  the {@code String} to unescape, may be null<a name="line.624"></a>
-<span class="sourceLineNo">625</span>     * @return A new unescaped {@code String}, {@code null} if null string input<a name="line.625"></a>
-<span class="sourceLineNo">626</span>     */<a name="line.626"></a>
-<span class="sourceLineNo">627</span>    public static final String unescapeJson(final String input) {<a name="line.627"></a>
-<span class="sourceLineNo">628</span>        return UNESCAPE_JSON.translate(input);<a name="line.628"></a>
-<span class="sourceLineNo">629</span>    }<a name="line.629"></a>
-<span class="sourceLineNo">630</span><a name="line.630"></a>
-<span class="sourceLineNo">631</span>    // HTML and XML<a name="line.631"></a>
-<span class="sourceLineNo">632</span>    //--------------------------------------------------------------------------<a name="line.632"></a>
-<span class="sourceLineNo">633</span>    /**<a name="line.633"></a>
-<span class="sourceLineNo">634</span>     * &lt;p&gt;Escapes the characters in a {@code String} using HTML entities.&lt;/p&gt;<a name="line.634"></a>
-<span class="sourceLineNo">635</span>     *<a name="line.635"></a>
-<span class="sourceLineNo">636</span>     * &lt;p&gt;<a name="line.636"></a>
-<span class="sourceLineNo">637</span>     * For example:<a name="line.637"></a>
-<span class="sourceLineNo">638</span>     * &lt;/p&gt;<a name="line.638"></a>
-<span class="sourceLineNo">639</span>     * &lt;p&gt;&lt;code&gt;"bread" &amp;amp; "butter"&lt;/code&gt;&lt;/p&gt;<a name="line.639"></a>
-<span class="sourceLineNo">640</span>     * becomes:<a name="line.640"></a>
-<span class="sourceLineNo">641</span>     * &lt;p&gt;<a name="line.641"></a>
-<span class="sourceLineNo">642</span>     * &lt;code&gt;&amp;amp;quot;bread&amp;amp;quot; &amp;amp;amp; &amp;amp;quot;butter&amp;amp;quot;&lt;/code&gt;.<a name="line.642"></a>
-<span class="sourceLineNo">643</span>     * &lt;/p&gt;<a name="line.643"></a>
-<span class="sourceLineNo">644</span>     *<a name="line.644"></a>
-<span class="sourceLineNo">645</span>     * &lt;p&gt;Supports all known HTML 4.0 entities, including funky accents.<a name="line.645"></a>
-<span class="sourceLineNo">646</span>     * Note that the commonly used apostrophe escape character (&amp;amp;apos;)<a name="line.646"></a>
-<span class="sourceLineNo">647</span>     * is not a legal entity and so is not supported). &lt;/p&gt;<a name="line.647"></a>
-<span class="sourceLineNo">648</span>     *<a name="line.648"></a>
-<span class="sourceLineNo">649</span>     * @param input  the {@code String} to escape, may be null<a name="line.649"></a>
-<span class="sourceLineNo">650</span>     * @return a new escaped {@code String}, {@code null} if null string input<a name="line.650"></a>
+<span class="sourceLineNo">555</span>     * &lt;b&gt;Security Note.&lt;/b&gt; We only provide backslash escaping in this method. For example, {@code '\"'} has the output<a name="line.555"></a>
+<span class="sourceLineNo">556</span>     * {@code '\\\"'} which could result in potential issues in the case where the string being escaped is being used<a name="line.556"></a>
+<span class="sourceLineNo">557</span>     * in an HTML tag like {@code &lt;select onmouseover="..." /&gt;}. If you wish to have more rigorous string escaping, you<a name="line.557"></a>
+<span class="sourceLineNo">558</span>     * may consider the<a name="line.558"></a>
+<span class="sourceLineNo">559</span>     * &lt;a href="https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API_JAVA"&gt;ESAPI Libraries&lt;/a&gt;.<a name="line.559"></a>
+<span class="sourceLineNo">560</span>     * Further, you can view the &lt;a href="https://github.com/esapi"&gt;ESAPI GitHub Org&lt;/a&gt;.<a name="line.560"></a>
+<span class="sourceLineNo">561</span>     *<a name="line.561"></a>
+<span class="sourceLineNo">562</span>     * @param input  String to escape values in, may be null<a name="line.562"></a>
+<span class="sourceLineNo">563</span>     * @return String with escaped values, {@code null} if null string input<a name="line.563"></a>
+<span class="sourceLineNo">564</span>     */<a name="line.564"></a>
+<span class="sourceLineNo">565</span>    public static final String escapeEcmaScript(final String input) {<a name="line.565"></a>
+<span class="sourceLineNo">566</span>        return ESCAPE_ECMASCRIPT.translate(input);<a name="line.566"></a>
+<span class="sourceLineNo">567</span>    }<a name="line.567"></a>
+<span class="sourceLineNo">568</span><a name="line.568"></a>
+<span class="sourceLineNo">569</span>    /**<a name="line.569"></a>
+<span class="sourceLineNo">570</span>     * &lt;p&gt;Escapes the characters in a {@code String} using Json String rules.&lt;/p&gt;<a name="line.570"></a>
+<span class="sourceLineNo">571</span>     * &lt;p&gt;Escapes any values it finds into their Json String form.<a name="line.571"></a>
+<span class="sourceLineNo">572</span>     * Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.) &lt;/p&gt;<a name="line.572"></a>
+<span class="sourceLineNo">573</span>     *<a name="line.573"></a>
+<span class="sourceLineNo">574</span>     * &lt;p&gt;So a tab becomes the characters {@code '\\'} and<a name="line.574"></a>
+<span class="sourceLineNo">575</span>     * {@code 't'}.&lt;/p&gt;<a name="line.575"></a>
+<span class="sourceLineNo">576</span>     *<a name="line.576"></a>
+<span class="sourceLineNo">577</span>     * &lt;p&gt;The only difference between Java strings and Json strings<a name="line.577"></a>
+<span class="sourceLineNo">578</span>     * is that in Json, forward-slash (/) is escaped.&lt;/p&gt;<a name="line.578"></a>
+<span class="sourceLineNo">579</span>     *<a name="line.579"></a>
+<span class="sourceLineNo">580</span>     * &lt;p&gt;See http://www.ietf.org/rfc/rfc4627.txt for further details. &lt;/p&gt;<a name="line.580"></a>
+<span class="sourceLineNo">581</span>     *<a name="line.581"></a>
+<span class="sourceLineNo">582</span>     * &lt;p&gt;Example:&lt;/p&gt;<a name="line.582"></a>
+<span class="sourceLineNo">583</span>     * &lt;pre&gt;<a name="line.583"></a>
+<span class="sourceLineNo">584</span>     * input string: He didn't say, "Stop!"<a name="line.584"></a>
+<span class="sourceLineNo">585</span>     * output string: He didn't say, \"Stop!\"<a name="line.585"></a>
+<span class="sourceLineNo">586</span>     * &lt;/pre&gt;<a name="line.586"></a>
+<span class="sourceLineNo">587</span>     *<a name="line.587"></a>
+<span class="sourceLineNo">588</span>     * @param input  String to escape values in, may be null<a name="line.588"></a>
+<span class="sourceLineNo">589</span>     * @return String with escaped values, {@code null} if null string input<a name="line.589"></a>
+<span class="sourceLineNo">590</span>     */<a name="line.590"></a>
+<span class="sourceLineNo">591</span>    public static final String escapeJson(final String input) {<a name="line.591"></a>
+<span class="sourceLineNo">592</span>        return ESCAPE_JSON.translate(input);<a name="line.592"></a>
+<span class="sourceLineNo">593</span>    }<a name="line.593"></a>
+<span class="sourceLineNo">594</span><a name="line.594"></a>
+<span class="sourceLineNo">595</span>    /**<a name="line.595"></a>
+<span class="sourceLineNo">596</span>     * &lt;p&gt;Unescapes any Java literals found in the {@code String}.<a name="line.596"></a>
+<span class="sourceLineNo">597</span>     * For example, it will turn a sequence of {@code '\'} and<a name="line.597"></a>
+<span class="sourceLineNo">598</span>     * {@code 'n'} into a newline character, unless the {@code '\'}<a name="line.598"></a>
+<span class="sourceLineNo">599</span>     * is preceded by another {@code '\'}.&lt;/p&gt;<a name="line.599"></a>
+<span class="sourceLineNo">600</span>     *<a name="line.600"></a>
+<span class="sourceLineNo">601</span>     * @param input  the {@code String} to unescape, may be null<a name="line.601"></a>
+<span class="sourceLineNo">602</span>     * @return a new unescaped {@code String}, {@code null} if null string input<a name="line.602"></a>
+<span class="sourceLineNo">603</span>     */<a name="line.603"></a>
+<span class="sourceLineNo">604</span>    public static final String unescapeJava(final String input) {<a name="line.604"></a>
+<span class="sourceLineNo">605</span>        return UNESCAPE_JAVA.translate(input);<a name="line.605"></a>
+<span class="sourceLineNo">606</span>    }<a name="line.606"></a>
+<span class="sourceLineNo">607</span><a name="line.607"></a>
+<span class="sourceLineNo">608</span>    /**<a name="line.608"></a>
+<span class="sourceLineNo">609</span>     * &lt;p&gt;Unescapes any EcmaScript literals found in the {@code String}.&lt;/p&gt;<a name="line.609"></a>
+<span class="sourceLineNo">610</span>     *<a name="line.610"></a>
+<span class="sourceLineNo">611</span>     * &lt;p&gt;For example, it will turn a sequence of {@code '\'} and {@code 'n'}<a name="line.611"></a>
+<span class="sourceLineNo">612</span>     * into a newline character, unless the {@code '\'} is preceded by another<a name="line.612"></a>
+<span class="sourceLineNo">613</span>     * {@code '\'}.&lt;/p&gt;<a name="line.613"></a>
+<span class="sourceLineNo">614</span>     *<a name="line.614"></a>
+<span class="sourceLineNo">615</span>     * @see #unescapeJava(String)<a name="line.615"></a>
+<span class="sourceLineNo">616</span>     * @param input  the {@code String} to unescape, may be null<a name="line.616"></a>
+<span class="sourceLineNo">617</span>     * @return A new unescaped {@code String}, {@code null} if null string input<a name="line.617"></a>
+<span class="sourceLineNo">618</span>     */<a name="line.618"></a>
+<span class="sourceLineNo">619</span>    public static final String unescapeEcmaScript(final String input) {<a name="line.619"></a>
+<span class="sourceLineNo">620</span>        return UNESCAPE_ECMASCRIPT.translate(input);<a name="line.620"></a>
+<span class="sourceLineNo">621</span>    }<a name="line.621"></a>
+<span class="sourceLineNo">622</span><a name="line.622"></a>
+<span class="sourceLineNo">623</span>    /**<a name="line.623"></a>
+<span class="sourceLineNo">624</span>     * &lt;p&gt;Unescapes any Json literals found in the {@code String}.&lt;/p&gt;<a name="line.624"></a>
+<span class="sourceLineNo">625</span>     *<a name="line.625"></a>
+<span class="sourceLineNo">626</span>     * &lt;p&gt;For example, it will turn a sequence of {@code '\'} and {@code 'n'}<a name="line.626"></a>
+<span class="sourceLineNo">627</span>     * into a newline character, unless the {@code '\'} is preceded by another<a name="line.627"></a>
+<span class="sourceLineNo">628</span>     * {@code '\'}.&lt;/p&gt;<a name="line.628"></a>
+<span class="sourceLineNo">629</span>     *<a name="line.629"></a>
+<span class="sourceLineNo">630</span>     * @see #unescapeJava(String)<a name="line.630"></a>
+<span class="sourceLineNo">631</span>     * @param input  the {@code String} to unescape, may be null<a name="line.631"></a>
+<span class="sourceLineNo">632</span>     * @return A new unescaped {@code String}, {@code null} if null string input<a name="line.632"></a>
+<span class="sourceLineNo">633</span>     */<a name="line.633"></a>
+<span class="sourceLineNo">634</span>    public static final String unescapeJson(final String input) {<a name="line.634"></a>
+<span class="sourceLineNo">635</span>        return UNESCAPE_JSON.translate(input);<a name="line.635"></a>
+<span class="sourceLineNo">636</span>    }<a name="line.636"></a>
+<span class="sourceLineNo">637</span><a name="line.637"></a>
+<span class="sourceLineNo">638</span>    // HTML and XML<a name="line.638"></a>
+<span class="sourceLineNo">639</span>    //--------------------------------------------------------------------------<a name="line.639"></a>
+<span class="sourceLineNo">640</span>    /**<a name="line.640"></a>
+<span class="sourceLineNo">641</span>     * &lt;p&gt;Escapes the characters in a {@code String} using HTML entities.&lt;/p&gt;<a name="line.641"></a>
+<span class="sourceLineNo">642</span>     *<a name="line.642"></a>
+<span class="sourceLineNo">643</span>     * &lt;p&gt;<a name="line.643"></a>
+<span class="sourceLineNo">644</span>     * For example:<a name="line.644"></a>
+<span class="sourceLineNo">645</span>     * &lt;/p&gt;<a name="line.645"></a>
+<span class="sourceLineNo">646</span>     * &lt;p&gt;&lt;code&gt;"bread" &amp;amp; "butter"&lt;/code&gt;&lt;/p&gt;<a name="line.646"></a>
+<span class="sourceLineNo">647</span>     * becomes:<a name="line.647"></a>
+<span class="sourceLineNo">648</span>     * &lt;p&gt;<a name="line.648"></a>
+<span class="sourceLineNo">649</span>     * &lt;code&gt;&amp;amp;quot;bread&amp;amp;quot; &amp;amp;amp; &amp;amp;quot;butter&amp;amp;quot;&lt;/code&gt;.<a name="line.649"></a>
+<span class="sourceLineNo">650</span>     * &lt;/p&gt;<a name="line.650"></a>
 <span class="sourceLineNo">651</span>     *<a name="line.651"></a>
-<span class="sourceLineNo">652</span>     * @see &lt;a href="http://hotwired.lycos.com/webmonkey/reference/special_characters/"&gt;ISO Entities&lt;/a&gt;<a name="line.652"></a>
-<span class="sourceLineNo">653</span>     * @see &lt;a href="http://www.w3.org/TR/REC-html32#latin1"&gt;HTML 3.2 Character Entities for ISO Latin-1&lt;/a&gt;<a name="line.653"></a>
-<span class="sourceLineNo">654</span>     * @see &lt;a href="http://www.w3.org/TR/REC-html40/sgml/entities.html"&gt;HTML 4.0 Character entity references&lt;/a&gt;<a name="line.654"></a>
-<span class="sourceLineNo">655</span>     * @see &lt;a href="http://www.w3.org/TR/html401/charset.html#h-5.3"&gt;HTML 4.01 Character References&lt;/a&gt;<a name="line.655"></a>
-<span class="sourceLineNo">656</span>     * @see &lt;a href="http://www.w3.org/TR/html401/charset.html#code-position"&gt;HTML 4.01 Code positions&lt;/a&gt;<a name="line.656"></a>
-<span class="sourceLineNo">657</span>     */<a name="line.657"></a>
-<span class="sourceLineNo">658</span>    public static final String escapeHtml4(final String input) {<a name="line.658"></a>
-<span class="sourceLineNo">659</span>        return ESCAPE_HTML4.translate(input);<a name="line.659"></a>
-<span class="sourceLineNo">660</span>    }<a name="line.660"></a>
-<span class="sourceLineNo">661</span><a name="line.661"></a>
-<span class="sourceLineNo">662</span>    /**<a name="line.662"></a>
-<span class="sourceLineNo">663</span>     * &lt;p&gt;Escapes the characters in a {@code String} using HTML entities.&lt;/p&gt;<a name="line.663"></a>
-<span class="sourceLineNo">664</span>     * &lt;p&gt;Supports only the HTML 3.0 entities. &lt;/p&gt;<a name="line.664"></a>
-<span class="sourceLineNo">665</span>     *<a name="line.665"></a>
-<span class="sourceLineNo">666</span>     * @param input  the {@code String} to escape, may be null<a name="line.666"></a>
-<span class="sourceLineNo">667</span>     * @return a new escaped {@code String}, {@code null} if null string input<a name="line.667"></a>
-<span class="sourceLineNo">668</span>     */<a name="line.668"></a>
-<span class="sourceLineNo">669</span>    public static final String escapeHtml3(final String input) {<a name="line.669"></a>
-<span class="sourceLineNo">670</span>        return ESCAPE_HTML3.translate(input);<a name="line.670"></a>
-<span class="sourceLineNo">671</span>    }<a name="line.671"></a>
-<span class="sourceLineNo">672</span><a name="line.672"></a>
-<span class="sourceLineNo">673</span>    //-----------------------------------------------------------------------<a name="line.673"></a>
-<span class="sourceLineNo">674</span>    /**<a name="line.674"></a>
-<span class="sourceLineNo">675</span>     * &lt;p&gt;Unescapes a string containing entity escapes to a string<a name="line.675"></a>
-<span class="sourceLineNo">676</span>     * containing the actual Unicode characters corresponding to the<a name="line.676"></a>
-<span class="sourceLineNo">677</span>     * escapes. Supports HTML 4.0 entities.&lt;/p&gt;<a name="line.677"></a>
-<span class="sourceLineNo">678</span>     *<a name="line.678"></a>
-<span class="sourceLineNo">679</span>     * &lt;p&gt;For example, the string {@code "&amp;lt;Fran&amp;ccedil;ais&amp;gt;"}<a name="line.679"></a>
-<span class="sourceLineNo">680</span>     * will become {@code "&lt;Fran�ais&gt;"}&lt;/p&gt;<a name="line.680"></a>
-<span class="sourceLineNo">681</span>     *<a name="line.681"></a>
-<span class="sourceLineNo">682</span>     * &lt;p&gt;If an entity is unrecognized, it is left alone, and inserted<a name="line.682"></a>
-<span class="sourceLineNo">683</span>     * verbatim into the result string. e.g. {@code "&amp;gt;&amp;zzzz;x"} will<a name="line.683"></a>
-<span class="sourceLineNo">684</span>     * become {@code "&gt;&amp;zzzz;x"}.&lt;/p&gt;<a name="line.684"></a>
+<span class="sourceLineNo">652</span>     * &lt;p&gt;Supports all known HTML 4.0 entities, including funky accents.<a name="line.652"></a>
+<span class="sourceLineNo">653</span>     * Note that the commonly used apostrophe escape character (&amp;amp;apos;)<a name="line.653"></a>
+<span class="sourceLineNo">654</span>     * is not a legal entity and so is not supported). &lt;/p&gt;<a name="line.654"></a>
+<span class="sourceLineNo">655</span>     *<a name="line.655"></a>
+<span class="sourceLineNo">656</span>     * @param input  the {@code String} to escape, may be null<a name="line.656"></a>
+<span class="sourceLineNo">657</span>     * @return a new escaped {@code String}, {@code null} if null string input<a name="line.657"></a>
+<span class="sourceLineNo">658</span>     *<a name="line.658"></a>
+<span class="sourceLineNo">659</span>     * @see &lt;a href="http://hotwired.lycos.com/webmonkey/reference/special_characters/"&gt;ISO Entities&lt;/a&gt;<a name="line.659"></a>
+<span class="sourceLineNo">660</span>     * @see &lt;a href="http://www.w3.org/TR/REC-html32#latin1"&gt;HTML 3.2 Character Entities for ISO Latin-1&lt;/a&gt;<a name="line.660"></a>
+<span class="sourceLineNo">661</span>     * @see &lt;a href="http://www.w3.org/TR/REC-html40/sgml/entities.html"&gt;HTML 4.0 Character entity references&lt;/a&gt;<a name="line.661"></a>
+<span class="sourceLineNo">662</span>     * @see &lt;a href="http://www.w3.org/TR/html401/charset.html#h-5.3"&gt;HTML 4.01 Character References&lt;/a&gt;<a name="line.662"></a>
+<span class="sourceLineNo">663</span>     * @see &lt;a href="http://www.w3.org/TR/html401/charset.html#code-position"&gt;HTML 4.01 Code positions&lt;/a&gt;<a name="line.663"></a>
+<span class="sourceLineNo">664</span>     */<a name="line.664"></a>
+<span class="sourceLineNo">665</span>    public static final String escapeHtml4(final String input) {<a name="line.665"></a>
+<span class="sourceLineNo">666</span>        return ESCAPE_HTML4.translate(input);<a name="line.666"></a>
+<span class="sourceLineNo">667</span>    }<a name="line.667"></a>
+<span class="sourceLineNo">668</span><a name="line.668"></a>
+<span class="sourceLineNo">669</span>    /**<a name="line.669"></a>
+<span class="sourceLineNo">670</span>     * &lt;p&gt;Escapes the characters in a {@code String} using HTML entities.&lt;/p&gt;<a name="line.670"></a>
+<span class="sourceLineNo">671</span>     * &lt;p&gt;Supports only the HTML 3.0 entities. &lt;/p&gt;<a name="line.671"></a>
+<span class="sourceLineNo">672</span>     *<a name="line.672"></a>
+<span class="sourceLineNo">673</span>     * @param input  the {@code String} to escape, may be null<a name="line.673"></a>
+<span class="sourceLineNo">674</span>     * @return a new escaped {@code String}, {@code null} if null string input<a name="line.674"></a>
+<span class="sourceLineNo">675</span>     */<a name="line.675"></a>
+<span class="sourceLineNo">676</span>    public static final String escapeHtml3(final String input) {<a name="line.676"></a>
+<span class="sourceLineNo">677</span>        return ESCAPE_HTML3.translate(input);<a name="line.677"></a>
+<span class="sourceLineNo">678</span>    }<a name="line.678"></a>
+<span class="sourceLineNo">679</span><a name="line.679"></a>
+<span class="sourceLineNo">680</span>    //-----------------------------------------------------------------------<a name="line.680"></a>
+<span class="sourceLineNo">681</span>    /**<a name="line.681"></a>
+<span class="sourceLineNo">682</span>     * &lt;p&gt;Unescapes a string containing entity escapes to a string<a name="line.682"></a>
+<span class="sourceLineNo">683</span>     * containing the actual Unicode characters corresponding to the<a name="line.683"></a>
+<span class="sourceLineNo">684</span>     * escapes. Supports HTML 4.0 entities.&lt;/p&gt;<a name="line.684"></a>
 <span class="sourceLineNo">685</span>     *<a name="line.685"></a>
-<span class="sourceLineNo">686</span>     * @param input  the {@code String} to unescape, may be null<a name="line.686"></a>
-<span class="sourceLineNo">687</span>     * @return a new unescaped {@code String}, {@code null} if null string input<a name="line.687"></a>
-<span class="sourceLineNo">688</span>     */<a name="line.688"></a>
-<span class="sourceLineNo">689</span>    public static final String unescapeHtml4(final String input) {<a name="line.689"></a>
-<span class="sourceLineNo">690</span>        return UNESCAPE_HTML4.translate(input);<a name="line.690"></a>
-<span class="sourceLineNo">691</span>    }<a name="line.691"></a>
-<span class="sourceLineNo">692</span><a name="line.692"></a>
-<span class="sourceLineNo">693</span>    /**<a name="line.693"></a>
-<span class="sourceLineNo">694</span>     * &lt;p&gt;Unescapes a string containing entity escapes to a string<a name="line.694"></a>
-<span class="sourceLineNo">695</span>     * containing the actual Unicode characters corresponding to the<a name="line.695"></a>
-<span class="sourceLineNo">696</span>     * escapes. Supports only HTML 3.0 entities.&lt;/p&gt;<a name="line.696"></a>
-<span class="sourceLineNo">697</span>     *<a name="line.697"></a>
-<span class="sourceLineNo">698</span>     * @param input  the {@code String} to unescape, may be null<a name="line.698"></a>
-<span class="sourceLineNo">699</span>     * @return a new unescaped {@code String}, {@code null} if null string input<a name="line.699"></a>
-<span class="sourceLineNo">700</span>     */<a name="line.700"></a>
-<span class="sourceLineNo">701</span>    public static final String unescapeHtml3(final String input) {<a name="line.701"></a>
-<span class="sourceLineNo">702</span>        return UNESCAPE_HTML3.translate(input);<a name="line.702"></a>
-<span class="sourceLineNo">703</span>    }<a name="line.703"></a>
-<span class="sourceLineNo">704</span><a name="line.704"></a>
-<span class="sourceLineNo">705</span>    /**<a name="line.705"></a>
-<span class="sourceLineNo">706</span>     * &lt;p&gt;Escapes the characters in a {@code String} using XML entities.&lt;/p&gt;<a name="line.706"></a>
-<span class="sourceLineNo">707</span>     *<a name="line.707"></a>
-<span class="sourceLineNo">708</span>     * &lt;p&gt;For example: {@code "bread" &amp; "butter"} =&amp;gt;<a name="line.708"></a>
-<span class="sourceLineNo">709</span>     * {@code &amp;quot;bread&amp;quot; &amp;amp; &amp;quot;butter&amp;quot;}.<a name="line.709"></a>
-<span class="sourceLineNo">710</span>     * &lt;/p&gt;<a name="line.710"></a>
-<span class="sourceLineNo">711</span>     *<a name="line.711"></a>
-<span class="sourceLineNo">712</span>     * &lt;p&gt;Note that XML 1.0 is a text-only format: it cannot represent control<a name="line.712"></a>
-<span class="sourceLineNo">713</span>     * characters or unpaired Unicode surrogate codepoints, even after escaping.<a name="line.713"></a>
-<span class="sourceLineNo">714</span>     * {@code escapeXml10} will remove characters that do not fit in the<a name="line.714"></a>
-<span class="sourceLineNo">715</span>     * following ranges:&lt;/p&gt;<a name="line.715"></a>
-<span class="sourceLineNo">716</span>     *<a name="line.716"></a>
-<span class="sourceLineNo">717</span>     * &lt;p&gt;{@code #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]}&lt;/p&gt;<a name="line.717"></a>
+<span class="sourceLineNo">686</span>     * &lt;p&gt;For example, the string {@code "&amp;lt;Fran&amp;ccedil;ais&amp;gt;"}<a name="line.686"></a>
+<span class="sourceLineNo">687</span>     * will become {@code "&lt;Fran�ais&gt;"}&lt;/p&gt;<a name="line.687"></a>
+<span class="sourceLineNo">688</span>     *<a name="line.688"></a>
+<span class="sourceLineNo">689</span>     * &lt;p&gt;If an entity is unrecognized, it is left alone, and inserted<a name="line.689"></a>
+<span class="sourceLineNo">690</span>     * verbatim into the result string. e.g. {@code "&amp;gt;&amp;zzzz;x"} will<a name="line.690"></a>
+<span class="sourceLineNo">691</span>     * become {@code "&gt;&amp;zzzz;x"}.&lt;/p&gt;<a name="line.691"></a>
+<span class="sourceLineNo">692</span>     *<a name="line.692"></a>
+<span class="sourceLineNo">693</span>     * @param input  the {@code String} to unescape, may be null<a name="line.693"></a>
+<span class="sourceLineNo">694</span>     * @return a new unescaped {@code String}, {@code null} if null string input<a name="line.694"></a>
+<span class="sourceLineNo">695</span>     */<a name="line.695"></a>
+<span class="sourceLineNo">696</span>    public static final String unescapeHtml4(final String input) {<a name="line.696"></a>
+<span class="sourceLineNo">697</span>        return UNESCAPE_HTML4.translate(input);<a name="line.697"></a>
+<span class="sourceLineNo">698</span>    }<a name="line.698"></a>
+<span class="sourceLineNo">699</span><a name="line.699"></a>
+<span class="sourceLineNo">700</span>    /**<a name="line.700"></a>
+<span class="sourceLineNo">701</span>     * &lt;p&gt;Unescapes a string containing entity escapes to a string<a name="line.701"></a>
+<span class="sourceLineNo">702</span>     * containing the actual Unicode characters corresponding to the<a name="line.702"></a>
+<span class="sourceLineNo">703</span>     * escapes. Supports only HTML 3.0 entities.&lt;/p&gt;<a name="line.703"></a>
+<span class="sourceLineNo">704</span>     *<a name="line.704"></a>
+<span class="sourceLineNo">705</span>     * @param input  the {@code String} to unescape, may be null<a name="line.705"></a>
+<span class="sourceLineNo">706</span>     * @return a new unescaped {@code String}, {@code null} if null string input<a name="line.706"></a>
+<span class="sourceLineNo">707</span>     */<a name="line.707"></a>
+<span class="sourceLineNo">708</span>    public static final String unescapeHtml3(final String input) {<a name="line.708"></a>
+<span class="sourceLineNo">709</span>        return UNESCAPE_HTML3.translate(input);<a name="line.709"></a>
+<span class="sourceLineNo">710</span>    }<a name="line.710"></a>
+<span class="sourceLineNo">711</span><a name="line.711"></a>
+<span class="sourceLineNo">712</span>    /**<a name="line.712"></a>
+<span class="sourceLineNo">713</span>     * &lt;p&gt;Escapes the characters in a {@code String} using XML entities.&lt;/p&gt;<a name="line.713"></a>
+<span class="sourceLineNo">714</span>     *<a name="line.714"></a>
+<span class="sourceLineNo">715</span>     * &lt;p&gt;For example: {@code "bread" &amp; "butter"} =&amp;gt;<a name="line.715"></a>

[... 308 lines stripped ...]


Mime
View raw message