commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chtom...@apache.org
Subject svn commit: r1008161 [14/44] - in /websites/production/commons/content/proper/commons-text: ./ apidocs/ apidocs/org/apache/commons/text/ apidocs/org/apache/commons/text/class-use/ apidocs/org/apache/commons/text/diff/ apidocs/org/apache/commons/text/di...
Date Sun, 12 Mar 2017 02:08:05 GMT
Modified: websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/AggregateTranslator.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/AggregateTranslator.html (original)
+++ websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/AggregateTranslator.html Sun Mar 12 02:08:01 2017
@@ -13,9 +13,9 @@
 <span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
 <span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
 <span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
-<span class="sourceLineNo">008</span> * <a name="line.8"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
 <span class="sourceLineNo">009</span> *      http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
-<span class="sourceLineNo">010</span> * <a name="line.10"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
 <span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
 <span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
 <span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
@@ -30,47 +30,50 @@
 <span class="sourceLineNo">022</span>import java.util.List;<a name="line.22"></a>
 <span class="sourceLineNo">023</span><a name="line.23"></a>
 <span class="sourceLineNo">024</span>/**<a name="line.24"></a>
-<span class="sourceLineNo">025</span> * Executes a sequence of translators one after the other. Execution ends whenever <a name="line.25"></a>
+<span class="sourceLineNo">025</span> * Executes a sequence of translators one after the other. Execution ends whenever<a name="line.25"></a>
 <span class="sourceLineNo">026</span> * the first translator consumes codepoints from the input.<a name="line.26"></a>
 <span class="sourceLineNo">027</span> *<a name="line.27"></a>
 <span class="sourceLineNo">028</span> * @since 1.0<a name="line.28"></a>
 <span class="sourceLineNo">029</span> */<a name="line.29"></a>
 <span class="sourceLineNo">030</span>public class AggregateTranslator extends CharSequenceTranslator {<a name="line.30"></a>
 <span class="sourceLineNo">031</span><a name="line.31"></a>
-<span class="sourceLineNo">032</span>    private final List&lt;CharSequenceTranslator&gt; translators = new ArrayList&lt;&gt;();<a name="line.32"></a>
-<span class="sourceLineNo">033</span><a name="line.33"></a>
-<span class="sourceLineNo">034</span>    /**<a name="line.34"></a>
-<span class="sourceLineNo">035</span>     * Specify the translators to be used at creation time. <a name="line.35"></a>
-<span class="sourceLineNo">036</span>     *<a name="line.36"></a>
-<span class="sourceLineNo">037</span>     * @param translators CharSequenceTranslator array to aggregate<a name="line.37"></a>
-<span class="sourceLineNo">038</span>     */<a name="line.38"></a>
-<span class="sourceLineNo">039</span>    public AggregateTranslator(final CharSequenceTranslator... translators) {<a name="line.39"></a>
-<span class="sourceLineNo">040</span>        if (translators != null) {<a name="line.40"></a>
-<span class="sourceLineNo">041</span>            for (CharSequenceTranslator translator : translators) {<a name="line.41"></a>
-<span class="sourceLineNo">042</span>                if (translator != null) {<a name="line.42"></a>
-<span class="sourceLineNo">043</span>                    this.translators.add(translator);<a name="line.43"></a>
-<span class="sourceLineNo">044</span>                }<a name="line.44"></a>
-<span class="sourceLineNo">045</span>            }<a name="line.45"></a>
-<span class="sourceLineNo">046</span>        }<a name="line.46"></a>
-<span class="sourceLineNo">047</span>    }<a name="line.47"></a>
-<span class="sourceLineNo">048</span><a name="line.48"></a>
-<span class="sourceLineNo">049</span>    /**<a name="line.49"></a>
-<span class="sourceLineNo">050</span>     * The first translator to consume codepoints from the input is the 'winner'. <a name="line.50"></a>
-<span class="sourceLineNo">051</span>     * Execution stops with the number of consumed codepoints being returned. <a name="line.51"></a>
-<span class="sourceLineNo">052</span>     * {@inheritDoc}<a name="line.52"></a>
-<span class="sourceLineNo">053</span>     */<a name="line.53"></a>
-<span class="sourceLineNo">054</span>    @Override<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    public int translate(final CharSequence input, final int index, final Writer out) throws IOException {<a name="line.55"></a>
-<span class="sourceLineNo">056</span>        for (final CharSequenceTranslator translator : translators) {<a name="line.56"></a>
-<span class="sourceLineNo">057</span>            final int consumed = translator.translate(input, index, out);<a name="line.57"></a>
-<span class="sourceLineNo">058</span>            if(consumed != 0) {<a name="line.58"></a>
-<span class="sourceLineNo">059</span>                return consumed;<a name="line.59"></a>
-<span class="sourceLineNo">060</span>            }<a name="line.60"></a>
-<span class="sourceLineNo">061</span>        }<a name="line.61"></a>
-<span class="sourceLineNo">062</span>        return 0;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>    }<a name="line.63"></a>
-<span class="sourceLineNo">064</span><a name="line.64"></a>
-<span class="sourceLineNo">065</span>}<a name="line.65"></a>
+<span class="sourceLineNo">032</span>    /**<a name="line.32"></a>
+<span class="sourceLineNo">033</span>     * Translator list.<a name="line.33"></a>
+<span class="sourceLineNo">034</span>     */<a name="line.34"></a>
+<span class="sourceLineNo">035</span>    private final List&lt;CharSequenceTranslator&gt; translators = new ArrayList&lt;&gt;();<a name="line.35"></a>
+<span class="sourceLineNo">036</span><a name="line.36"></a>
+<span class="sourceLineNo">037</span>    /**<a name="line.37"></a>
+<span class="sourceLineNo">038</span>     * Specify the translators to be used at creation time.<a name="line.38"></a>
+<span class="sourceLineNo">039</span>     *<a name="line.39"></a>
+<span class="sourceLineNo">040</span>     * @param translators CharSequenceTranslator array to aggregate<a name="line.40"></a>
+<span class="sourceLineNo">041</span>     */<a name="line.41"></a>
+<span class="sourceLineNo">042</span>    public AggregateTranslator(final CharSequenceTranslator... translators) {<a name="line.42"></a>
+<span class="sourceLineNo">043</span>        if (translators != null) {<a name="line.43"></a>
+<span class="sourceLineNo">044</span>            for (CharSequenceTranslator translator : translators) {<a name="line.44"></a>
+<span class="sourceLineNo">045</span>                if (translator != null) {<a name="line.45"></a>
+<span class="sourceLineNo">046</span>                    this.translators.add(translator);<a name="line.46"></a>
+<span class="sourceLineNo">047</span>                }<a name="line.47"></a>
+<span class="sourceLineNo">048</span>            }<a name="line.48"></a>
+<span class="sourceLineNo">049</span>        }<a name="line.49"></a>
+<span class="sourceLineNo">050</span>    }<a name="line.50"></a>
+<span class="sourceLineNo">051</span><a name="line.51"></a>
+<span class="sourceLineNo">052</span>    /**<a name="line.52"></a>
+<span class="sourceLineNo">053</span>     * The first translator to consume codepoints from the input is the 'winner'.<a name="line.53"></a>
+<span class="sourceLineNo">054</span>     * Execution stops with the number of consumed codepoints being returned.<a name="line.54"></a>
+<span class="sourceLineNo">055</span>     * {@inheritDoc}<a name="line.55"></a>
+<span class="sourceLineNo">056</span>     */<a name="line.56"></a>
+<span class="sourceLineNo">057</span>    @Override<a name="line.57"></a>
+<span class="sourceLineNo">058</span>    public int translate(final CharSequence input, final int index, final Writer out) throws IOException {<a name="line.58"></a>
+<span class="sourceLineNo">059</span>        for (final CharSequenceTranslator translator : translators) {<a name="line.59"></a>
+<span class="sourceLineNo">060</span>            final int consumed = translator.translate(input, index, out);<a name="line.60"></a>
+<span class="sourceLineNo">061</span>            if (consumed != 0) {<a name="line.61"></a>
+<span class="sourceLineNo">062</span>                return consumed;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>            }<a name="line.63"></a>
+<span class="sourceLineNo">064</span>        }<a name="line.64"></a>
+<span class="sourceLineNo">065</span>        return 0;<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    }<a name="line.66"></a>
+<span class="sourceLineNo">067</span><a name="line.67"></a>
+<span class="sourceLineNo">068</span>}<a name="line.68"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CharSequenceTranslator.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CharSequenceTranslator.html (original)
+++ websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CharSequenceTranslator.html Sun Mar 12 02:08:01 2017
@@ -13,9 +13,9 @@
 <span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
 <span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
 <span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
-<span class="sourceLineNo">008</span> * <a name="line.8"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
 <span class="sourceLineNo">009</span> *      http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
-<span class="sourceLineNo">010</span> * <a name="line.10"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
 <span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
 <span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
 <span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
@@ -30,117 +30,123 @@
 <span class="sourceLineNo">022</span>import java.util.Locale;<a name="line.22"></a>
 <span class="sourceLineNo">023</span><a name="line.23"></a>
 <span class="sourceLineNo">024</span>/**<a name="line.24"></a>
-<span class="sourceLineNo">025</span> * An API for translating text. <a name="line.25"></a>
-<span class="sourceLineNo">026</span> * Its core use is to escape and unescape text. Because escaping and unescaping <a name="line.26"></a>
+<span class="sourceLineNo">025</span> * An API for translating text.<a name="line.25"></a>
+<span class="sourceLineNo">026</span> * Its core use is to escape and unescape text. Because escaping and unescaping<a name="line.26"></a>
 <span class="sourceLineNo">027</span> * is completely contextual, the API does not present two separate signatures.<a name="line.27"></a>
 <span class="sourceLineNo">028</span> *<a name="line.28"></a>
 <span class="sourceLineNo">029</span> * @since 1.0<a name="line.29"></a>
 <span class="sourceLineNo">030</span> */<a name="line.30"></a>
 <span class="sourceLineNo">031</span>public abstract class CharSequenceTranslator {<a name="line.31"></a>
 <span class="sourceLineNo">032</span><a name="line.32"></a>
-<span class="sourceLineNo">033</span>    static final char[] HEX_DIGITS = new char[] {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};<a name="line.33"></a>
-<span class="sourceLineNo">034</span><a name="line.34"></a>
-<span class="sourceLineNo">035</span>    /**<a name="line.35"></a>
-<span class="sourceLineNo">036</span>     * Translate a set of codepoints, represented by an int index into a CharSequence, <a name="line.36"></a>
-<span class="sourceLineNo">037</span>     * into another set of codepoints. The number of codepoints consumed must be returned, <a name="line.37"></a>
-<span class="sourceLineNo">038</span>     * and the only IOExceptions thrown must be from interacting with the Writer so that <a name="line.38"></a>
-<span class="sourceLineNo">039</span>     * the top level API may reliably ignore StringWriter IOExceptions. <a name="line.39"></a>
-<span class="sourceLineNo">040</span>     *<a name="line.40"></a>
-<span class="sourceLineNo">041</span>     * @param input CharSequence that is being translated<a name="line.41"></a>
-<span class="sourceLineNo">042</span>     * @param index int representing the current point of translation<a name="line.42"></a>
-<span class="sourceLineNo">043</span>     * @param out Writer to translate the text to<a name="line.43"></a>
-<span class="sourceLineNo">044</span>     * @return int count of codepoints consumed<a name="line.44"></a>
-<span class="sourceLineNo">045</span>     * @throws IOException if and only if the Writer produces an IOException<a name="line.45"></a>
-<span class="sourceLineNo">046</span>     */<a name="line.46"></a>
-<span class="sourceLineNo">047</span>    public abstract int translate(CharSequence input, int index, Writer out) throws IOException;<a name="line.47"></a>
-<span class="sourceLineNo">048</span><a name="line.48"></a>
-<span class="sourceLineNo">049</span>    /**<a name="line.49"></a>
-<span class="sourceLineNo">050</span>     * Helper for non-Writer usage. <a name="line.50"></a>
-<span class="sourceLineNo">051</span>     * @param input CharSequence to be translated<a name="line.51"></a>
-<span class="sourceLineNo">052</span>     * @return String output of translation<a name="line.52"></a>
-<span class="sourceLineNo">053</span>     */<a name="line.53"></a>
-<span class="sourceLineNo">054</span>    public final String translate(final CharSequence input) {<a name="line.54"></a>
-<span class="sourceLineNo">055</span>        if (input == null) {<a name="line.55"></a>
-<span class="sourceLineNo">056</span>            return null;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>        }<a name="line.57"></a>
-<span class="sourceLineNo">058</span>        try {<a name="line.58"></a>
-<span class="sourceLineNo">059</span>            final StringWriter writer = new StringWriter(input.length() * 2);<a name="line.59"></a>
-<span class="sourceLineNo">060</span>            translate(input, writer);<a name="line.60"></a>
-<span class="sourceLineNo">061</span>            return writer.toString();<a name="line.61"></a>
-<span class="sourceLineNo">062</span>        } catch (final IOException ioe) {<a name="line.62"></a>
-<span class="sourceLineNo">063</span>            // this should never ever happen while writing to a StringWriter<a name="line.63"></a>
-<span class="sourceLineNo">064</span>            throw new RuntimeException(ioe);<a name="line.64"></a>
-<span class="sourceLineNo">065</span>        }<a name="line.65"></a>
-<span class="sourceLineNo">066</span>    }<a name="line.66"></a>
-<span class="sourceLineNo">067</span><a name="line.67"></a>
-<span class="sourceLineNo">068</span>    /**<a name="line.68"></a>
-<span class="sourceLineNo">069</span>     * Translate an input onto a Writer. This is intentionally final as its algorithm is <a name="line.69"></a>
-<span class="sourceLineNo">070</span>     * tightly coupled with the abstract method of this class. <a name="line.70"></a>
-<span class="sourceLineNo">071</span>     *<a name="line.71"></a>
-<span class="sourceLineNo">072</span>     * @param input CharSequence that is being translated<a name="line.72"></a>
-<span class="sourceLineNo">073</span>     * @param out Writer to translate the text to<a name="line.73"></a>
-<span class="sourceLineNo">074</span>     * @throws IOException if and only if the Writer produces an IOException<a name="line.74"></a>
-<span class="sourceLineNo">075</span>     */<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    public final void translate(final CharSequence input, final Writer out) throws IOException {<a name="line.76"></a>
-<span class="sourceLineNo">077</span>        if (out == null) {<a name="line.77"></a>
-<span class="sourceLineNo">078</span>            throw new IllegalArgumentException("The Writer must not be null");<a name="line.78"></a>
-<span class="sourceLineNo">079</span>        }<a name="line.79"></a>
-<span class="sourceLineNo">080</span>        if (input == null) {<a name="line.80"></a>
-<span class="sourceLineNo">081</span>            return;<a name="line.81"></a>
-<span class="sourceLineNo">082</span>        }<a name="line.82"></a>
-<span class="sourceLineNo">083</span>        int pos = 0;<a name="line.83"></a>
-<span class="sourceLineNo">084</span>        final int len = input.length();<a name="line.84"></a>
-<span class="sourceLineNo">085</span>        while (pos &lt; len) {<a name="line.85"></a>
-<span class="sourceLineNo">086</span>            final int consumed = translate(input, pos, out);<a name="line.86"></a>
-<span class="sourceLineNo">087</span>            if (consumed == 0) {<a name="line.87"></a>
-<span class="sourceLineNo">088</span>                // inlined implementation of Character.toChars(Character.codePointAt(input, pos))<a name="line.88"></a>
-<span class="sourceLineNo">089</span>                // avoids allocating temp char arrays and duplicate checks<a name="line.89"></a>
-<span class="sourceLineNo">090</span>                final char c1 = input.charAt(pos);<a name="line.90"></a>
-<span class="sourceLineNo">091</span>                out.write(c1);<a name="line.91"></a>
-<span class="sourceLineNo">092</span>                pos++;<a name="line.92"></a>
-<span class="sourceLineNo">093</span>                if (Character.isHighSurrogate(c1) &amp;&amp; pos &lt; len) {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>                    final char c2 = input.charAt(pos);<a name="line.94"></a>
-<span class="sourceLineNo">095</span>                    if (Character.isLowSurrogate(c2)) {<a name="line.95"></a>
-<span class="sourceLineNo">096</span>                      out.write(c2);<a name="line.96"></a>
-<span class="sourceLineNo">097</span>                      pos++;<a name="line.97"></a>
-<span class="sourceLineNo">098</span>                    }<a name="line.98"></a>
-<span class="sourceLineNo">099</span>                }<a name="line.99"></a>
-<span class="sourceLineNo">100</span>                continue;<a name="line.100"></a>
-<span class="sourceLineNo">101</span>            }<a name="line.101"></a>
-<span class="sourceLineNo">102</span>            // contract with translators is that they have to understand codepoints<a name="line.102"></a>
-<span class="sourceLineNo">103</span>            // and they just took care of a surrogate pair<a name="line.103"></a>
-<span class="sourceLineNo">104</span>            for (int pt = 0; pt &lt; consumed; pt++) {<a name="line.104"></a>
-<span class="sourceLineNo">105</span>                pos += Character.charCount(Character.codePointAt(input, pos));<a name="line.105"></a>
-<span class="sourceLineNo">106</span>            }<a name="line.106"></a>
-<span class="sourceLineNo">107</span>        }<a name="line.107"></a>
-<span class="sourceLineNo">108</span>    }<a name="line.108"></a>
-<span class="sourceLineNo">109</span><a name="line.109"></a>
-<span class="sourceLineNo">110</span>    /**<a name="line.110"></a>
-<span class="sourceLineNo">111</span>     * Helper method to create a merger of this translator with another set of <a name="line.111"></a>
-<span class="sourceLineNo">112</span>     * translators. Useful in customizing the standard functionality.<a name="line.112"></a>
-<span class="sourceLineNo">113</span>     *<a name="line.113"></a>
-<span class="sourceLineNo">114</span>     * @param translators CharSequenceTranslator array of translators to merge with this one<a name="line.114"></a>
-<span class="sourceLineNo">115</span>     * @return CharSequenceTranslator merging this translator with the others<a name="line.115"></a>
-<span class="sourceLineNo">116</span>     */<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    public final CharSequenceTranslator with(final CharSequenceTranslator... translators) {<a name="line.117"></a>
-<span class="sourceLineNo">118</span>        final CharSequenceTranslator[] newArray = new CharSequenceTranslator[translators.length + 1];<a name="line.118"></a>
-<span class="sourceLineNo">119</span>        newArray[0] = this;<a name="line.119"></a>
-<span class="sourceLineNo">120</span>        System.arraycopy(translators, 0, newArray, 1, translators.length);<a name="line.120"></a>
-<span class="sourceLineNo">121</span>        return new AggregateTranslator(newArray);<a name="line.121"></a>
-<span class="sourceLineNo">122</span>    }<a name="line.122"></a>
-<span class="sourceLineNo">123</span><a name="line.123"></a>
-<span class="sourceLineNo">124</span>    /**<a name="line.124"></a>
-<span class="sourceLineNo">125</span>     * &lt;p&gt;Returns an upper case hexadecimal &lt;code&gt;String&lt;/code&gt; for the given<a name="line.125"></a>
-<span class="sourceLineNo">126</span>     * character.&lt;/p&gt;<a name="line.126"></a>
-<span class="sourceLineNo">127</span>     *<a name="line.127"></a>
-<span class="sourceLineNo">128</span>     * @param codepoint The codepoint to convert.<a name="line.128"></a>
-<span class="sourceLineNo">129</span>     * @return An upper case hexadecimal &lt;code&gt;String&lt;/code&gt;<a name="line.129"></a>
-<span class="sourceLineNo">130</span>     */<a name="line.130"></a>
-<span class="sourceLineNo">131</span>    public static String hex(final int codepoint) {<a name="line.131"></a>
-<span class="sourceLineNo">132</span>        return Integer.toHexString(codepoint).toUpperCase(Locale.ENGLISH);<a name="line.132"></a>
-<span class="sourceLineNo">133</span>    }<a name="line.133"></a>
-<span class="sourceLineNo">134</span><a name="line.134"></a>
-<span class="sourceLineNo">135</span>}<a name="line.135"></a>
+<span class="sourceLineNo">033</span>    /**<a name="line.33"></a>
+<span class="sourceLineNo">034</span>     * Array containing the hexadecimal alphabet.<a name="line.34"></a>
+<span class="sourceLineNo">035</span>     */<a name="line.35"></a>
+<span class="sourceLineNo">036</span>    static final char[] HEX_DIGITS = new char[] {'0', '1', '2', '3',<a name="line.36"></a>
+<span class="sourceLineNo">037</span>                                                 '4', '5', '6', '7',<a name="line.37"></a>
+<span class="sourceLineNo">038</span>                                                 '8', '9', 'A', 'B',<a name="line.38"></a>
+<span class="sourceLineNo">039</span>                                                 'C', 'D', 'E', 'F'};<a name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span>    /**<a name="line.41"></a>
+<span class="sourceLineNo">042</span>     * Translate a set of codepoints, represented by an int index into a CharSequence,<a name="line.42"></a>
+<span class="sourceLineNo">043</span>     * into another set of codepoints. The number of codepoints consumed must be returned,<a name="line.43"></a>
+<span class="sourceLineNo">044</span>     * and the only IOExceptions thrown must be from interacting with the Writer so that<a name="line.44"></a>
+<span class="sourceLineNo">045</span>     * the top level API may reliably ignore StringWriter IOExceptions.<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     *<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     * @param input CharSequence that is being translated<a name="line.47"></a>
+<span class="sourceLineNo">048</span>     * @param index int representing the current point of translation<a name="line.48"></a>
+<span class="sourceLineNo">049</span>     * @param out Writer to translate the text to<a name="line.49"></a>
+<span class="sourceLineNo">050</span>     * @return int count of codepoints consumed<a name="line.50"></a>
+<span class="sourceLineNo">051</span>     * @throws IOException if and only if the Writer produces an IOException<a name="line.51"></a>
+<span class="sourceLineNo">052</span>     */<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    public abstract int translate(CharSequence input, int index, Writer out) throws IOException;<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>    /**<a name="line.55"></a>
+<span class="sourceLineNo">056</span>     * Helper for non-Writer usage.<a name="line.56"></a>
+<span class="sourceLineNo">057</span>     * @param input CharSequence to be translated<a name="line.57"></a>
+<span class="sourceLineNo">058</span>     * @return String output of translation<a name="line.58"></a>
+<span class="sourceLineNo">059</span>     */<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    public final String translate(final CharSequence input) {<a name="line.60"></a>
+<span class="sourceLineNo">061</span>        if (input == null) {<a name="line.61"></a>
+<span class="sourceLineNo">062</span>            return null;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        }<a name="line.63"></a>
+<span class="sourceLineNo">064</span>        try {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>            final StringWriter writer = new StringWriter(input.length() * 2);<a name="line.65"></a>
+<span class="sourceLineNo">066</span>            translate(input, writer);<a name="line.66"></a>
+<span class="sourceLineNo">067</span>            return writer.toString();<a name="line.67"></a>
+<span class="sourceLineNo">068</span>        } catch (final IOException ioe) {<a name="line.68"></a>
+<span class="sourceLineNo">069</span>            // this should never ever happen while writing to a StringWriter<a name="line.69"></a>
+<span class="sourceLineNo">070</span>            throw new RuntimeException(ioe);<a name="line.70"></a>
+<span class="sourceLineNo">071</span>        }<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    }<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>    /**<a name="line.74"></a>
+<span class="sourceLineNo">075</span>     * Translate an input onto a Writer. This is intentionally final as its algorithm is<a name="line.75"></a>
+<span class="sourceLineNo">076</span>     * tightly coupled with the abstract method of this class.<a name="line.76"></a>
+<span class="sourceLineNo">077</span>     *<a name="line.77"></a>
+<span class="sourceLineNo">078</span>     * @param input CharSequence that is being translated<a name="line.78"></a>
+<span class="sourceLineNo">079</span>     * @param out Writer to translate the text to<a name="line.79"></a>
+<span class="sourceLineNo">080</span>     * @throws IOException if and only if the Writer produces an IOException<a name="line.80"></a>
+<span class="sourceLineNo">081</span>     */<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    public final void translate(final CharSequence input, final Writer out) throws IOException {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>        if (out == null) {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>            throw new IllegalArgumentException("The Writer must not be null");<a name="line.84"></a>
+<span class="sourceLineNo">085</span>        }<a name="line.85"></a>
+<span class="sourceLineNo">086</span>        if (input == null) {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>            return;<a name="line.87"></a>
+<span class="sourceLineNo">088</span>        }<a name="line.88"></a>
+<span class="sourceLineNo">089</span>        int pos = 0;<a name="line.89"></a>
+<span class="sourceLineNo">090</span>        final int len = input.length();<a name="line.90"></a>
+<span class="sourceLineNo">091</span>        while (pos &lt; len) {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>            final int consumed = translate(input, pos, out);<a name="line.92"></a>
+<span class="sourceLineNo">093</span>            if (consumed == 0) {<a name="line.93"></a>
+<span class="sourceLineNo">094</span>                // inlined implementation of Character.toChars(Character.codePointAt(input, pos))<a name="line.94"></a>
+<span class="sourceLineNo">095</span>                // avoids allocating temp char arrays and duplicate checks<a name="line.95"></a>
+<span class="sourceLineNo">096</span>                final char c1 = input.charAt(pos);<a name="line.96"></a>
+<span class="sourceLineNo">097</span>                out.write(c1);<a name="line.97"></a>
+<span class="sourceLineNo">098</span>                pos++;<a name="line.98"></a>
+<span class="sourceLineNo">099</span>                if (Character.isHighSurrogate(c1) &amp;&amp; pos &lt; len) {<a name="line.99"></a>
+<span class="sourceLineNo">100</span>                    final char c2 = input.charAt(pos);<a name="line.100"></a>
+<span class="sourceLineNo">101</span>                    if (Character.isLowSurrogate(c2)) {<a name="line.101"></a>
+<span class="sourceLineNo">102</span>                      out.write(c2);<a name="line.102"></a>
+<span class="sourceLineNo">103</span>                      pos++;<a name="line.103"></a>
+<span class="sourceLineNo">104</span>                    }<a name="line.104"></a>
+<span class="sourceLineNo">105</span>                }<a name="line.105"></a>
+<span class="sourceLineNo">106</span>                continue;<a name="line.106"></a>
+<span class="sourceLineNo">107</span>            }<a name="line.107"></a>
+<span class="sourceLineNo">108</span>            // contract with translators is that they have to understand codepoints<a name="line.108"></a>
+<span class="sourceLineNo">109</span>            // and they just took care of a surrogate pair<a name="line.109"></a>
+<span class="sourceLineNo">110</span>            for (int pt = 0; pt &lt; consumed; pt++) {<a name="line.110"></a>
+<span class="sourceLineNo">111</span>                pos += Character.charCount(Character.codePointAt(input, pos));<a name="line.111"></a>
+<span class="sourceLineNo">112</span>            }<a name="line.112"></a>
+<span class="sourceLineNo">113</span>        }<a name="line.113"></a>
+<span class="sourceLineNo">114</span>    }<a name="line.114"></a>
+<span class="sourceLineNo">115</span><a name="line.115"></a>
+<span class="sourceLineNo">116</span>    /**<a name="line.116"></a>
+<span class="sourceLineNo">117</span>     * Helper method to create a merger of this translator with another set of<a name="line.117"></a>
+<span class="sourceLineNo">118</span>     * translators. Useful in customizing the standard functionality.<a name="line.118"></a>
+<span class="sourceLineNo">119</span>     *<a name="line.119"></a>
+<span class="sourceLineNo">120</span>     * @param translators CharSequenceTranslator array of translators to merge with this one<a name="line.120"></a>
+<span class="sourceLineNo">121</span>     * @return CharSequenceTranslator merging this translator with the others<a name="line.121"></a>
+<span class="sourceLineNo">122</span>     */<a name="line.122"></a>
+<span class="sourceLineNo">123</span>    public final CharSequenceTranslator with(final CharSequenceTranslator... translators) {<a name="line.123"></a>
+<span class="sourceLineNo">124</span>        final CharSequenceTranslator[] newArray = new CharSequenceTranslator[translators.length + 1];<a name="line.124"></a>
+<span class="sourceLineNo">125</span>        newArray[0] = this;<a name="line.125"></a>
+<span class="sourceLineNo">126</span>        System.arraycopy(translators, 0, newArray, 1, translators.length);<a name="line.126"></a>
+<span class="sourceLineNo">127</span>        return new AggregateTranslator(newArray);<a name="line.127"></a>
+<span class="sourceLineNo">128</span>    }<a name="line.128"></a>
+<span class="sourceLineNo">129</span><a name="line.129"></a>
+<span class="sourceLineNo">130</span>    /**<a name="line.130"></a>
+<span class="sourceLineNo">131</span>     * &lt;p&gt;Returns an upper case hexadecimal &lt;code&gt;String&lt;/code&gt; for the given<a name="line.131"></a>
+<span class="sourceLineNo">132</span>     * character.&lt;/p&gt;<a name="line.132"></a>
+<span class="sourceLineNo">133</span>     *<a name="line.133"></a>
+<span class="sourceLineNo">134</span>     * @param codepoint The codepoint to convert.<a name="line.134"></a>
+<span class="sourceLineNo">135</span>     * @return An upper case hexadecimal &lt;code&gt;String&lt;/code&gt;<a name="line.135"></a>
+<span class="sourceLineNo">136</span>     */<a name="line.136"></a>
+<span class="sourceLineNo">137</span>    public static String hex(final int codepoint) {<a name="line.137"></a>
+<span class="sourceLineNo">138</span>        return Integer.toHexString(codepoint).toUpperCase(Locale.ENGLISH);<a name="line.138"></a>
+<span class="sourceLineNo">139</span>    }<a name="line.139"></a>
+<span class="sourceLineNo">140</span><a name="line.140"></a>
+<span class="sourceLineNo">141</span>}<a name="line.141"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CodePointTranslator.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CodePointTranslator.html (original)
+++ websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CodePointTranslator.html Sun Mar 12 02:08:01 2017
@@ -13,9 +13,9 @@
 <span class="sourceLineNo">005</span> * The ASF licenses this file to You under the Apache License, Version 2.0<a name="line.5"></a>
 <span class="sourceLineNo">006</span> * (the "License"); you may not use this file except in compliance with<a name="line.6"></a>
 <span class="sourceLineNo">007</span> * the License.  You may obtain a copy of the License at<a name="line.7"></a>
-<span class="sourceLineNo">008</span> * <a name="line.8"></a>
+<span class="sourceLineNo">008</span> *<a name="line.8"></a>
 <span class="sourceLineNo">009</span> *      http://www.apache.org/licenses/LICENSE-2.0<a name="line.9"></a>
-<span class="sourceLineNo">010</span> * <a name="line.10"></a>
+<span class="sourceLineNo">010</span> *<a name="line.10"></a>
 <span class="sourceLineNo">011</span> * Unless required by applicable law or agreed to in writing, software<a name="line.11"></a>
 <span class="sourceLineNo">012</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.12"></a>
 <span class="sourceLineNo">013</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.13"></a>
@@ -28,7 +28,7 @@
 <span class="sourceLineNo">020</span>import java.io.Writer;<a name="line.20"></a>
 <span class="sourceLineNo">021</span><a name="line.21"></a>
 <span class="sourceLineNo">022</span>/**<a name="line.22"></a>
-<span class="sourceLineNo">023</span> * Helper subclass to CharSequenceTranslator to allow for translations that <a name="line.23"></a>
+<span class="sourceLineNo">023</span> * Helper subclass to CharSequenceTranslator to allow for translations that<a name="line.23"></a>
 <span class="sourceLineNo">024</span> * will replace up to one character at a time.<a name="line.24"></a>
 <span class="sourceLineNo">025</span> *<a name="line.25"></a>
 <span class="sourceLineNo">026</span> * @since 1.0<a name="line.26"></a>
@@ -36,19 +36,19 @@
 <span class="sourceLineNo">028</span>public abstract class CodePointTranslator extends CharSequenceTranslator {<a name="line.28"></a>
 <span class="sourceLineNo">029</span><a name="line.29"></a>
 <span class="sourceLineNo">030</span>    /**<a name="line.30"></a>
-<span class="sourceLineNo">031</span>     * Implementation of translate that maps onto the abstract translate(int, Writer) method. <a name="line.31"></a>
+<span class="sourceLineNo">031</span>     * Implementation of translate that maps onto the abstract translate(int, Writer) method.<a name="line.31"></a>
 <span class="sourceLineNo">032</span>     * {@inheritDoc}<a name="line.32"></a>
 <span class="sourceLineNo">033</span>     */<a name="line.33"></a>
 <span class="sourceLineNo">034</span>    @Override<a name="line.34"></a>
 <span class="sourceLineNo">035</span>    public final int translate(final CharSequence input, final int index, final Writer out) throws IOException {<a name="line.35"></a>
 <span class="sourceLineNo">036</span>        final int codepoint = Character.codePointAt(input, index);<a name="line.36"></a>
 <span class="sourceLineNo">037</span>        final boolean consumed = translate(codepoint, out);<a name="line.37"></a>
-<span class="sourceLineNo">038</span>        return consumed ? 1 : 0; <a name="line.38"></a>
+<span class="sourceLineNo">038</span>        return consumed ? 1 : 0;<a name="line.38"></a>
 <span class="sourceLineNo">039</span>    }<a name="line.39"></a>
 <span class="sourceLineNo">040</span><a name="line.40"></a>
 <span class="sourceLineNo">041</span>    /**<a name="line.41"></a>
-<span class="sourceLineNo">042</span>     * Translate the specified codepoint into another. <a name="line.42"></a>
-<span class="sourceLineNo">043</span>     * <a name="line.43"></a>
+<span class="sourceLineNo">042</span>     * Translate the specified codepoint into another.<a name="line.42"></a>
+<span class="sourceLineNo">043</span>     *<a name="line.43"></a>
 <span class="sourceLineNo">044</span>     * @param codepoint int character input to translate<a name="line.44"></a>
 <span class="sourceLineNo">045</span>     * @param out Writer to optionally push the translated output to<a name="line.45"></a>
 <span class="sourceLineNo">046</span>     * @return boolean as to whether translation occurred or not<a name="line.46"></a>

Modified: websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CsvTranslators.CsvEscaper.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CsvTranslators.CsvEscaper.html (original)
+++ websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CsvTranslators.CsvEscaper.html Sun Mar 12 02:08:01 2017
@@ -33,61 +33,67 @@
 <span class="sourceLineNo">025</span>/**<a name="line.25"></a>
 <span class="sourceLineNo">026</span> * This class holds inner classes for escaping/unescaping Comma Separated Values.<a name="line.26"></a>
 <span class="sourceLineNo">027</span> */<a name="line.27"></a>
-<span class="sourceLineNo">028</span>public class CsvTranslators {<a name="line.28"></a>
+<span class="sourceLineNo">028</span>public final class CsvTranslators {<a name="line.28"></a>
 <span class="sourceLineNo">029</span><a name="line.29"></a>
-<span class="sourceLineNo">030</span>    private static final char CSV_DELIMITER = ',';<a name="line.30"></a>
-<span class="sourceLineNo">031</span>    private static final char CSV_QUOTE = '"';<a name="line.31"></a>
-<span class="sourceLineNo">032</span>    private static final String CSV_QUOTE_STR = String.valueOf(CSV_QUOTE);<a name="line.32"></a>
-<span class="sourceLineNo">033</span>    private static final String CSV_ESCAPED_QUOTE_STR = CSV_QUOTE_STR + CSV_QUOTE_STR;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>    private static final char[] CSV_SEARCH_CHARS =<a name="line.34"></a>
-<span class="sourceLineNo">035</span>            new char[] {CSV_DELIMITER, CSV_QUOTE, CharUtils.CR, CharUtils.LF};<a name="line.35"></a>
-<span class="sourceLineNo">036</span><a name="line.36"></a>
-<span class="sourceLineNo">037</span>    private CsvTranslators() { }<a name="line.37"></a>
-<span class="sourceLineNo">038</span><a name="line.38"></a>
-<span class="sourceLineNo">039</span>    /**<a name="line.39"></a>
-<span class="sourceLineNo">040</span>     * Translator for escaping Comma Separated Values.<a name="line.40"></a>
-<span class="sourceLineNo">041</span>     */<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    public static class CsvEscaper extends SinglePassTranslator {<a name="line.42"></a>
-<span class="sourceLineNo">043</span><a name="line.43"></a>
-<span class="sourceLineNo">044</span>        @Override<a name="line.44"></a>
-<span class="sourceLineNo">045</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.45"></a>
-<span class="sourceLineNo">046</span>            final String inputSting = input.toString();<a name="line.46"></a>
-<span class="sourceLineNo">047</span>            if (StringUtils.containsNone(inputSting, CSV_SEARCH_CHARS)) {<a name="line.47"></a>
-<span class="sourceLineNo">048</span>                out.write(inputSting);<a name="line.48"></a>
-<span class="sourceLineNo">049</span>            } else {<a name="line.49"></a>
-<span class="sourceLineNo">050</span>                // input needs quoting<a name="line.50"></a>
-<span class="sourceLineNo">051</span>                out.write(CSV_QUOTE);<a name="line.51"></a>
-<span class="sourceLineNo">052</span>                out.write(StringUtils.replace(inputSting, CSV_QUOTE_STR, CSV_ESCAPED_QUOTE_STR));<a name="line.52"></a>
-<span class="sourceLineNo">053</span>                out.write(CSV_QUOTE);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>            }<a name="line.54"></a>
-<span class="sourceLineNo">055</span>        }<a name="line.55"></a>
-<span class="sourceLineNo">056</span>    }<a name="line.56"></a>
-<span class="sourceLineNo">057</span><a name="line.57"></a>
-<span class="sourceLineNo">058</span>    /**<a name="line.58"></a>
-<span class="sourceLineNo">059</span>     * Translator for unescaping escaped Comma Separated Value entries.<a name="line.59"></a>
-<span class="sourceLineNo">060</span>     */<a name="line.60"></a>
-<span class="sourceLineNo">061</span>    public static class CsvUnescaper extends SinglePassTranslator {<a name="line.61"></a>
-<span class="sourceLineNo">062</span><a name="line.62"></a>
-<span class="sourceLineNo">063</span>        @Override<a name="line.63"></a>
-<span class="sourceLineNo">064</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.64"></a>
-<span class="sourceLineNo">065</span>            // is input not quoted?<a name="line.65"></a>
-<span class="sourceLineNo">066</span>            if (input.charAt(0) != CSV_QUOTE || input.charAt(input.length() - 1) != CSV_QUOTE) {<a name="line.66"></a>
-<span class="sourceLineNo">067</span>                out.write(input.toString());<a name="line.67"></a>
-<span class="sourceLineNo">068</span>                return;<a name="line.68"></a>
-<span class="sourceLineNo">069</span>            }<a name="line.69"></a>
-<span class="sourceLineNo">070</span><a name="line.70"></a>
-<span class="sourceLineNo">071</span>            // strip quotes<a name="line.71"></a>
-<span class="sourceLineNo">072</span>            final String quoteless = input.subSequence(1, input.length() - 1).toString();<a name="line.72"></a>
-<span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>            if (StringUtils.containsAny(quoteless, CSV_SEARCH_CHARS)) {<a name="line.74"></a>
-<span class="sourceLineNo">075</span>                // deal with escaped quotes; ie) ""<a name="line.75"></a>
-<span class="sourceLineNo">076</span>                out.write(StringUtils.replace(quoteless, CSV_ESCAPED_QUOTE_STR, CSV_QUOTE_STR));<a name="line.76"></a>
-<span class="sourceLineNo">077</span>            } else {<a name="line.77"></a>
-<span class="sourceLineNo">078</span>                out.write(input.toString());<a name="line.78"></a>
-<span class="sourceLineNo">079</span>            }<a name="line.79"></a>
-<span class="sourceLineNo">080</span>        }<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    }<a name="line.81"></a>
-<span class="sourceLineNo">082</span>}<a name="line.82"></a>
+<span class="sourceLineNo">030</span>    /** Comma character. */<a name="line.30"></a>
+<span class="sourceLineNo">031</span>    private static final char CSV_DELIMITER = ',';<a name="line.31"></a>
+<span class="sourceLineNo">032</span>    /** Quote character. */<a name="line.32"></a>
+<span class="sourceLineNo">033</span>    private static final char CSV_QUOTE = '"';<a name="line.33"></a>
+<span class="sourceLineNo">034</span>    /** Quote character converted to string. */<a name="line.34"></a>
+<span class="sourceLineNo">035</span>    private static final String CSV_QUOTE_STR = String.valueOf(CSV_QUOTE);<a name="line.35"></a>
+<span class="sourceLineNo">036</span>    /** Escaped quote string. */<a name="line.36"></a>
+<span class="sourceLineNo">037</span>    private static final String CSV_ESCAPED_QUOTE_STR = CSV_QUOTE_STR + CSV_QUOTE_STR;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    /** CSV key characters in an array. */<a name="line.38"></a>
+<span class="sourceLineNo">039</span>    private static final char[] CSV_SEARCH_CHARS =<a name="line.39"></a>
+<span class="sourceLineNo">040</span>            new char[] {CSV_DELIMITER, CSV_QUOTE, CharUtils.CR, CharUtils.LF};<a name="line.40"></a>
+<span class="sourceLineNo">041</span><a name="line.41"></a>
+<span class="sourceLineNo">042</span>    /** Hidden constructor. */<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    private CsvTranslators() { }<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    /**<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * Translator for escaping Comma Separated Values.<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     */<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    public static class CsvEscaper extends SinglePassTranslator {<a name="line.48"></a>
+<span class="sourceLineNo">049</span><a name="line.49"></a>
+<span class="sourceLineNo">050</span>        @Override<a name="line.50"></a>
+<span class="sourceLineNo">051</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.51"></a>
+<span class="sourceLineNo">052</span>            final String inputSting = input.toString();<a name="line.52"></a>
+<span class="sourceLineNo">053</span>            if (StringUtils.containsNone(inputSting, CSV_SEARCH_CHARS)) {<a name="line.53"></a>
+<span class="sourceLineNo">054</span>                out.write(inputSting);<a name="line.54"></a>
+<span class="sourceLineNo">055</span>            } else {<a name="line.55"></a>
+<span class="sourceLineNo">056</span>                // input needs quoting<a name="line.56"></a>
+<span class="sourceLineNo">057</span>                out.write(CSV_QUOTE);<a name="line.57"></a>
+<span class="sourceLineNo">058</span>                out.write(StringUtils.replace(inputSting, CSV_QUOTE_STR, CSV_ESCAPED_QUOTE_STR));<a name="line.58"></a>
+<span class="sourceLineNo">059</span>                out.write(CSV_QUOTE);<a name="line.59"></a>
+<span class="sourceLineNo">060</span>            }<a name="line.60"></a>
+<span class="sourceLineNo">061</span>        }<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    }<a name="line.62"></a>
+<span class="sourceLineNo">063</span><a name="line.63"></a>
+<span class="sourceLineNo">064</span>    /**<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     * Translator for unescaping escaped Comma Separated Value entries.<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     */<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    public static class CsvUnescaper extends SinglePassTranslator {<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>        @Override<a name="line.69"></a>
+<span class="sourceLineNo">070</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>            // is input not quoted?<a name="line.71"></a>
+<span class="sourceLineNo">072</span>            if (input.charAt(0) != CSV_QUOTE || input.charAt(input.length() - 1) != CSV_QUOTE) {<a name="line.72"></a>
+<span class="sourceLineNo">073</span>                out.write(input.toString());<a name="line.73"></a>
+<span class="sourceLineNo">074</span>                return;<a name="line.74"></a>
+<span class="sourceLineNo">075</span>            }<a name="line.75"></a>
+<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">077</span>            // strip quotes<a name="line.77"></a>
+<span class="sourceLineNo">078</span>            final String quoteless = input.subSequence(1, input.length() - 1).toString();<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>            if (StringUtils.containsAny(quoteless, CSV_SEARCH_CHARS)) {<a name="line.80"></a>
+<span class="sourceLineNo">081</span>                // deal with escaped quotes; ie) ""<a name="line.81"></a>
+<span class="sourceLineNo">082</span>                out.write(StringUtils.replace(quoteless, CSV_ESCAPED_QUOTE_STR, CSV_QUOTE_STR));<a name="line.82"></a>
+<span class="sourceLineNo">083</span>            } else {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>                out.write(input.toString());<a name="line.84"></a>
+<span class="sourceLineNo">085</span>            }<a name="line.85"></a>
+<span class="sourceLineNo">086</span>        }<a name="line.86"></a>
+<span class="sourceLineNo">087</span>    }<a name="line.87"></a>
+<span class="sourceLineNo">088</span>}<a name="line.88"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CsvTranslators.CsvUnescaper.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CsvTranslators.CsvUnescaper.html (original)
+++ websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CsvTranslators.CsvUnescaper.html Sun Mar 12 02:08:01 2017
@@ -33,61 +33,67 @@
 <span class="sourceLineNo">025</span>/**<a name="line.25"></a>
 <span class="sourceLineNo">026</span> * This class holds inner classes for escaping/unescaping Comma Separated Values.<a name="line.26"></a>
 <span class="sourceLineNo">027</span> */<a name="line.27"></a>
-<span class="sourceLineNo">028</span>public class CsvTranslators {<a name="line.28"></a>
+<span class="sourceLineNo">028</span>public final class CsvTranslators {<a name="line.28"></a>
 <span class="sourceLineNo">029</span><a name="line.29"></a>
-<span class="sourceLineNo">030</span>    private static final char CSV_DELIMITER = ',';<a name="line.30"></a>
-<span class="sourceLineNo">031</span>    private static final char CSV_QUOTE = '"';<a name="line.31"></a>
-<span class="sourceLineNo">032</span>    private static final String CSV_QUOTE_STR = String.valueOf(CSV_QUOTE);<a name="line.32"></a>
-<span class="sourceLineNo">033</span>    private static final String CSV_ESCAPED_QUOTE_STR = CSV_QUOTE_STR + CSV_QUOTE_STR;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>    private static final char[] CSV_SEARCH_CHARS =<a name="line.34"></a>
-<span class="sourceLineNo">035</span>            new char[] {CSV_DELIMITER, CSV_QUOTE, CharUtils.CR, CharUtils.LF};<a name="line.35"></a>
-<span class="sourceLineNo">036</span><a name="line.36"></a>
-<span class="sourceLineNo">037</span>    private CsvTranslators() { }<a name="line.37"></a>
-<span class="sourceLineNo">038</span><a name="line.38"></a>
-<span class="sourceLineNo">039</span>    /**<a name="line.39"></a>
-<span class="sourceLineNo">040</span>     * Translator for escaping Comma Separated Values.<a name="line.40"></a>
-<span class="sourceLineNo">041</span>     */<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    public static class CsvEscaper extends SinglePassTranslator {<a name="line.42"></a>
-<span class="sourceLineNo">043</span><a name="line.43"></a>
-<span class="sourceLineNo">044</span>        @Override<a name="line.44"></a>
-<span class="sourceLineNo">045</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.45"></a>
-<span class="sourceLineNo">046</span>            final String inputSting = input.toString();<a name="line.46"></a>
-<span class="sourceLineNo">047</span>            if (StringUtils.containsNone(inputSting, CSV_SEARCH_CHARS)) {<a name="line.47"></a>
-<span class="sourceLineNo">048</span>                out.write(inputSting);<a name="line.48"></a>
-<span class="sourceLineNo">049</span>            } else {<a name="line.49"></a>
-<span class="sourceLineNo">050</span>                // input needs quoting<a name="line.50"></a>
-<span class="sourceLineNo">051</span>                out.write(CSV_QUOTE);<a name="line.51"></a>
-<span class="sourceLineNo">052</span>                out.write(StringUtils.replace(inputSting, CSV_QUOTE_STR, CSV_ESCAPED_QUOTE_STR));<a name="line.52"></a>
-<span class="sourceLineNo">053</span>                out.write(CSV_QUOTE);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>            }<a name="line.54"></a>
-<span class="sourceLineNo">055</span>        }<a name="line.55"></a>
-<span class="sourceLineNo">056</span>    }<a name="line.56"></a>
-<span class="sourceLineNo">057</span><a name="line.57"></a>
-<span class="sourceLineNo">058</span>    /**<a name="line.58"></a>
-<span class="sourceLineNo">059</span>     * Translator for unescaping escaped Comma Separated Value entries.<a name="line.59"></a>
-<span class="sourceLineNo">060</span>     */<a name="line.60"></a>
-<span class="sourceLineNo">061</span>    public static class CsvUnescaper extends SinglePassTranslator {<a name="line.61"></a>
-<span class="sourceLineNo">062</span><a name="line.62"></a>
-<span class="sourceLineNo">063</span>        @Override<a name="line.63"></a>
-<span class="sourceLineNo">064</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.64"></a>
-<span class="sourceLineNo">065</span>            // is input not quoted?<a name="line.65"></a>
-<span class="sourceLineNo">066</span>            if (input.charAt(0) != CSV_QUOTE || input.charAt(input.length() - 1) != CSV_QUOTE) {<a name="line.66"></a>
-<span class="sourceLineNo">067</span>                out.write(input.toString());<a name="line.67"></a>
-<span class="sourceLineNo">068</span>                return;<a name="line.68"></a>
-<span class="sourceLineNo">069</span>            }<a name="line.69"></a>
-<span class="sourceLineNo">070</span><a name="line.70"></a>
-<span class="sourceLineNo">071</span>            // strip quotes<a name="line.71"></a>
-<span class="sourceLineNo">072</span>            final String quoteless = input.subSequence(1, input.length() - 1).toString();<a name="line.72"></a>
-<span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>            if (StringUtils.containsAny(quoteless, CSV_SEARCH_CHARS)) {<a name="line.74"></a>
-<span class="sourceLineNo">075</span>                // deal with escaped quotes; ie) ""<a name="line.75"></a>
-<span class="sourceLineNo">076</span>                out.write(StringUtils.replace(quoteless, CSV_ESCAPED_QUOTE_STR, CSV_QUOTE_STR));<a name="line.76"></a>
-<span class="sourceLineNo">077</span>            } else {<a name="line.77"></a>
-<span class="sourceLineNo">078</span>                out.write(input.toString());<a name="line.78"></a>
-<span class="sourceLineNo">079</span>            }<a name="line.79"></a>
-<span class="sourceLineNo">080</span>        }<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    }<a name="line.81"></a>
-<span class="sourceLineNo">082</span>}<a name="line.82"></a>
+<span class="sourceLineNo">030</span>    /** Comma character. */<a name="line.30"></a>
+<span class="sourceLineNo">031</span>    private static final char CSV_DELIMITER = ',';<a name="line.31"></a>
+<span class="sourceLineNo">032</span>    /** Quote character. */<a name="line.32"></a>
+<span class="sourceLineNo">033</span>    private static final char CSV_QUOTE = '"';<a name="line.33"></a>
+<span class="sourceLineNo">034</span>    /** Quote character converted to string. */<a name="line.34"></a>
+<span class="sourceLineNo">035</span>    private static final String CSV_QUOTE_STR = String.valueOf(CSV_QUOTE);<a name="line.35"></a>
+<span class="sourceLineNo">036</span>    /** Escaped quote string. */<a name="line.36"></a>
+<span class="sourceLineNo">037</span>    private static final String CSV_ESCAPED_QUOTE_STR = CSV_QUOTE_STR + CSV_QUOTE_STR;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    /** CSV key characters in an array. */<a name="line.38"></a>
+<span class="sourceLineNo">039</span>    private static final char[] CSV_SEARCH_CHARS =<a name="line.39"></a>
+<span class="sourceLineNo">040</span>            new char[] {CSV_DELIMITER, CSV_QUOTE, CharUtils.CR, CharUtils.LF};<a name="line.40"></a>
+<span class="sourceLineNo">041</span><a name="line.41"></a>
+<span class="sourceLineNo">042</span>    /** Hidden constructor. */<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    private CsvTranslators() { }<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    /**<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * Translator for escaping Comma Separated Values.<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     */<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    public static class CsvEscaper extends SinglePassTranslator {<a name="line.48"></a>
+<span class="sourceLineNo">049</span><a name="line.49"></a>
+<span class="sourceLineNo">050</span>        @Override<a name="line.50"></a>
+<span class="sourceLineNo">051</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.51"></a>
+<span class="sourceLineNo">052</span>            final String inputSting = input.toString();<a name="line.52"></a>
+<span class="sourceLineNo">053</span>            if (StringUtils.containsNone(inputSting, CSV_SEARCH_CHARS)) {<a name="line.53"></a>
+<span class="sourceLineNo">054</span>                out.write(inputSting);<a name="line.54"></a>
+<span class="sourceLineNo">055</span>            } else {<a name="line.55"></a>
+<span class="sourceLineNo">056</span>                // input needs quoting<a name="line.56"></a>
+<span class="sourceLineNo">057</span>                out.write(CSV_QUOTE);<a name="line.57"></a>
+<span class="sourceLineNo">058</span>                out.write(StringUtils.replace(inputSting, CSV_QUOTE_STR, CSV_ESCAPED_QUOTE_STR));<a name="line.58"></a>
+<span class="sourceLineNo">059</span>                out.write(CSV_QUOTE);<a name="line.59"></a>
+<span class="sourceLineNo">060</span>            }<a name="line.60"></a>
+<span class="sourceLineNo">061</span>        }<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    }<a name="line.62"></a>
+<span class="sourceLineNo">063</span><a name="line.63"></a>
+<span class="sourceLineNo">064</span>    /**<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     * Translator for unescaping escaped Comma Separated Value entries.<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     */<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    public static class CsvUnescaper extends SinglePassTranslator {<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>        @Override<a name="line.69"></a>
+<span class="sourceLineNo">070</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>            // is input not quoted?<a name="line.71"></a>
+<span class="sourceLineNo">072</span>            if (input.charAt(0) != CSV_QUOTE || input.charAt(input.length() - 1) != CSV_QUOTE) {<a name="line.72"></a>
+<span class="sourceLineNo">073</span>                out.write(input.toString());<a name="line.73"></a>
+<span class="sourceLineNo">074</span>                return;<a name="line.74"></a>
+<span class="sourceLineNo">075</span>            }<a name="line.75"></a>
+<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">077</span>            // strip quotes<a name="line.77"></a>
+<span class="sourceLineNo">078</span>            final String quoteless = input.subSequence(1, input.length() - 1).toString();<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>            if (StringUtils.containsAny(quoteless, CSV_SEARCH_CHARS)) {<a name="line.80"></a>
+<span class="sourceLineNo">081</span>                // deal with escaped quotes; ie) ""<a name="line.81"></a>
+<span class="sourceLineNo">082</span>                out.write(StringUtils.replace(quoteless, CSV_ESCAPED_QUOTE_STR, CSV_QUOTE_STR));<a name="line.82"></a>
+<span class="sourceLineNo">083</span>            } else {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>                out.write(input.toString());<a name="line.84"></a>
+<span class="sourceLineNo">085</span>            }<a name="line.85"></a>
+<span class="sourceLineNo">086</span>        }<a name="line.86"></a>
+<span class="sourceLineNo">087</span>    }<a name="line.87"></a>
+<span class="sourceLineNo">088</span>}<a name="line.88"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CsvTranslators.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CsvTranslators.html (original)
+++ websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/CsvTranslators.html Sun Mar 12 02:08:01 2017
@@ -33,61 +33,67 @@
 <span class="sourceLineNo">025</span>/**<a name="line.25"></a>
 <span class="sourceLineNo">026</span> * This class holds inner classes for escaping/unescaping Comma Separated Values.<a name="line.26"></a>
 <span class="sourceLineNo">027</span> */<a name="line.27"></a>
-<span class="sourceLineNo">028</span>public class CsvTranslators {<a name="line.28"></a>
+<span class="sourceLineNo">028</span>public final class CsvTranslators {<a name="line.28"></a>
 <span class="sourceLineNo">029</span><a name="line.29"></a>
-<span class="sourceLineNo">030</span>    private static final char CSV_DELIMITER = ',';<a name="line.30"></a>
-<span class="sourceLineNo">031</span>    private static final char CSV_QUOTE = '"';<a name="line.31"></a>
-<span class="sourceLineNo">032</span>    private static final String CSV_QUOTE_STR = String.valueOf(CSV_QUOTE);<a name="line.32"></a>
-<span class="sourceLineNo">033</span>    private static final String CSV_ESCAPED_QUOTE_STR = CSV_QUOTE_STR + CSV_QUOTE_STR;<a name="line.33"></a>
-<span class="sourceLineNo">034</span>    private static final char[] CSV_SEARCH_CHARS =<a name="line.34"></a>
-<span class="sourceLineNo">035</span>            new char[] {CSV_DELIMITER, CSV_QUOTE, CharUtils.CR, CharUtils.LF};<a name="line.35"></a>
-<span class="sourceLineNo">036</span><a name="line.36"></a>
-<span class="sourceLineNo">037</span>    private CsvTranslators() { }<a name="line.37"></a>
-<span class="sourceLineNo">038</span><a name="line.38"></a>
-<span class="sourceLineNo">039</span>    /**<a name="line.39"></a>
-<span class="sourceLineNo">040</span>     * Translator for escaping Comma Separated Values.<a name="line.40"></a>
-<span class="sourceLineNo">041</span>     */<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    public static class CsvEscaper extends SinglePassTranslator {<a name="line.42"></a>
-<span class="sourceLineNo">043</span><a name="line.43"></a>
-<span class="sourceLineNo">044</span>        @Override<a name="line.44"></a>
-<span class="sourceLineNo">045</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.45"></a>
-<span class="sourceLineNo">046</span>            final String inputSting = input.toString();<a name="line.46"></a>
-<span class="sourceLineNo">047</span>            if (StringUtils.containsNone(inputSting, CSV_SEARCH_CHARS)) {<a name="line.47"></a>
-<span class="sourceLineNo">048</span>                out.write(inputSting);<a name="line.48"></a>
-<span class="sourceLineNo">049</span>            } else {<a name="line.49"></a>
-<span class="sourceLineNo">050</span>                // input needs quoting<a name="line.50"></a>
-<span class="sourceLineNo">051</span>                out.write(CSV_QUOTE);<a name="line.51"></a>
-<span class="sourceLineNo">052</span>                out.write(StringUtils.replace(inputSting, CSV_QUOTE_STR, CSV_ESCAPED_QUOTE_STR));<a name="line.52"></a>
-<span class="sourceLineNo">053</span>                out.write(CSV_QUOTE);<a name="line.53"></a>
-<span class="sourceLineNo">054</span>            }<a name="line.54"></a>
-<span class="sourceLineNo">055</span>        }<a name="line.55"></a>
-<span class="sourceLineNo">056</span>    }<a name="line.56"></a>
-<span class="sourceLineNo">057</span><a name="line.57"></a>
-<span class="sourceLineNo">058</span>    /**<a name="line.58"></a>
-<span class="sourceLineNo">059</span>     * Translator for unescaping escaped Comma Separated Value entries.<a name="line.59"></a>
-<span class="sourceLineNo">060</span>     */<a name="line.60"></a>
-<span class="sourceLineNo">061</span>    public static class CsvUnescaper extends SinglePassTranslator {<a name="line.61"></a>
-<span class="sourceLineNo">062</span><a name="line.62"></a>
-<span class="sourceLineNo">063</span>        @Override<a name="line.63"></a>
-<span class="sourceLineNo">064</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.64"></a>
-<span class="sourceLineNo">065</span>            // is input not quoted?<a name="line.65"></a>
-<span class="sourceLineNo">066</span>            if (input.charAt(0) != CSV_QUOTE || input.charAt(input.length() - 1) != CSV_QUOTE) {<a name="line.66"></a>
-<span class="sourceLineNo">067</span>                out.write(input.toString());<a name="line.67"></a>
-<span class="sourceLineNo">068</span>                return;<a name="line.68"></a>
-<span class="sourceLineNo">069</span>            }<a name="line.69"></a>
-<span class="sourceLineNo">070</span><a name="line.70"></a>
-<span class="sourceLineNo">071</span>            // strip quotes<a name="line.71"></a>
-<span class="sourceLineNo">072</span>            final String quoteless = input.subSequence(1, input.length() - 1).toString();<a name="line.72"></a>
-<span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>            if (StringUtils.containsAny(quoteless, CSV_SEARCH_CHARS)) {<a name="line.74"></a>
-<span class="sourceLineNo">075</span>                // deal with escaped quotes; ie) ""<a name="line.75"></a>
-<span class="sourceLineNo">076</span>                out.write(StringUtils.replace(quoteless, CSV_ESCAPED_QUOTE_STR, CSV_QUOTE_STR));<a name="line.76"></a>
-<span class="sourceLineNo">077</span>            } else {<a name="line.77"></a>
-<span class="sourceLineNo">078</span>                out.write(input.toString());<a name="line.78"></a>
-<span class="sourceLineNo">079</span>            }<a name="line.79"></a>
-<span class="sourceLineNo">080</span>        }<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    }<a name="line.81"></a>
-<span class="sourceLineNo">082</span>}<a name="line.82"></a>
+<span class="sourceLineNo">030</span>    /** Comma character. */<a name="line.30"></a>
+<span class="sourceLineNo">031</span>    private static final char CSV_DELIMITER = ',';<a name="line.31"></a>
+<span class="sourceLineNo">032</span>    /** Quote character. */<a name="line.32"></a>
+<span class="sourceLineNo">033</span>    private static final char CSV_QUOTE = '"';<a name="line.33"></a>
+<span class="sourceLineNo">034</span>    /** Quote character converted to string. */<a name="line.34"></a>
+<span class="sourceLineNo">035</span>    private static final String CSV_QUOTE_STR = String.valueOf(CSV_QUOTE);<a name="line.35"></a>
+<span class="sourceLineNo">036</span>    /** Escaped quote string. */<a name="line.36"></a>
+<span class="sourceLineNo">037</span>    private static final String CSV_ESCAPED_QUOTE_STR = CSV_QUOTE_STR + CSV_QUOTE_STR;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>    /** CSV key characters in an array. */<a name="line.38"></a>
+<span class="sourceLineNo">039</span>    private static final char[] CSV_SEARCH_CHARS =<a name="line.39"></a>
+<span class="sourceLineNo">040</span>            new char[] {CSV_DELIMITER, CSV_QUOTE, CharUtils.CR, CharUtils.LF};<a name="line.40"></a>
+<span class="sourceLineNo">041</span><a name="line.41"></a>
+<span class="sourceLineNo">042</span>    /** Hidden constructor. */<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    private CsvTranslators() { }<a name="line.43"></a>
+<span class="sourceLineNo">044</span><a name="line.44"></a>
+<span class="sourceLineNo">045</span>    /**<a name="line.45"></a>
+<span class="sourceLineNo">046</span>     * Translator for escaping Comma Separated Values.<a name="line.46"></a>
+<span class="sourceLineNo">047</span>     */<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    public static class CsvEscaper extends SinglePassTranslator {<a name="line.48"></a>
+<span class="sourceLineNo">049</span><a name="line.49"></a>
+<span class="sourceLineNo">050</span>        @Override<a name="line.50"></a>
+<span class="sourceLineNo">051</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.51"></a>
+<span class="sourceLineNo">052</span>            final String inputSting = input.toString();<a name="line.52"></a>
+<span class="sourceLineNo">053</span>            if (StringUtils.containsNone(inputSting, CSV_SEARCH_CHARS)) {<a name="line.53"></a>
+<span class="sourceLineNo">054</span>                out.write(inputSting);<a name="line.54"></a>
+<span class="sourceLineNo">055</span>            } else {<a name="line.55"></a>
+<span class="sourceLineNo">056</span>                // input needs quoting<a name="line.56"></a>
+<span class="sourceLineNo">057</span>                out.write(CSV_QUOTE);<a name="line.57"></a>
+<span class="sourceLineNo">058</span>                out.write(StringUtils.replace(inputSting, CSV_QUOTE_STR, CSV_ESCAPED_QUOTE_STR));<a name="line.58"></a>
+<span class="sourceLineNo">059</span>                out.write(CSV_QUOTE);<a name="line.59"></a>
+<span class="sourceLineNo">060</span>            }<a name="line.60"></a>
+<span class="sourceLineNo">061</span>        }<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    }<a name="line.62"></a>
+<span class="sourceLineNo">063</span><a name="line.63"></a>
+<span class="sourceLineNo">064</span>    /**<a name="line.64"></a>
+<span class="sourceLineNo">065</span>     * Translator for unescaping escaped Comma Separated Value entries.<a name="line.65"></a>
+<span class="sourceLineNo">066</span>     */<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    public static class CsvUnescaper extends SinglePassTranslator {<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>        @Override<a name="line.69"></a>
+<span class="sourceLineNo">070</span>        void translateWhole(final CharSequence input, final Writer out) throws IOException {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>            // is input not quoted?<a name="line.71"></a>
+<span class="sourceLineNo">072</span>            if (input.charAt(0) != CSV_QUOTE || input.charAt(input.length() - 1) != CSV_QUOTE) {<a name="line.72"></a>
+<span class="sourceLineNo">073</span>                out.write(input.toString());<a name="line.73"></a>
+<span class="sourceLineNo">074</span>                return;<a name="line.74"></a>
+<span class="sourceLineNo">075</span>            }<a name="line.75"></a>
+<span class="sourceLineNo">076</span><a name="line.76"></a>
+<span class="sourceLineNo">077</span>            // strip quotes<a name="line.77"></a>
+<span class="sourceLineNo">078</span>            final String quoteless = input.subSequence(1, input.length() - 1).toString();<a name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>            if (StringUtils.containsAny(quoteless, CSV_SEARCH_CHARS)) {<a name="line.80"></a>
+<span class="sourceLineNo">081</span>                // deal with escaped quotes; ie) ""<a name="line.81"></a>
+<span class="sourceLineNo">082</span>                out.write(StringUtils.replace(quoteless, CSV_ESCAPED_QUOTE_STR, CSV_QUOTE_STR));<a name="line.82"></a>
+<span class="sourceLineNo">083</span>            } else {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>                out.write(input.toString());<a name="line.84"></a>
+<span class="sourceLineNo">085</span>            }<a name="line.85"></a>
+<span class="sourceLineNo">086</span>        }<a name="line.86"></a>
+<span class="sourceLineNo">087</span>    }<a name="line.87"></a>
+<span class="sourceLineNo">088</span>}<a name="line.88"></a>
 
 
 

Modified: websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/EntityArrays.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/EntityArrays.html (original)
+++ websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/EntityArrays.html Sun Mar 12 02:08:01 2017
@@ -398,7 +398,7 @@
 <span class="sourceLineNo">390</span>    public static final Map&lt;CharSequence, CharSequence&gt; APOS_ESCAPE;<a name="line.390"></a>
 <span class="sourceLineNo">391</span>    static {<a name="line.391"></a>
 <span class="sourceLineNo">392</span>        Map&lt;CharSequence, CharSequence&gt; initialMap = new HashMap&lt;&gt;();<a name="line.392"></a>
-<span class="sourceLineNo">393</span>        initialMap.put("'","&amp;apos;"); // XML apostrophe<a name="line.393"></a>
+<span class="sourceLineNo">393</span>        initialMap.put("'", "&amp;apos;"); // XML apostrophe<a name="line.393"></a>
 <span class="sourceLineNo">394</span>        APOS_ESCAPE = Collections.unmodifiableMap(initialMap);<a name="line.394"></a>
 <span class="sourceLineNo">395</span>    }<a name="line.395"></a>
 <span class="sourceLineNo">396</span><a name="line.396"></a>
@@ -436,7 +436,7 @@
 <span class="sourceLineNo">428</span>    }<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>     * Used to invert an escape Map into an unescape Map<a name="line.431"></a>
+<span class="sourceLineNo">431</span>     * Used to invert an escape Map into an unescape Map.<a name="line.431"></a>
 <span class="sourceLineNo">432</span>     * @param map Map&amp;lt;String, String&amp;gt; to be inverted<a name="line.432"></a>
 <span class="sourceLineNo">433</span>     * @return Map&amp;lt;String, String&amp;gt; inverted array<a name="line.433"></a>
 <span class="sourceLineNo">434</span>     */<a name="line.434"></a>

Modified: websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/JavaUnicodeEscaper.html
==============================================================================
--- websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/JavaUnicodeEscaper.html (original)
+++ websites/production/commons/content/proper/commons-text/apidocs/src-html/org/apache/commons/text/translate/JavaUnicodeEscaper.html Sun Mar 12 02:08:01 2017
@@ -35,7 +35,7 @@
 <span class="sourceLineNo">027</span>     * &lt;p&gt;<a name="line.27"></a>
 <span class="sourceLineNo">028</span>     * Constructs a &lt;code&gt;JavaUnicodeEscaper&lt;/code&gt; above the specified value (exclusive).<a name="line.28"></a>
 <span class="sourceLineNo">029</span>     * &lt;/p&gt;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>     * <a name="line.30"></a>
+<span class="sourceLineNo">030</span>     *<a name="line.30"></a>
 <span class="sourceLineNo">031</span>     * @param codepoint<a name="line.31"></a>
 <span class="sourceLineNo">032</span>     *            above which to escape<a name="line.32"></a>
 <span class="sourceLineNo">033</span>     * @return the newly created {@code UnicodeEscaper} instance<a name="line.33"></a>
@@ -48,7 +48,7 @@
 <span class="sourceLineNo">040</span>     * &lt;p&gt;<a name="line.40"></a>
 <span class="sourceLineNo">041</span>     * Constructs a &lt;code&gt;JavaUnicodeEscaper&lt;/code&gt; below the specified value (exclusive).<a name="line.41"></a>
 <span class="sourceLineNo">042</span>     * &lt;/p&gt;<a name="line.42"></a>
-<span class="sourceLineNo">043</span>     * <a name="line.43"></a>
+<span class="sourceLineNo">043</span>     *<a name="line.43"></a>
 <span class="sourceLineNo">044</span>     * @param codepoint<a name="line.44"></a>
 <span class="sourceLineNo">045</span>     *            below which to escape<a name="line.45"></a>
 <span class="sourceLineNo">046</span>     * @return the newly created {@code UnicodeEscaper} instance<a name="line.46"></a>
@@ -61,7 +61,7 @@
 <span class="sourceLineNo">053</span>     * &lt;p&gt;<a name="line.53"></a>
 <span class="sourceLineNo">054</span>     * Constructs a &lt;code&gt;JavaUnicodeEscaper&lt;/code&gt; between the specified values (inclusive).<a name="line.54"></a>
 <span class="sourceLineNo">055</span>     * &lt;/p&gt;<a name="line.55"></a>
-<span class="sourceLineNo">056</span>     * <a name="line.56"></a>
+<span class="sourceLineNo">056</span>     *<a name="line.56"></a>
 <span class="sourceLineNo">057</span>     * @param codepointLow<a name="line.57"></a>
 <span class="sourceLineNo">058</span>     *            above which to escape<a name="line.58"></a>
 <span class="sourceLineNo">059</span>     * @param codepointHigh<a name="line.59"></a>
@@ -76,7 +76,7 @@
 <span class="sourceLineNo">068</span>     * &lt;p&gt;<a name="line.68"></a>
 <span class="sourceLineNo">069</span>     * Constructs a &lt;code&gt;JavaUnicodeEscaper&lt;/code&gt; outside of the specified values (exclusive).<a name="line.69"></a>
 <span class="sourceLineNo">070</span>     * &lt;/p&gt;<a name="line.70"></a>
-<span class="sourceLineNo">071</span>     * <a name="line.71"></a>
+<span class="sourceLineNo">071</span>     *<a name="line.71"></a>
 <span class="sourceLineNo">072</span>     * @param codepointLow<a name="line.72"></a>
 <span class="sourceLineNo">073</span>     *            below which to escape<a name="line.73"></a>
 <span class="sourceLineNo">074</span>     * @param codepointHigh<a name="line.74"></a>
@@ -93,7 +93,7 @@
 <span class="sourceLineNo">085</span>     * other constructors/builders. The &lt;code&gt;below&lt;/code&gt; and &lt;code&gt;above&lt;/code&gt; boundaries are inclusive when<a name="line.85"></a>
 <span class="sourceLineNo">086</span>     * &lt;code&gt;between&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt; and exclusive when it is &lt;code&gt;false&lt;/code&gt;.<a name="line.86"></a>
 <span class="sourceLineNo">087</span>     * &lt;/p&gt;<a name="line.87"></a>
-<span class="sourceLineNo">088</span>     * <a name="line.88"></a>
+<span class="sourceLineNo">088</span>     *<a name="line.88"></a>
 <span class="sourceLineNo">089</span>     * @param below<a name="line.89"></a>
 <span class="sourceLineNo">090</span>     *            int value representing the lowest codepoint boundary<a name="line.90"></a>
 <span class="sourceLineNo">091</span>     * @param above<a name="line.91"></a>
@@ -106,8 +106,8 @@
 <span class="sourceLineNo">098</span>    }<a name="line.98"></a>
 <span class="sourceLineNo">099</span><a name="line.99"></a>
 <span class="sourceLineNo">100</span>    /**<a name="line.100"></a>
-<span class="sourceLineNo">101</span>     * Converts the given codepoint to a hex string of the form {@code "\\uXXXX\\uXXXX"}<a name="line.101"></a>
-<span class="sourceLineNo">102</span>     * <a name="line.102"></a>
+<span class="sourceLineNo">101</span>     * Converts the given codepoint to a hex string of the form {@code "\\uXXXX\\uXXXX"}.<a name="line.101"></a>
+<span class="sourceLineNo">102</span>     *<a name="line.102"></a>
 <span class="sourceLineNo">103</span>     * @param codepoint<a name="line.103"></a>
 <span class="sourceLineNo">104</span>     *            a Unicode code point<a name="line.104"></a>
 <span class="sourceLineNo">105</span>     * @return the hex string for the given codepoint<a name="line.105"></a>



Mime
View raw message