commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r908013 [2/22] - in /websites/production/commons/content/proper/commons-csv: ./ apidocs/ apidocs/org/apache/commons/csv/ apidocs/org/apache/commons/csv/class-use/ apidocs/src-html/org/apache/commons/csv/ testapidocs/ testapidocs/org/apache/...
Date Sun, 04 May 2014 17:25:34 GMT
Modified: websites/production/commons/content/proper/commons-csv/apidocs/src-html/org/apache/commons/csv/CSVFormat.html
==============================================================================
--- websites/production/commons/content/proper/commons-csv/apidocs/src-html/org/apache/commons/csv/CSVFormat.html (original)
+++ websites/production/commons/content/proper/commons-csv/apidocs/src-html/org/apache/commons/csv/CSVFormat.html Sun May  4 17:25:32 2014
@@ -44,7 +44,7 @@
 <span class="sourceLineNo">036</span>/**<a name="line.36"></a>
 <span class="sourceLineNo">037</span> * Specifies the format of a CSV file and parses input.<a name="line.37"></a>
 <span class="sourceLineNo">038</span> *<a name="line.38"></a>
-<span class="sourceLineNo">039</span> * &lt;h4&gt;Using predefined formats&lt;/h4&gt;<a name="line.39"></a>
+<span class="sourceLineNo">039</span> * &lt;h2&gt;Using predefined formats&lt;/h2&gt;<a name="line.39"></a>
 <span class="sourceLineNo">040</span> *<a name="line.40"></a>
 <span class="sourceLineNo">041</span> * &lt;p&gt;<a name="line.41"></a>
 <span class="sourceLineNo">042</span> * You can use one of the predefined formats:<a name="line.42"></a>
@@ -72,7 +72,7 @@
 <span class="sourceLineNo">064</span> *<a name="line.64"></a>
 <span class="sourceLineNo">065</span> * &lt;pre&gt;CSVParser parser = CSVFormat.parseFile(file, CSVFormat.EXCEL);&lt;/pre&gt;<a name="line.65"></a>
 <span class="sourceLineNo">066</span> *<a name="line.66"></a>
-<span class="sourceLineNo">067</span> * &lt;h4&gt;Defining formats&lt;/h4&gt;<a name="line.67"></a>
+<span class="sourceLineNo">067</span> * &lt;h2&gt;Defining formats&lt;/h2&gt;<a name="line.67"></a>
 <span class="sourceLineNo">068</span> *<a name="line.68"></a>
 <span class="sourceLineNo">069</span> * &lt;p&gt;<a name="line.69"></a>
 <span class="sourceLineNo">070</span> * You can extend a format by calling the {@code with} methods. For example:<a name="line.70"></a>
@@ -84,7 +84,7 @@
 <span class="sourceLineNo">076</span> *   .withIgnoreSurroundingSpaces(true);<a name="line.76"></a>
 <span class="sourceLineNo">077</span> * &lt;/pre&gt;<a name="line.77"></a>
 <span class="sourceLineNo">078</span> *<a name="line.78"></a>
-<span class="sourceLineNo">079</span> * &lt;h4&gt;Defining column names&lt;/h4&gt;<a name="line.79"></a>
+<span class="sourceLineNo">079</span> * &lt;h2&gt;Defining column names&lt;/h2&gt;<a name="line.79"></a>
 <span class="sourceLineNo">080</span> *<a name="line.80"></a>
 <span class="sourceLineNo">081</span> * &lt;p&gt;<a name="line.81"></a>
 <span class="sourceLineNo">082</span> * To define the column names you want to use to access records, write:<a name="line.82"></a>
@@ -102,7 +102,7 @@
 <span class="sourceLineNo">094</span> * {@link #withSkipHeaderRecord(boolean)} with {@code true}.<a name="line.94"></a>
 <span class="sourceLineNo">095</span> * &lt;/p&gt;<a name="line.95"></a>
 <span class="sourceLineNo">096</span> *<a name="line.96"></a>
-<span class="sourceLineNo">097</span> * &lt;h4&gt;Parsing&lt;/h4&gt;<a name="line.97"></a>
+<span class="sourceLineNo">097</span> * &lt;h2&gt;Parsing&lt;/h2&gt;<a name="line.97"></a>
 <span class="sourceLineNo">098</span> *<a name="line.98"></a>
 <span class="sourceLineNo">099</span> * &lt;p&gt;<a name="line.99"></a>
 <span class="sourceLineNo">100</span> * You can use a format directly to parse a reader. For example, to parse an Excel file with columns header, write:<a name="line.100"></a>
@@ -117,7 +117,7 @@
 <span class="sourceLineNo">109</span> * For other input types, like resources, files, and URLs, use the static methods on {@link CSVParser}.<a name="line.109"></a>
 <span class="sourceLineNo">110</span> * &lt;/p&gt;<a name="line.110"></a>
 <span class="sourceLineNo">111</span> *<a name="line.111"></a>
-<span class="sourceLineNo">112</span> * &lt;h4&gt;Referencing columns safely&lt;/h4&gt;<a name="line.112"></a>
+<span class="sourceLineNo">112</span> * &lt;h2&gt;Referencing columns safely&lt;/h2&gt;<a name="line.112"></a>
 <span class="sourceLineNo">113</span> *<a name="line.113"></a>
 <span class="sourceLineNo">114</span> * &lt;p&gt;<a name="line.114"></a>
 <span class="sourceLineNo">115</span> * If your source contains a header record, you can simplify your code and safely reference columns,<a name="line.115"></a>
@@ -142,13 +142,13 @@
 <span class="sourceLineNo">134</span> * This makes your code impervious to changes in column order in the CSV file.<a name="line.134"></a>
 <span class="sourceLineNo">135</span> * &lt;/p&gt;<a name="line.135"></a>
 <span class="sourceLineNo">136</span> *<a name="line.136"></a>
-<span class="sourceLineNo">137</span> * &lt;h4&gt;Notes&lt;/h4&gt;<a name="line.137"></a>
+<span class="sourceLineNo">137</span> * &lt;h2&gt;Notes&lt;/h2&gt;<a name="line.137"></a>
 <span class="sourceLineNo">138</span> *<a name="line.138"></a>
 <span class="sourceLineNo">139</span> * &lt;p&gt;<a name="line.139"></a>
 <span class="sourceLineNo">140</span> * This class is immutable.<a name="line.140"></a>
 <span class="sourceLineNo">141</span> * &lt;/p&gt;<a name="line.141"></a>
 <span class="sourceLineNo">142</span> *<a name="line.142"></a>
-<span class="sourceLineNo">143</span> * @version $Id: CSVFormat.java 1559908 2014-01-21 02:44:30Z ggregory $<a name="line.143"></a>
+<span class="sourceLineNo">143</span> * @version $Id: CSVFormat.java 1592365 2014-05-04 16:08:56Z britter $<a name="line.143"></a>
 <span class="sourceLineNo">144</span> */<a name="line.144"></a>
 <span class="sourceLineNo">145</span>public final class CSVFormat implements Serializable {<a name="line.145"></a>
 <span class="sourceLineNo">146</span><a name="line.146"></a>
@@ -196,700 +196,705 @@
 <span class="sourceLineNo">188</span>    /**<a name="line.188"></a>
 <span class="sourceLineNo">189</span>     * Excel file format (using a comma as the value delimiter). Note that the actual value delimiter used by Excel is<a name="line.189"></a>
 <span class="sourceLineNo">190</span>     * locale dependent, it might be necessary to customize this format to accommodate to your regional settings.<a name="line.190"></a>
-<span class="sourceLineNo">191</span>     * &lt;p/&gt;<a name="line.191"></a>
-<span class="sourceLineNo">192</span>     * For example for parsing or generating a CSV file on a French system the following format will be used:<a name="line.192"></a>
-<span class="sourceLineNo">193</span>     *<a name="line.193"></a>
-<span class="sourceLineNo">194</span>     * &lt;pre&gt;<a name="line.194"></a>
-<span class="sourceLineNo">195</span>     * CSVFormat fmt = CSVFormat.newBuilder(EXCEL).withDelimiter(';');<a name="line.195"></a>
-<span class="sourceLineNo">196</span>     * &lt;/pre&gt;<a name="line.196"></a>
-<span class="sourceLineNo">197</span>     * Settings are:<a name="line.197"></a>
-<span class="sourceLineNo">198</span>     * &lt;ul&gt;<a name="line.198"></a>
-<span class="sourceLineNo">199</span>     * &lt;li&gt;withDelimiter(',')&lt;/li&gt;<a name="line.199"></a>
-<span class="sourceLineNo">200</span>     * &lt;li&gt;withQuoteChar('"')&lt;/li&gt;<a name="line.200"></a>
-<span class="sourceLineNo">201</span>     * &lt;li&gt;withRecordSeparator(CRLF)&lt;/li&gt;<a name="line.201"></a>
-<span class="sourceLineNo">202</span>     * &lt;/ul&gt;<a name="line.202"></a>
-<span class="sourceLineNo">203</span>     * Note: this is currently the same as RFC4180<a name="line.203"></a>
-<span class="sourceLineNo">204</span>     */<a name="line.204"></a>
-<span class="sourceLineNo">205</span>    public static final CSVFormat EXCEL = DEFAULT.withIgnoreEmptyLines(false);<a name="line.205"></a>
-<span class="sourceLineNo">206</span><a name="line.206"></a>
-<span class="sourceLineNo">207</span>    /** Tab-delimited format, with quote; leading and trailing spaces ignored. */<a name="line.207"></a>
-<span class="sourceLineNo">208</span>    public static final CSVFormat TDF =<a name="line.208"></a>
-<span class="sourceLineNo">209</span>            DEFAULT<a name="line.209"></a>
-<span class="sourceLineNo">210</span>            .withDelimiter(TAB)<a name="line.210"></a>
-<span class="sourceLineNo">211</span>            .withIgnoreSurroundingSpaces(true);<a name="line.211"></a>
-<span class="sourceLineNo">212</span><a name="line.212"></a>
-<span class="sourceLineNo">213</span>    /**<a name="line.213"></a>
-<span class="sourceLineNo">214</span>     * Default MySQL format used by the &lt;tt&gt;SELECT INTO OUTFILE&lt;/tt&gt; and &lt;tt&gt;LOAD DATA INFILE&lt;/tt&gt; operations. This is<a name="line.214"></a>
-<span class="sourceLineNo">215</span>     * a tab-delimited format with a LF character as the line separator. Values are not quoted and special characters<a name="line.215"></a>
-<span class="sourceLineNo">216</span>     * are escaped with '\'.<a name="line.216"></a>
-<span class="sourceLineNo">217</span>     *<a name="line.217"></a>
-<span class="sourceLineNo">218</span>     * @see &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/load-data.html"&gt;<a name="line.218"></a>
-<span class="sourceLineNo">219</span>     *      http://dev.mysql.com/doc/refman/5.1/en/load-data.html&lt;/a&gt;<a name="line.219"></a>
-<span class="sourceLineNo">220</span>     */<a name="line.220"></a>
-<span class="sourceLineNo">221</span>    public static final CSVFormat MYSQL =<a name="line.221"></a>
-<span class="sourceLineNo">222</span>            DEFAULT<a name="line.222"></a>
-<span class="sourceLineNo">223</span>            .withDelimiter(TAB)<a name="line.223"></a>
-<span class="sourceLineNo">224</span>            .withEscape(BACKSLASH)<a name="line.224"></a>
-<span class="sourceLineNo">225</span>            .withIgnoreEmptyLines(false)<a name="line.225"></a>
-<span class="sourceLineNo">226</span>            .withQuoteChar(null)<a name="line.226"></a>
-<span class="sourceLineNo">227</span>            .withRecordSeparator(LF);<a name="line.227"></a>
-<span class="sourceLineNo">228</span><a name="line.228"></a>
-<span class="sourceLineNo">229</span>    /**<a name="line.229"></a>
-<span class="sourceLineNo">230</span>     * Returns true if the given character is a line break character.<a name="line.230"></a>
-<span class="sourceLineNo">231</span>     *<a name="line.231"></a>
-<span class="sourceLineNo">232</span>     * @param c<a name="line.232"></a>
-<span class="sourceLineNo">233</span>     *            the character to check<a name="line.233"></a>
-<span class="sourceLineNo">234</span>     *<a name="line.234"></a>
-<span class="sourceLineNo">235</span>     * @return true if &lt;code&gt;c&lt;/code&gt; is a line break character<a name="line.235"></a>
-<span class="sourceLineNo">236</span>     */<a name="line.236"></a>
-<span class="sourceLineNo">237</span>    private static boolean isLineBreak(final char c) {<a name="line.237"></a>
-<span class="sourceLineNo">238</span>        return c == LF || c == CR;<a name="line.238"></a>
-<span class="sourceLineNo">239</span>    }<a name="line.239"></a>
-<span class="sourceLineNo">240</span><a name="line.240"></a>
-<span class="sourceLineNo">241</span>    /**<a name="line.241"></a>
-<span class="sourceLineNo">242</span>     * Returns true if the given character is a line break character.<a name="line.242"></a>
-<span class="sourceLineNo">243</span>     *<a name="line.243"></a>
-<span class="sourceLineNo">244</span>     * @param c<a name="line.244"></a>
-<span class="sourceLineNo">245</span>     *            the character to check, may be null<a name="line.245"></a>
-<span class="sourceLineNo">246</span>     *<a name="line.246"></a>
-<span class="sourceLineNo">247</span>     * @return true if &lt;code&gt;c&lt;/code&gt; is a line break character (and not null)<a name="line.247"></a>
-<span class="sourceLineNo">248</span>     */<a name="line.248"></a>
-<span class="sourceLineNo">249</span>    private static boolean isLineBreak(final Character c) {<a name="line.249"></a>
-<span class="sourceLineNo">250</span>        return c != null &amp;&amp; isLineBreak(c.charValue());<a name="line.250"></a>
-<span class="sourceLineNo">251</span>    }<a name="line.251"></a>
-<span class="sourceLineNo">252</span><a name="line.252"></a>
-<span class="sourceLineNo">253</span>    /**<a name="line.253"></a>
-<span class="sourceLineNo">254</span>     * Creates a new CSV format with the specified delimiter.<a name="line.254"></a>
-<span class="sourceLineNo">255</span>     *<a name="line.255"></a>
-<span class="sourceLineNo">256</span>     * @param delimiter<a name="line.256"></a>
-<span class="sourceLineNo">257</span>     *            the char used for value separation, must not be a line break character<a name="line.257"></a>
-<span class="sourceLineNo">258</span>     * @return a new CSV format.<a name="line.258"></a>
-<span class="sourceLineNo">259</span>     * @throws IllegalArgumentException if the delimiter is a line break character<a name="line.259"></a>
-<span class="sourceLineNo">260</span>     */<a name="line.260"></a>
-<span class="sourceLineNo">261</span>    public static CSVFormat newFormat(final char delimiter) {<a name="line.261"></a>
-<span class="sourceLineNo">262</span>        return new CSVFormat(delimiter, null, null, null, null, false, false, null, null, null, false);<a name="line.262"></a>
-<span class="sourceLineNo">263</span>    }<a name="line.263"></a>
-<span class="sourceLineNo">264</span><a name="line.264"></a>
-<span class="sourceLineNo">265</span>    /**<a name="line.265"></a>
-<span class="sourceLineNo">266</span>     * Creates a customized CSV format.<a name="line.266"></a>
-<span class="sourceLineNo">267</span>     *<a name="line.267"></a>
-<span class="sourceLineNo">268</span>     * @param delimiter<a name="line.268"></a>
-<span class="sourceLineNo">269</span>     *            the char used for value separation, must not be a line break character<a name="line.269"></a>
-<span class="sourceLineNo">270</span>     * @param quoteChar<a name="line.270"></a>
-<span class="sourceLineNo">271</span>     *            the Character used as value encapsulation marker, may be {@code null} to disable<a name="line.271"></a>
-<span class="sourceLineNo">272</span>     * @param quotePolicy<a name="line.272"></a>
-<span class="sourceLineNo">273</span>     *            the quote policy<a name="line.273"></a>
-<span class="sourceLineNo">274</span>     * @param commentStart<a name="line.274"></a>
-<span class="sourceLineNo">275</span>     *            the Character used for comment identification, may be {@code null} to disable<a name="line.275"></a>
-<span class="sourceLineNo">276</span>     * @param escape<a name="line.276"></a>
-<span class="sourceLineNo">277</span>     *            the Character used to escape special characters in values, may be {@code null} to disable<a name="line.277"></a>
-<span class="sourceLineNo">278</span>     * @param ignoreSurroundingSpaces<a name="line.278"></a>
-<span class="sourceLineNo">279</span>     *            &lt;tt&gt;true&lt;/tt&gt; when whitespaces enclosing values should be ignored<a name="line.279"></a>
-<span class="sourceLineNo">280</span>     * @param ignoreEmptyLines<a name="line.280"></a>
-<span class="sourceLineNo">281</span>     *            &lt;tt&gt;true&lt;/tt&gt; when the parser should skip empty lines<a name="line.281"></a>
-<span class="sourceLineNo">282</span>     * @param recordSeparator<a name="line.282"></a>
-<span class="sourceLineNo">283</span>     *            the line separator to use for output<a name="line.283"></a>
-<span class="sourceLineNo">284</span>     * @param nullString<a name="line.284"></a>
-<span class="sourceLineNo">285</span>     *            the line separator to use for output<a name="line.285"></a>
-<span class="sourceLineNo">286</span>     * @param header<a name="line.286"></a>
-<span class="sourceLineNo">287</span>     *            the header<a name="line.287"></a>
-<span class="sourceLineNo">288</span>     * @param skipHeaderRecord TODO<a name="line.288"></a>
-<span class="sourceLineNo">289</span>     * @throws IllegalArgumentException if the delimiter is a line break character<a name="line.289"></a>
-<span class="sourceLineNo">290</span>     */<a name="line.290"></a>
-<span class="sourceLineNo">291</span>    // package protected to give access without needing a synthetic accessor<a name="line.291"></a>
-<span class="sourceLineNo">292</span>    CSVFormat(final char delimiter, final Character quoteChar,<a name="line.292"></a>
-<span class="sourceLineNo">293</span>            final Quote quotePolicy, final Character commentStart,<a name="line.293"></a>
-<span class="sourceLineNo">294</span>            final Character escape, final boolean ignoreSurroundingSpaces,<a name="line.294"></a>
-<span class="sourceLineNo">295</span>            final boolean ignoreEmptyLines, final String recordSeparator,<a name="line.295"></a>
-<span class="sourceLineNo">296</span>            final String nullString, final String[] header, final boolean skipHeaderRecord) {<a name="line.296"></a>
-<span class="sourceLineNo">297</span>        if (isLineBreak(delimiter)) {<a name="line.297"></a>
-<span class="sourceLineNo">298</span>            throw new IllegalArgumentException("The delimiter cannot be a line break");<a name="line.298"></a>
-<span class="sourceLineNo">299</span>        }<a name="line.299"></a>
-<span class="sourceLineNo">300</span>        this.delimiter = delimiter;<a name="line.300"></a>
-<span class="sourceLineNo">301</span>        this.quoteChar = quoteChar;<a name="line.301"></a>
-<span class="sourceLineNo">302</span>        this.quotePolicy = quotePolicy;<a name="line.302"></a>
-<span class="sourceLineNo">303</span>        this.commentStart = commentStart;<a name="line.303"></a>
-<span class="sourceLineNo">304</span>        this.escape = escape;<a name="line.304"></a>
-<span class="sourceLineNo">305</span>        this.ignoreSurroundingSpaces = ignoreSurroundingSpaces;<a name="line.305"></a>
-<span class="sourceLineNo">306</span>        this.ignoreEmptyLines = ignoreEmptyLines;<a name="line.306"></a>
-<span class="sourceLineNo">307</span>        this.recordSeparator = recordSeparator;<a name="line.307"></a>
-<span class="sourceLineNo">308</span>        this.nullString = nullString;<a name="line.308"></a>
-<span class="sourceLineNo">309</span>        this.header = header == null ? null : header.clone();<a name="line.309"></a>
-<span class="sourceLineNo">310</span>        this.skipHeaderRecord = skipHeaderRecord;<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>    @Override<a name="line.313"></a>
-<span class="sourceLineNo">314</span>    public boolean equals(final Object obj) {<a name="line.314"></a>
-<span class="sourceLineNo">315</span>        if (this == obj) {<a name="line.315"></a>
-<span class="sourceLineNo">316</span>            return true;<a name="line.316"></a>
-<span class="sourceLineNo">317</span>        }<a name="line.317"></a>
-<span class="sourceLineNo">318</span>        if (obj == null) {<a name="line.318"></a>
-<span class="sourceLineNo">319</span>            return false;<a name="line.319"></a>
-<span class="sourceLineNo">320</span>        }<a name="line.320"></a>
-<span class="sourceLineNo">321</span>        if (getClass() != obj.getClass()) {<a name="line.321"></a>
-<span class="sourceLineNo">322</span>            return false;<a name="line.322"></a>
-<span class="sourceLineNo">323</span>        }<a name="line.323"></a>
-<span class="sourceLineNo">324</span><a name="line.324"></a>
-<span class="sourceLineNo">325</span>        final CSVFormat other = (CSVFormat) obj;<a name="line.325"></a>
-<span class="sourceLineNo">326</span>        if (delimiter != other.delimiter) {<a name="line.326"></a>
+<span class="sourceLineNo">191</span>     *<a name="line.191"></a>
+<span class="sourceLineNo">192</span>     * &lt;p&gt;<a name="line.192"></a>
+<span class="sourceLineNo">193</span>     * For example for parsing or generating a CSV file on a French system the following format will be used:<a name="line.193"></a>
+<span class="sourceLineNo">194</span>     * &lt;/p&gt;<a name="line.194"></a>
+<span class="sourceLineNo">195</span>     *<a name="line.195"></a>
+<span class="sourceLineNo">196</span>     * &lt;pre&gt;<a name="line.196"></a>
+<span class="sourceLineNo">197</span>     * CSVFormat fmt = CSVFormat.newBuilder(EXCEL).withDelimiter(';');<a name="line.197"></a>
+<span class="sourceLineNo">198</span>     * &lt;/pre&gt;<a name="line.198"></a>
+<span class="sourceLineNo">199</span>     *<a name="line.199"></a>
+<span class="sourceLineNo">200</span>     * &lt;p&gt;<a name="line.200"></a>
+<span class="sourceLineNo">201</span>     * Settings are:<a name="line.201"></a>
+<span class="sourceLineNo">202</span>     * &lt;/p&gt;<a name="line.202"></a>
+<span class="sourceLineNo">203</span>     * &lt;ul&gt;<a name="line.203"></a>
+<span class="sourceLineNo">204</span>     * &lt;li&gt;withDelimiter(',')&lt;/li&gt;<a name="line.204"></a>
+<span class="sourceLineNo">205</span>     * &lt;li&gt;withQuoteChar('"')&lt;/li&gt;<a name="line.205"></a>
+<span class="sourceLineNo">206</span>     * &lt;li&gt;withRecordSeparator(CRLF)&lt;/li&gt;<a name="line.206"></a>
+<span class="sourceLineNo">207</span>     * &lt;/ul&gt;<a name="line.207"></a>
+<span class="sourceLineNo">208</span>     * Note: this is currently the same as RFC4180<a name="line.208"></a>
+<span class="sourceLineNo">209</span>     */<a name="line.209"></a>
+<span class="sourceLineNo">210</span>    public static final CSVFormat EXCEL = DEFAULT.withIgnoreEmptyLines(false);<a name="line.210"></a>
+<span class="sourceLineNo">211</span><a name="line.211"></a>
+<span class="sourceLineNo">212</span>    /** Tab-delimited format, with quote; leading and trailing spaces ignored. */<a name="line.212"></a>
+<span class="sourceLineNo">213</span>    public static final CSVFormat TDF =<a name="line.213"></a>
+<span class="sourceLineNo">214</span>            DEFAULT<a name="line.214"></a>
+<span class="sourceLineNo">215</span>            .withDelimiter(TAB)<a name="line.215"></a>
+<span class="sourceLineNo">216</span>            .withIgnoreSurroundingSpaces(true);<a name="line.216"></a>
+<span class="sourceLineNo">217</span><a name="line.217"></a>
+<span class="sourceLineNo">218</span>    /**<a name="line.218"></a>
+<span class="sourceLineNo">219</span>     * Default MySQL format used by the &lt;tt&gt;SELECT INTO OUTFILE&lt;/tt&gt; and &lt;tt&gt;LOAD DATA INFILE&lt;/tt&gt; operations. This is<a name="line.219"></a>
+<span class="sourceLineNo">220</span>     * a tab-delimited format with a LF character as the line separator. Values are not quoted and special characters<a name="line.220"></a>
+<span class="sourceLineNo">221</span>     * are escaped with '\'.<a name="line.221"></a>
+<span class="sourceLineNo">222</span>     *<a name="line.222"></a>
+<span class="sourceLineNo">223</span>     * @see &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/load-data.html"&gt;<a name="line.223"></a>
+<span class="sourceLineNo">224</span>     *      http://dev.mysql.com/doc/refman/5.1/en/load-data.html&lt;/a&gt;<a name="line.224"></a>
+<span class="sourceLineNo">225</span>     */<a name="line.225"></a>
+<span class="sourceLineNo">226</span>    public static final CSVFormat MYSQL =<a name="line.226"></a>
+<span class="sourceLineNo">227</span>            DEFAULT<a name="line.227"></a>
+<span class="sourceLineNo">228</span>            .withDelimiter(TAB)<a name="line.228"></a>
+<span class="sourceLineNo">229</span>            .withEscape(BACKSLASH)<a name="line.229"></a>
+<span class="sourceLineNo">230</span>            .withIgnoreEmptyLines(false)<a name="line.230"></a>
+<span class="sourceLineNo">231</span>            .withQuoteChar(null)<a name="line.231"></a>
+<span class="sourceLineNo">232</span>            .withRecordSeparator(LF);<a name="line.232"></a>
+<span class="sourceLineNo">233</span><a name="line.233"></a>
+<span class="sourceLineNo">234</span>    /**<a name="line.234"></a>
+<span class="sourceLineNo">235</span>     * Returns true if the given character is a line break character.<a name="line.235"></a>
+<span class="sourceLineNo">236</span>     *<a name="line.236"></a>
+<span class="sourceLineNo">237</span>     * @param c<a name="line.237"></a>
+<span class="sourceLineNo">238</span>     *            the character to check<a name="line.238"></a>
+<span class="sourceLineNo">239</span>     *<a name="line.239"></a>
+<span class="sourceLineNo">240</span>     * @return true if &lt;code&gt;c&lt;/code&gt; is a line break character<a name="line.240"></a>
+<span class="sourceLineNo">241</span>     */<a name="line.241"></a>
+<span class="sourceLineNo">242</span>    private static boolean isLineBreak(final char c) {<a name="line.242"></a>
+<span class="sourceLineNo">243</span>        return c == LF || c == CR;<a name="line.243"></a>
+<span class="sourceLineNo">244</span>    }<a name="line.244"></a>
+<span class="sourceLineNo">245</span><a name="line.245"></a>
+<span class="sourceLineNo">246</span>    /**<a name="line.246"></a>
+<span class="sourceLineNo">247</span>     * Returns true if the given character is a line break character.<a name="line.247"></a>
+<span class="sourceLineNo">248</span>     *<a name="line.248"></a>
+<span class="sourceLineNo">249</span>     * @param c<a name="line.249"></a>
+<span class="sourceLineNo">250</span>     *            the character to check, may be null<a name="line.250"></a>
+<span class="sourceLineNo">251</span>     *<a name="line.251"></a>
+<span class="sourceLineNo">252</span>     * @return true if &lt;code&gt;c&lt;/code&gt; is a line break character (and not null)<a name="line.252"></a>
+<span class="sourceLineNo">253</span>     */<a name="line.253"></a>
+<span class="sourceLineNo">254</span>    private static boolean isLineBreak(final Character c) {<a name="line.254"></a>
+<span class="sourceLineNo">255</span>        return c != null &amp;&amp; isLineBreak(c.charValue());<a name="line.255"></a>
+<span class="sourceLineNo">256</span>    }<a name="line.256"></a>
+<span class="sourceLineNo">257</span><a name="line.257"></a>
+<span class="sourceLineNo">258</span>    /**<a name="line.258"></a>
+<span class="sourceLineNo">259</span>     * Creates a new CSV format with the specified delimiter.<a name="line.259"></a>
+<span class="sourceLineNo">260</span>     *<a name="line.260"></a>
+<span class="sourceLineNo">261</span>     * @param delimiter<a name="line.261"></a>
+<span class="sourceLineNo">262</span>     *            the char used for value separation, must not be a line break character<a name="line.262"></a>
+<span class="sourceLineNo">263</span>     * @return a new CSV format.<a name="line.263"></a>
+<span class="sourceLineNo">264</span>     * @throws IllegalArgumentException if the delimiter is a line break character<a name="line.264"></a>
+<span class="sourceLineNo">265</span>     */<a name="line.265"></a>
+<span class="sourceLineNo">266</span>    public static CSVFormat newFormat(final char delimiter) {<a name="line.266"></a>
+<span class="sourceLineNo">267</span>        return new CSVFormat(delimiter, null, null, null, null, false, false, null, null, null, false);<a name="line.267"></a>
+<span class="sourceLineNo">268</span>    }<a name="line.268"></a>
+<span class="sourceLineNo">269</span><a name="line.269"></a>
+<span class="sourceLineNo">270</span>    /**<a name="line.270"></a>
+<span class="sourceLineNo">271</span>     * Creates a customized CSV format.<a name="line.271"></a>
+<span class="sourceLineNo">272</span>     *<a name="line.272"></a>
+<span class="sourceLineNo">273</span>     * @param delimiter<a name="line.273"></a>
+<span class="sourceLineNo">274</span>     *            the char used for value separation, must not be a line break character<a name="line.274"></a>
+<span class="sourceLineNo">275</span>     * @param quoteChar<a name="line.275"></a>
+<span class="sourceLineNo">276</span>     *            the Character used as value encapsulation marker, may be {@code null} to disable<a name="line.276"></a>
+<span class="sourceLineNo">277</span>     * @param quotePolicy<a name="line.277"></a>
+<span class="sourceLineNo">278</span>     *            the quote policy<a name="line.278"></a>
+<span class="sourceLineNo">279</span>     * @param commentStart<a name="line.279"></a>
+<span class="sourceLineNo">280</span>     *            the Character used for comment identification, may be {@code null} to disable<a name="line.280"></a>
+<span class="sourceLineNo">281</span>     * @param escape<a name="line.281"></a>
+<span class="sourceLineNo">282</span>     *            the Character used to escape special characters in values, may be {@code null} to disable<a name="line.282"></a>
+<span class="sourceLineNo">283</span>     * @param ignoreSurroundingSpaces<a name="line.283"></a>
+<span class="sourceLineNo">284</span>     *            &lt;tt&gt;true&lt;/tt&gt; when whitespaces enclosing values should be ignored<a name="line.284"></a>
+<span class="sourceLineNo">285</span>     * @param ignoreEmptyLines<a name="line.285"></a>
+<span class="sourceLineNo">286</span>     *            &lt;tt&gt;true&lt;/tt&gt; when the parser should skip empty lines<a name="line.286"></a>
+<span class="sourceLineNo">287</span>     * @param recordSeparator<a name="line.287"></a>
+<span class="sourceLineNo">288</span>     *            the line separator to use for output<a name="line.288"></a>
+<span class="sourceLineNo">289</span>     * @param nullString<a name="line.289"></a>
+<span class="sourceLineNo">290</span>     *            the line separator to use for output<a name="line.290"></a>
+<span class="sourceLineNo">291</span>     * @param header<a name="line.291"></a>
+<span class="sourceLineNo">292</span>     *            the header<a name="line.292"></a>
+<span class="sourceLineNo">293</span>     * @param skipHeaderRecord TODO<a name="line.293"></a>
+<span class="sourceLineNo">294</span>     * @throws IllegalArgumentException if the delimiter is a line break character<a name="line.294"></a>
+<span class="sourceLineNo">295</span>     */<a name="line.295"></a>
+<span class="sourceLineNo">296</span>    // package protected to give access without needing a synthetic accessor<a name="line.296"></a>
+<span class="sourceLineNo">297</span>    CSVFormat(final char delimiter, final Character quoteChar,<a name="line.297"></a>
+<span class="sourceLineNo">298</span>            final Quote quotePolicy, final Character commentStart,<a name="line.298"></a>
+<span class="sourceLineNo">299</span>            final Character escape, final boolean ignoreSurroundingSpaces,<a name="line.299"></a>
+<span class="sourceLineNo">300</span>            final boolean ignoreEmptyLines, final String recordSeparator,<a name="line.300"></a>
+<span class="sourceLineNo">301</span>            final String nullString, final String[] header, final boolean skipHeaderRecord) {<a name="line.301"></a>
+<span class="sourceLineNo">302</span>        if (isLineBreak(delimiter)) {<a name="line.302"></a>
+<span class="sourceLineNo">303</span>            throw new IllegalArgumentException("The delimiter cannot be a line break");<a name="line.303"></a>
+<span class="sourceLineNo">304</span>        }<a name="line.304"></a>
+<span class="sourceLineNo">305</span>        this.delimiter = delimiter;<a name="line.305"></a>
+<span class="sourceLineNo">306</span>        this.quoteChar = quoteChar;<a name="line.306"></a>
+<span class="sourceLineNo">307</span>        this.quotePolicy = quotePolicy;<a name="line.307"></a>
+<span class="sourceLineNo">308</span>        this.commentStart = commentStart;<a name="line.308"></a>
+<span class="sourceLineNo">309</span>        this.escape = escape;<a name="line.309"></a>
+<span class="sourceLineNo">310</span>        this.ignoreSurroundingSpaces = ignoreSurroundingSpaces;<a name="line.310"></a>
+<span class="sourceLineNo">311</span>        this.ignoreEmptyLines = ignoreEmptyLines;<a name="line.311"></a>
+<span class="sourceLineNo">312</span>        this.recordSeparator = recordSeparator;<a name="line.312"></a>
+<span class="sourceLineNo">313</span>        this.nullString = nullString;<a name="line.313"></a>
+<span class="sourceLineNo">314</span>        this.header = header == null ? null : header.clone();<a name="line.314"></a>
+<span class="sourceLineNo">315</span>        this.skipHeaderRecord = skipHeaderRecord;<a name="line.315"></a>
+<span class="sourceLineNo">316</span>    }<a name="line.316"></a>
+<span class="sourceLineNo">317</span><a name="line.317"></a>
+<span class="sourceLineNo">318</span>    @Override<a name="line.318"></a>
+<span class="sourceLineNo">319</span>    public boolean equals(final Object obj) {<a name="line.319"></a>
+<span class="sourceLineNo">320</span>        if (this == obj) {<a name="line.320"></a>
+<span class="sourceLineNo">321</span>            return true;<a name="line.321"></a>
+<span class="sourceLineNo">322</span>        }<a name="line.322"></a>
+<span class="sourceLineNo">323</span>        if (obj == null) {<a name="line.323"></a>
+<span class="sourceLineNo">324</span>            return false;<a name="line.324"></a>
+<span class="sourceLineNo">325</span>        }<a name="line.325"></a>
+<span class="sourceLineNo">326</span>        if (getClass() != obj.getClass()) {<a name="line.326"></a>
 <span class="sourceLineNo">327</span>            return false;<a name="line.327"></a>
 <span class="sourceLineNo">328</span>        }<a name="line.328"></a>
-<span class="sourceLineNo">329</span>        if (quotePolicy != other.quotePolicy) {<a name="line.329"></a>
-<span class="sourceLineNo">330</span>            return false;<a name="line.330"></a>
-<span class="sourceLineNo">331</span>        }<a name="line.331"></a>
-<span class="sourceLineNo">332</span>        if (quoteChar == null) {<a name="line.332"></a>
-<span class="sourceLineNo">333</span>            if (other.quoteChar != null) {<a name="line.333"></a>
-<span class="sourceLineNo">334</span>                return false;<a name="line.334"></a>
-<span class="sourceLineNo">335</span>            }<a name="line.335"></a>
-<span class="sourceLineNo">336</span>        } else if (!quoteChar.equals(other.quoteChar)) {<a name="line.336"></a>
-<span class="sourceLineNo">337</span>            return false;<a name="line.337"></a>
-<span class="sourceLineNo">338</span>        }<a name="line.338"></a>
-<span class="sourceLineNo">339</span>        if (commentStart == null) {<a name="line.339"></a>
-<span class="sourceLineNo">340</span>            if (other.commentStart != null) {<a name="line.340"></a>
-<span class="sourceLineNo">341</span>                return false;<a name="line.341"></a>
-<span class="sourceLineNo">342</span>            }<a name="line.342"></a>
-<span class="sourceLineNo">343</span>        } else if (!commentStart.equals(other.commentStart)) {<a name="line.343"></a>
-<span class="sourceLineNo">344</span>            return false;<a name="line.344"></a>
-<span class="sourceLineNo">345</span>        }<a name="line.345"></a>
-<span class="sourceLineNo">346</span>        if (escape == null) {<a name="line.346"></a>
-<span class="sourceLineNo">347</span>            if (other.escape != null) {<a name="line.347"></a>
-<span class="sourceLineNo">348</span>                return false;<a name="line.348"></a>
-<span class="sourceLineNo">349</span>            }<a name="line.349"></a>
-<span class="sourceLineNo">350</span>        } else if (!escape.equals(other.escape)) {<a name="line.350"></a>
-<span class="sourceLineNo">351</span>            return false;<a name="line.351"></a>
-<span class="sourceLineNo">352</span>        }<a name="line.352"></a>
-<span class="sourceLineNo">353</span>        if (!Arrays.equals(header, other.header)) {<a name="line.353"></a>
-<span class="sourceLineNo">354</span>            return false;<a name="line.354"></a>
-<span class="sourceLineNo">355</span>        }<a name="line.355"></a>
-<span class="sourceLineNo">356</span>        if (ignoreSurroundingSpaces != other.ignoreSurroundingSpaces) {<a name="line.356"></a>
-<span class="sourceLineNo">357</span>            return false;<a name="line.357"></a>
-<span class="sourceLineNo">358</span>        }<a name="line.358"></a>
-<span class="sourceLineNo">359</span>        if (ignoreEmptyLines != other.ignoreEmptyLines) {<a name="line.359"></a>
-<span class="sourceLineNo">360</span>            return false;<a name="line.360"></a>
-<span class="sourceLineNo">361</span>        }<a name="line.361"></a>
-<span class="sourceLineNo">362</span>        if (recordSeparator == null) {<a name="line.362"></a>
-<span class="sourceLineNo">363</span>            if (other.recordSeparator != null) {<a name="line.363"></a>
-<span class="sourceLineNo">364</span>                return false;<a name="line.364"></a>
-<span class="sourceLineNo">365</span>            }<a name="line.365"></a>
-<span class="sourceLineNo">366</span>        } else if (!recordSeparator.equals(other.recordSeparator)) {<a name="line.366"></a>
-<span class="sourceLineNo">367</span>            return false;<a name="line.367"></a>
-<span class="sourceLineNo">368</span>        }<a name="line.368"></a>
-<span class="sourceLineNo">369</span>        return true;<a name="line.369"></a>
-<span class="sourceLineNo">370</span>    }<a name="line.370"></a>
-<span class="sourceLineNo">371</span><a name="line.371"></a>
-<span class="sourceLineNo">372</span>    /**<a name="line.372"></a>
-<span class="sourceLineNo">373</span>     * Formats the specified values.<a name="line.373"></a>
-<span class="sourceLineNo">374</span>     *<a name="line.374"></a>
-<span class="sourceLineNo">375</span>     * @param values<a name="line.375"></a>
-<span class="sourceLineNo">376</span>     *            the values to format<a name="line.376"></a>
-<span class="sourceLineNo">377</span>     * @return the formatted values<a name="line.377"></a>
-<span class="sourceLineNo">378</span>     */<a name="line.378"></a>
-<span class="sourceLineNo">379</span>    public String format(final Object... values) {<a name="line.379"></a>
-<span class="sourceLineNo">380</span>        final StringWriter out = new StringWriter();<a name="line.380"></a>
-<span class="sourceLineNo">381</span>        try {<a name="line.381"></a>
-<span class="sourceLineNo">382</span>            new CSVPrinter(out, this).printRecord(values);<a name="line.382"></a>
-<span class="sourceLineNo">383</span>            return out.toString().trim();<a name="line.383"></a>
-<span class="sourceLineNo">384</span>        } catch (final IOException e) {<a name="line.384"></a>
-<span class="sourceLineNo">385</span>            // should not happen because a StringWriter does not do IO.<a name="line.385"></a>
-<span class="sourceLineNo">386</span>            throw new IllegalStateException(e);<a name="line.386"></a>
-<span class="sourceLineNo">387</span>        }<a name="line.387"></a>
-<span class="sourceLineNo">388</span>    }<a name="line.388"></a>
-<span class="sourceLineNo">389</span><a name="line.389"></a>
-<span class="sourceLineNo">390</span>    /**<a name="line.390"></a>
-<span class="sourceLineNo">391</span>     * Returns the character marking the start of a line comment.<a name="line.391"></a>
-<span class="sourceLineNo">392</span>     *<a name="line.392"></a>
-<span class="sourceLineNo">393</span>     * @return the comment start marker, may be {@code null}<a name="line.393"></a>
-<span class="sourceLineNo">394</span>     */<a name="line.394"></a>
-<span class="sourceLineNo">395</span>    public Character getCommentStart() {<a name="line.395"></a>
-<span class="sourceLineNo">396</span>        return commentStart;<a name="line.396"></a>
-<span class="sourceLineNo">397</span>    }<a name="line.397"></a>
-<span class="sourceLineNo">398</span><a name="line.398"></a>
-<span class="sourceLineNo">399</span>    /**<a name="line.399"></a>
-<span class="sourceLineNo">400</span>     * Returns the character delimiting the values (typically ';', ',' or '\t').<a name="line.400"></a>
-<span class="sourceLineNo">401</span>     *<a name="line.401"></a>
-<span class="sourceLineNo">402</span>     * @return the delimiter character<a name="line.402"></a>
-<span class="sourceLineNo">403</span>     */<a name="line.403"></a>
-<span class="sourceLineNo">404</span>    public char getDelimiter() {<a name="line.404"></a>
-<span class="sourceLineNo">405</span>        return delimiter;<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>    /**<a name="line.408"></a>
-<span class="sourceLineNo">409</span>     * Returns the escape character.<a name="line.409"></a>
-<span class="sourceLineNo">410</span>     *<a name="line.410"></a>
-<span class="sourceLineNo">411</span>     * @return the escape character, may be {@code null}<a name="line.411"></a>
-<span class="sourceLineNo">412</span>     */<a name="line.412"></a>
-<span class="sourceLineNo">413</span>    public Character getEscape() {<a name="line.413"></a>
-<span class="sourceLineNo">414</span>        return escape;<a name="line.414"></a>
-<span class="sourceLineNo">415</span>    }<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>     * Returns a copy of the header array.<a name="line.418"></a>
-<span class="sourceLineNo">419</span>     *<a name="line.419"></a>
-<span class="sourceLineNo">420</span>     * @return a copy of the header array<a name="line.420"></a>
-<span class="sourceLineNo">421</span>     */<a name="line.421"></a>
-<span class="sourceLineNo">422</span>    public String[] getHeader() {<a name="line.422"></a>
-<span class="sourceLineNo">423</span>        return header != null ? header.clone() : null;<a name="line.423"></a>
-<span class="sourceLineNo">424</span>    }<a name="line.424"></a>
-<span class="sourceLineNo">425</span><a name="line.425"></a>
-<span class="sourceLineNo">426</span>    /**<a name="line.426"></a>
-<span class="sourceLineNo">427</span>     * Specifies whether empty lines between records are ignored when parsing input.<a name="line.427"></a>
-<span class="sourceLineNo">428</span>     *<a name="line.428"></a>
-<span class="sourceLineNo">429</span>     * @return &lt;tt&gt;true&lt;/tt&gt; if empty lines between records are ignored, &lt;tt&gt;false&lt;/tt&gt; if they are turned into empty<a name="line.429"></a>
-<span class="sourceLineNo">430</span>     *         records.<a name="line.430"></a>
-<span class="sourceLineNo">431</span>     */<a name="line.431"></a>
-<span class="sourceLineNo">432</span>    public boolean getIgnoreEmptyLines() {<a name="line.432"></a>
-<span class="sourceLineNo">433</span>        return ignoreEmptyLines;<a name="line.433"></a>
-<span class="sourceLineNo">434</span>    }<a name="line.434"></a>
-<span class="sourceLineNo">435</span><a name="line.435"></a>
-<span class="sourceLineNo">436</span>    /**<a name="line.436"></a>
-<span class="sourceLineNo">437</span>     * Specifies whether spaces around values are ignored when parsing input.<a name="line.437"></a>
-<span class="sourceLineNo">438</span>     *<a name="line.438"></a>
-<span class="sourceLineNo">439</span>     * @return &lt;tt&gt;true&lt;/tt&gt; if spaces around values are ignored, &lt;tt&gt;false&lt;/tt&gt; if they are treated as part of the<a name="line.439"></a>
-<span class="sourceLineNo">440</span>     *         value.<a name="line.440"></a>
-<span class="sourceLineNo">441</span>     */<a name="line.441"></a>
-<span class="sourceLineNo">442</span>    public boolean getIgnoreSurroundingSpaces() {<a name="line.442"></a>
-<span class="sourceLineNo">443</span>        return ignoreSurroundingSpaces;<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>    /**<a name="line.446"></a>
-<span class="sourceLineNo">447</span>     * Gets the String to convert to and from {@code null}.<a name="line.447"></a>
-<span class="sourceLineNo">448</span>     * &lt;ul&gt;<a name="line.448"></a>
-<span class="sourceLineNo">449</span>     * &lt;li&gt;<a name="line.449"></a>
-<span class="sourceLineNo">450</span>     * &lt;strong&gt;Reading:&lt;/strong&gt; Converts strings equal to the given {@code nullString} to {@code null} when reading<a name="line.450"></a>
-<span class="sourceLineNo">451</span>     * records.<a name="line.451"></a>
-<span class="sourceLineNo">452</span>     * &lt;/li&gt;<a name="line.452"></a>
-<span class="sourceLineNo">453</span>     * &lt;li&gt;<a name="line.453"></a>
-<span class="sourceLineNo">454</span>     * &lt;strong&gt;Writing:&lt;/strong&gt; Writes {@code null} as the given {@code nullString} when writing records.&lt;/li&gt;<a name="line.454"></a>
-<span class="sourceLineNo">455</span>     * &lt;/ul&gt;<a name="line.455"></a>
-<span class="sourceLineNo">456</span>     *<a name="line.456"></a>
-<span class="sourceLineNo">457</span>     * @return the String to convert to and from {@code null}. No substitution occurs if {@code null}<a name="line.457"></a>
-<span class="sourceLineNo">458</span>     */<a name="line.458"></a>
-<span class="sourceLineNo">459</span>    public String getNullString() {<a name="line.459"></a>
-<span class="sourceLineNo">460</span>        return nullString;<a name="line.460"></a>
-<span class="sourceLineNo">461</span>    }<a name="line.461"></a>
-<span class="sourceLineNo">462</span><a name="line.462"></a>
-<span class="sourceLineNo">463</span>    /**<a name="line.463"></a>
-<span class="sourceLineNo">464</span>     * Returns the character used to encapsulate values containing special characters.<a name="line.464"></a>
-<span class="sourceLineNo">465</span>     *<a name="line.465"></a>
-<span class="sourceLineNo">466</span>     * @return the quoteChar character, may be {@code null}<a name="line.466"></a>
-<span class="sourceLineNo">467</span>     */<a name="line.467"></a>
-<span class="sourceLineNo">468</span>    public Character getQuoteChar() {<a name="line.468"></a>
-<span class="sourceLineNo">469</span>        return quoteChar;<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>     * Returns the quote policy output fields.<a name="line.473"></a>
-<span class="sourceLineNo">474</span>     *<a name="line.474"></a>
-<span class="sourceLineNo">475</span>     * @return the quote policy<a name="line.475"></a>
-<span class="sourceLineNo">476</span>     */<a name="line.476"></a>
-<span class="sourceLineNo">477</span>    public Quote getQuotePolicy() {<a name="line.477"></a>
-<span class="sourceLineNo">478</span>        return quotePolicy;<a name="line.478"></a>
-<span class="sourceLineNo">479</span>    }<a name="line.479"></a>
-<span class="sourceLineNo">480</span><a name="line.480"></a>
-<span class="sourceLineNo">481</span>    /**<a name="line.481"></a>
-<span class="sourceLineNo">482</span>     * Returns the line separator delimiting output records.<a name="line.482"></a>
-<span class="sourceLineNo">483</span>     *<a name="line.483"></a>
-<span class="sourceLineNo">484</span>     * @return the line separator<a name="line.484"></a>
-<span class="sourceLineNo">485</span>     */<a name="line.485"></a>
-<span class="sourceLineNo">486</span>    public String getRecordSeparator() {<a name="line.486"></a>
-<span class="sourceLineNo">487</span>        return recordSeparator;<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>     * Returns whether to skip the header record.<a name="line.491"></a>
-<span class="sourceLineNo">492</span>     *<a name="line.492"></a>
-<span class="sourceLineNo">493</span>     * @return whether to skip the header record.<a name="line.493"></a>
-<span class="sourceLineNo">494</span>     */<a name="line.494"></a>
-<span class="sourceLineNo">495</span>    public boolean getSkipHeaderRecord() {<a name="line.495"></a>
-<span class="sourceLineNo">496</span>        return skipHeaderRecord;<a name="line.496"></a>
-<span class="sourceLineNo">497</span>    }<a name="line.497"></a>
-<span class="sourceLineNo">498</span><a name="line.498"></a>
-<span class="sourceLineNo">499</span>    @Override<a name="line.499"></a>
-<span class="sourceLineNo">500</span>    public int hashCode()<a name="line.500"></a>
-<span class="sourceLineNo">501</span>    {<a name="line.501"></a>
-<span class="sourceLineNo">502</span>        final int prime = 31;<a name="line.502"></a>
-<span class="sourceLineNo">503</span>        int result = 1;<a name="line.503"></a>
-<span class="sourceLineNo">504</span><a name="line.504"></a>
-<span class="sourceLineNo">505</span>        result = prime * result + delimiter;<a name="line.505"></a>
-<span class="sourceLineNo">506</span>        result = prime * result + ((quotePolicy == null) ? 0 : quotePolicy.hashCode());<a name="line.506"></a>
-<span class="sourceLineNo">507</span>        result = prime * result + ((quoteChar == null) ? 0 : quoteChar.hashCode());<a name="line.507"></a>
-<span class="sourceLineNo">508</span>        result = prime * result + ((commentStart == null) ? 0 : commentStart.hashCode());<a name="line.508"></a>
-<span class="sourceLineNo">509</span>        result = prime * result + ((escape == null) ? 0 : escape.hashCode());<a name="line.509"></a>
-<span class="sourceLineNo">510</span>        result = prime * result + (ignoreSurroundingSpaces ? 1231 : 1237);<a name="line.510"></a>
-<span class="sourceLineNo">511</span>        result = prime * result + (ignoreEmptyLines ? 1231 : 1237);<a name="line.511"></a>
-<span class="sourceLineNo">512</span>        result = prime * result + ((recordSeparator == null) ? 0 : recordSeparator.hashCode());<a name="line.512"></a>
-<span class="sourceLineNo">513</span>        result = prime * result + Arrays.hashCode(header);<a name="line.513"></a>
-<span class="sourceLineNo">514</span>        return result;<a name="line.514"></a>
-<span class="sourceLineNo">515</span>    }<a name="line.515"></a>
-<span class="sourceLineNo">516</span><a name="line.516"></a>
-<span class="sourceLineNo">517</span>    /**<a name="line.517"></a>
-<span class="sourceLineNo">518</span>     * Specifies whether comments are supported by this format.<a name="line.518"></a>
-<span class="sourceLineNo">519</span>     *<a name="line.519"></a>
-<span class="sourceLineNo">520</span>     * Note that the comment introducer character is only recognized at the start of a line.<a name="line.520"></a>
-<span class="sourceLineNo">521</span>     *<a name="line.521"></a>
-<span class="sourceLineNo">522</span>     * @return &lt;tt&gt;true&lt;/tt&gt; is comments are supported, &lt;tt&gt;false&lt;/tt&gt; otherwise<a name="line.522"></a>
-<span class="sourceLineNo">523</span>     */<a name="line.523"></a>
-<span class="sourceLineNo">524</span>    public boolean isCommentingEnabled() {<a name="line.524"></a>
-<span class="sourceLineNo">525</span>        return commentStart != null;<a name="line.525"></a>
-<span class="sourceLineNo">526</span>    }<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>     * Returns whether escape are being processed.<a name="line.529"></a>
-<span class="sourceLineNo">530</span>     *<a name="line.530"></a>
-<span class="sourceLineNo">531</span>     * @return {@code true} if escapes are processed<a name="line.531"></a>
-<span class="sourceLineNo">532</span>     */<a name="line.532"></a>
-<span class="sourceLineNo">533</span>    public boolean isEscaping() {<a name="line.533"></a>
-<span class="sourceLineNo">534</span>        return escape != null;<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>    /**<a name="line.537"></a>
-<span class="sourceLineNo">538</span>     * Returns whether a nullString has been defined.<a name="line.538"></a>
-<span class="sourceLineNo">539</span>     *<a name="line.539"></a>
-<span class="sourceLineNo">540</span>     * @return {@code true} if a nullString is defined<a name="line.540"></a>
-<span class="sourceLineNo">541</span>     */<a name="line.541"></a>
-<span class="sourceLineNo">542</span>    public boolean isNullHandling() {<a name="line.542"></a>
-<span class="sourceLineNo">543</span>        return nullString != null;<a name="line.543"></a>
-<span class="sourceLineNo">544</span>    }<a name="line.544"></a>
-<span class="sourceLineNo">545</span><a name="line.545"></a>
-<span class="sourceLineNo">546</span>    /**<a name="line.546"></a>
-<span class="sourceLineNo">547</span>     * Returns whether a quoteChar has been defined.<a name="line.547"></a>
-<span class="sourceLineNo">548</span>     *<a name="line.548"></a>
-<span class="sourceLineNo">549</span>     * @return {@code true} if a quoteChar is defined<a name="line.549"></a>
-<span class="sourceLineNo">550</span>     */<a name="line.550"></a>
-<span class="sourceLineNo">551</span>    public boolean isQuoting() {<a name="line.551"></a>
-<span class="sourceLineNo">552</span>        return quoteChar != null;<a name="line.552"></a>
-<span class="sourceLineNo">553</span>    }<a name="line.553"></a>
-<span class="sourceLineNo">554</span><a name="line.554"></a>
-<span class="sourceLineNo">555</span>    /**<a name="line.555"></a>
-<span class="sourceLineNo">556</span>     * Parses the specified content.<a name="line.556"></a>
-<span class="sourceLineNo">557</span>     *<a name="line.557"></a>
-<span class="sourceLineNo">558</span>     * &lt;p&gt;<a name="line.558"></a>
-<span class="sourceLineNo">559</span>     * See also the various static parse methods on {@link CSVParser}.<a name="line.559"></a>
-<span class="sourceLineNo">560</span>     * &lt;/p&gt;<a name="line.560"></a>
-<span class="sourceLineNo">561</span>     *<a name="line.561"></a>
-<span class="sourceLineNo">562</span>     * @param in<a name="line.562"></a>
-<span class="sourceLineNo">563</span>     *            the input stream<a name="line.563"></a>
-<span class="sourceLineNo">564</span>     * @return a parser over a stream of {@link CSVRecord}s.<a name="line.564"></a>
-<span class="sourceLineNo">565</span>     * @throws IOException<a name="line.565"></a>
-<span class="sourceLineNo">566</span>     *             If an I/O error occurs<a name="line.566"></a>
-<span class="sourceLineNo">567</span>     */<a name="line.567"></a>
-<span class="sourceLineNo">568</span>    public CSVParser parse(final Reader in) throws IOException {<a name="line.568"></a>
-<span class="sourceLineNo">569</span>        return new CSVParser(in, this);<a name="line.569"></a>
-<span class="sourceLineNo">570</span>    }<a name="line.570"></a>
-<span class="sourceLineNo">571</span><a name="line.571"></a>
-<span class="sourceLineNo">572</span>    @Override<a name="line.572"></a>
-<span class="sourceLineNo">573</span>    public String toString() {<a name="line.573"></a>
-<span class="sourceLineNo">574</span>        final StringBuilder sb = new StringBuilder();<a name="line.574"></a>
-<span class="sourceLineNo">575</span>        sb.append("Delimiter=&lt;").append(delimiter).append('&gt;');<a name="line.575"></a>
-<span class="sourceLineNo">576</span>        if (isEscaping()) {<a name="line.576"></a>
-<span class="sourceLineNo">577</span>            sb.append(' ');<a name="line.577"></a>
-<span class="sourceLineNo">578</span>            sb.append("Escape=&lt;").append(escape).append('&gt;');<a name="line.578"></a>
-<span class="sourceLineNo">579</span>        }<a name="line.579"></a>
-<span class="sourceLineNo">580</span>        if (isQuoting()) {<a name="line.580"></a>
-<span class="sourceLineNo">581</span>            sb.append(' ');<a name="line.581"></a>
-<span class="sourceLineNo">582</span>            sb.append("QuoteChar=&lt;").append(quoteChar).append('&gt;');<a name="line.582"></a>
-<span class="sourceLineNo">583</span>        }<a name="line.583"></a>
-<span class="sourceLineNo">584</span>        if (isCommentingEnabled()) {<a name="line.584"></a>
-<span class="sourceLineNo">585</span>            sb.append(' ');<a name="line.585"></a>
-<span class="sourceLineNo">586</span>            sb.append("CommentStart=&lt;").append(commentStart).append('&gt;');<a name="line.586"></a>
-<span class="sourceLineNo">587</span>        }<a name="line.587"></a>
-<span class="sourceLineNo">588</span>        if (isNullHandling()) {<a name="line.588"></a>
-<span class="sourceLineNo">589</span>            sb.append(' ');<a name="line.589"></a>
-<span class="sourceLineNo">590</span>            sb.append("NullString=&lt;").append(nullString).append('&gt;');<a name="line.590"></a>
-<span class="sourceLineNo">591</span>        }<a name="line.591"></a>
-<span class="sourceLineNo">592</span>        if(recordSeparator != null) {<a name="line.592"></a>
-<span class="sourceLineNo">593</span>            sb.append(' ');<a name="line.593"></a>
-<span class="sourceLineNo">594</span>            sb.append("RecordSeparator=&lt;").append(recordSeparator).append('&gt;');<a name="line.594"></a>
-<span class="sourceLineNo">595</span>        }<a name="line.595"></a>
-<span class="sourceLineNo">596</span>        if (getIgnoreEmptyLines()) {<a name="line.596"></a>
-<span class="sourceLineNo">597</span>            sb.append(" EmptyLines:ignored");<a name="line.597"></a>
-<span class="sourceLineNo">598</span>        }<a name="line.598"></a>
-<span class="sourceLineNo">599</span>        if (getIgnoreSurroundingSpaces()) {<a name="line.599"></a>
-<span class="sourceLineNo">600</span>            sb.append(" SurroundingSpaces:ignored");<a name="line.600"></a>
-<span class="sourceLineNo">601</span>        }<a name="line.601"></a>
-<span class="sourceLineNo">602</span>        sb.append(" SkipHeaderRecord:").append(skipHeaderRecord);<a name="line.602"></a>
-<span class="sourceLineNo">603</span>        if (header != null) {<a name="line.603"></a>
-<span class="sourceLineNo">604</span>            sb.append(' ');<a name="line.604"></a>
-<span class="sourceLineNo">605</span>            sb.append("Header:").append(Arrays.toString(header));<a name="line.605"></a>
+<span class="sourceLineNo">329</span><a name="line.329"></a>
+<span class="sourceLineNo">330</span>        final CSVFormat other = (CSVFormat) obj;<a name="line.330"></a>
+<span class="sourceLineNo">331</span>        if (delimiter != other.delimiter) {<a name="line.331"></a>
+<span class="sourceLineNo">332</span>            return false;<a name="line.332"></a>
+<span class="sourceLineNo">333</span>        }<a name="line.333"></a>
+<span class="sourceLineNo">334</span>        if (quotePolicy != other.quotePolicy) {<a name="line.334"></a>
+<span class="sourceLineNo">335</span>            return false;<a name="line.335"></a>
+<span class="sourceLineNo">336</span>        }<a name="line.336"></a>
+<span class="sourceLineNo">337</span>        if (quoteChar == null) {<a name="line.337"></a>
+<span class="sourceLineNo">338</span>            if (other.quoteChar != null) {<a name="line.338"></a>
+<span class="sourceLineNo">339</span>                return false;<a name="line.339"></a>
+<span class="sourceLineNo">340</span>            }<a name="line.340"></a>
+<span class="sourceLineNo">341</span>        } else if (!quoteChar.equals(other.quoteChar)) {<a name="line.341"></a>
+<span class="sourceLineNo">342</span>            return false;<a name="line.342"></a>
+<span class="sourceLineNo">343</span>        }<a name="line.343"></a>
+<span class="sourceLineNo">344</span>        if (commentStart == null) {<a name="line.344"></a>
+<span class="sourceLineNo">345</span>            if (other.commentStart != null) {<a name="line.345"></a>
+<span class="sourceLineNo">346</span>                return false;<a name="line.346"></a>
+<span class="sourceLineNo">347</span>            }<a name="line.347"></a>
+<span class="sourceLineNo">348</span>        } else if (!commentStart.equals(other.commentStart)) {<a name="line.348"></a>
+<span class="sourceLineNo">349</span>            return false;<a name="line.349"></a>
+<span class="sourceLineNo">350</span>        }<a name="line.350"></a>
+<span class="sourceLineNo">351</span>        if (escape == null) {<a name="line.351"></a>
+<span class="sourceLineNo">352</span>            if (other.escape != null) {<a name="line.352"></a>
+<span class="sourceLineNo">353</span>                return false;<a name="line.353"></a>
+<span class="sourceLineNo">354</span>            }<a name="line.354"></a>
+<span class="sourceLineNo">355</span>        } else if (!escape.equals(other.escape)) {<a name="line.355"></a>
+<span class="sourceLineNo">356</span>            return false;<a name="line.356"></a>
+<span class="sourceLineNo">357</span>        }<a name="line.357"></a>
+<span class="sourceLineNo">358</span>        if (!Arrays.equals(header, other.header)) {<a name="line.358"></a>
+<span class="sourceLineNo">359</span>            return false;<a name="line.359"></a>
+<span class="sourceLineNo">360</span>        }<a name="line.360"></a>
+<span class="sourceLineNo">361</span>        if (ignoreSurroundingSpaces != other.ignoreSurroundingSpaces) {<a name="line.361"></a>
+<span class="sourceLineNo">362</span>            return false;<a name="line.362"></a>
+<span class="sourceLineNo">363</span>        }<a name="line.363"></a>
+<span class="sourceLineNo">364</span>        if (ignoreEmptyLines != other.ignoreEmptyLines) {<a name="line.364"></a>
+<span class="sourceLineNo">365</span>            return false;<a name="line.365"></a>
+<span class="sourceLineNo">366</span>        }<a name="line.366"></a>
+<span class="sourceLineNo">367</span>        if (recordSeparator == null) {<a name="line.367"></a>
+<span class="sourceLineNo">368</span>            if (other.recordSeparator != null) {<a name="line.368"></a>
+<span class="sourceLineNo">369</span>                return false;<a name="line.369"></a>
+<span class="sourceLineNo">370</span>            }<a name="line.370"></a>
+<span class="sourceLineNo">371</span>        } else if (!recordSeparator.equals(other.recordSeparator)) {<a name="line.371"></a>
+<span class="sourceLineNo">372</span>            return false;<a name="line.372"></a>
+<span class="sourceLineNo">373</span>        }<a name="line.373"></a>
+<span class="sourceLineNo">374</span>        return true;<a name="line.374"></a>
+<span class="sourceLineNo">375</span>    }<a name="line.375"></a>
+<span class="sourceLineNo">376</span><a name="line.376"></a>
+<span class="sourceLineNo">377</span>    /**<a name="line.377"></a>
+<span class="sourceLineNo">378</span>     * Formats the specified values.<a name="line.378"></a>
+<span class="sourceLineNo">379</span>     *<a name="line.379"></a>
+<span class="sourceLineNo">380</span>     * @param values<a name="line.380"></a>
+<span class="sourceLineNo">381</span>     *            the values to format<a name="line.381"></a>
+<span class="sourceLineNo">382</span>     * @return the formatted values<a name="line.382"></a>
+<span class="sourceLineNo">383</span>     */<a name="line.383"></a>
+<span class="sourceLineNo">384</span>    public String format(final Object... values) {<a name="line.384"></a>
+<span class="sourceLineNo">385</span>        final StringWriter out = new StringWriter();<a name="line.385"></a>
+<span class="sourceLineNo">386</span>        try {<a name="line.386"></a>
+<span class="sourceLineNo">387</span>            new CSVPrinter(out, this).printRecord(values);<a name="line.387"></a>
+<span class="sourceLineNo">388</span>            return out.toString().trim();<a name="line.388"></a>
+<span class="sourceLineNo">389</span>        } catch (final IOException e) {<a name="line.389"></a>
+<span class="sourceLineNo">390</span>            // should not happen because a StringWriter does not do IO.<a name="line.390"></a>
+<span class="sourceLineNo">391</span>            throw new IllegalStateException(e);<a name="line.391"></a>
+<span class="sourceLineNo">392</span>        }<a name="line.392"></a>
+<span class="sourceLineNo">393</span>    }<a name="line.393"></a>
+<span class="sourceLineNo">394</span><a name="line.394"></a>
+<span class="sourceLineNo">395</span>    /**<a name="line.395"></a>
+<span class="sourceLineNo">396</span>     * Returns the character marking the start of a line comment.<a name="line.396"></a>
+<span class="sourceLineNo">397</span>     *<a name="line.397"></a>
+<span class="sourceLineNo">398</span>     * @return the comment start marker, may be {@code null}<a name="line.398"></a>
+<span class="sourceLineNo">399</span>     */<a name="line.399"></a>
+<span class="sourceLineNo">400</span>    public Character getCommentStart() {<a name="line.400"></a>
+<span class="sourceLineNo">401</span>        return commentStart;<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>    /**<a name="line.404"></a>
+<span class="sourceLineNo">405</span>     * Returns the character delimiting the values (typically ';', ',' or '\t').<a name="line.405"></a>
+<span class="sourceLineNo">406</span>     *<a name="line.406"></a>
+<span class="sourceLineNo">407</span>     * @return the delimiter character<a name="line.407"></a>
+<span class="sourceLineNo">408</span>     */<a name="line.408"></a>
+<span class="sourceLineNo">409</span>    public char getDelimiter() {<a name="line.409"></a>
+<span class="sourceLineNo">410</span>        return delimiter;<a name="line.410"></a>
+<span class="sourceLineNo">411</span>    }<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>     * Returns the escape character.<a name="line.414"></a>
+<span class="sourceLineNo">415</span>     *<a name="line.415"></a>
+<span class="sourceLineNo">416</span>     * @return the escape character, may be {@code null}<a name="line.416"></a>
+<span class="sourceLineNo">417</span>     */<a name="line.417"></a>
+<span class="sourceLineNo">418</span>    public Character getEscape() {<a name="line.418"></a>
+<span class="sourceLineNo">419</span>        return escape;<a name="line.419"></a>
+<span class="sourceLineNo">420</span>    }<a name="line.420"></a>
+<span class="sourceLineNo">421</span><a name="line.421"></a>
+<span class="sourceLineNo">422</span>    /**<a name="line.422"></a>
+<span class="sourceLineNo">423</span>     * Returns a copy of the header array.<a name="line.423"></a>
+<span class="sourceLineNo">424</span>     *<a name="line.424"></a>
+<span class="sourceLineNo">425</span>     * @return a copy of the header array<a name="line.425"></a>
+<span class="sourceLineNo">426</span>     */<a name="line.426"></a>
+<span class="sourceLineNo">427</span>    public String[] getHeader() {<a name="line.427"></a>
+<span class="sourceLineNo">428</span>        return header != null ? header.clone() : null;<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>     * Specifies whether empty lines between records are ignored when parsing input.<a name="line.432"></a>
+<span class="sourceLineNo">433</span>     *<a name="line.433"></a>
+<span class="sourceLineNo">434</span>     * @return &lt;tt&gt;true&lt;/tt&gt; if empty lines between records are ignored, &lt;tt&gt;false&lt;/tt&gt; if they are turned into empty<a name="line.434"></a>
+<span class="sourceLineNo">435</span>     *         records.<a name="line.435"></a>
+<span class="sourceLineNo">436</span>     */<a name="line.436"></a>
+<span class="sourceLineNo">437</span>    public boolean getIgnoreEmptyLines() {<a name="line.437"></a>
+<span class="sourceLineNo">438</span>        return ignoreEmptyLines;<a name="line.438"></a>
+<span class="sourceLineNo">439</span>    }<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>     * Specifies whether spaces around values are ignored when parsing input.<a name="line.442"></a>
+<span class="sourceLineNo">443</span>     *<a name="line.443"></a>
+<span class="sourceLineNo">444</span>     * @return &lt;tt&gt;true&lt;/tt&gt; if spaces around values are ignored, &lt;tt&gt;false&lt;/tt&gt; if they are treated as part of the<a name="line.444"></a>
+<span class="sourceLineNo">445</span>     *         value.<a name="line.445"></a>
+<span class="sourceLineNo">446</span>     */<a name="line.446"></a>
+<span class="sourceLineNo">447</span>    public boolean getIgnoreSurroundingSpaces() {<a name="line.447"></a>
+<span class="sourceLineNo">448</span>        return ignoreSurroundingSpaces;<a name="line.448"></a>
+<span class="sourceLineNo">449</span>    }<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>     * Gets the String to convert to and from {@code null}.<a name="line.452"></a>
+<span class="sourceLineNo">453</span>     * &lt;ul&gt;<a name="line.453"></a>
+<span class="sourceLineNo">454</span>     * &lt;li&gt;<a name="line.454"></a>
+<span class="sourceLineNo">455</span>     * &lt;strong&gt;Reading:&lt;/strong&gt; Converts strings equal to the given {@code nullString} to {@code null} when reading<a name="line.455"></a>
+<span class="sourceLineNo">456</span>     * records.<a name="line.456"></a>
+<span class="sourceLineNo">457</span>     * &lt;/li&gt;<a name="line.457"></a>
+<span class="sourceLineNo">458</span>     * &lt;li&gt;<a name="line.458"></a>
+<span class="sourceLineNo">459</span>     * &lt;strong&gt;Writing:&lt;/strong&gt; Writes {@code null} as the given {@code nullString} when writing records.&lt;/li&gt;<a name="line.459"></a>
+<span class="sourceLineNo">460</span>     * &lt;/ul&gt;<a name="line.460"></a>
+<span class="sourceLineNo">461</span>     *<a name="line.461"></a>
+<span class="sourceLineNo">462</span>     * @return the String to convert to and from {@code null}. No substitution occurs if {@code null}<a name="line.462"></a>
+<span class="sourceLineNo">463</span>     */<a name="line.463"></a>
+<span class="sourceLineNo">464</span>    public String getNullString() {<a name="line.464"></a>
+<span class="sourceLineNo">465</span>        return nullString;<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>     * Returns the character used to encapsulate values containing special characters.<a name="line.469"></a>
+<span class="sourceLineNo">470</span>     *<a name="line.470"></a>
+<span class="sourceLineNo">471</span>     * @return the quoteChar character, may be {@code null}<a name="line.471"></a>
+<span class="sourceLineNo">472</span>     */<a name="line.472"></a>
+<span class="sourceLineNo">473</span>    public Character getQuoteChar() {<a name="line.473"></a>
+<span class="sourceLineNo">474</span>        return quoteChar;<a name="line.474"></a>
+<span class="sourceLineNo">475</span>    }<a name="line.475"></a>
+<span class="sourceLineNo">476</span><a name="line.476"></a>
+<span class="sourceLineNo">477</span>    /**<a name="line.477"></a>
+<span class="sourceLineNo">478</span>     * Returns the quote policy output fields.<a name="line.478"></a>
+<span class="sourceLineNo">479</span>     *<a name="line.479"></a>
+<span class="sourceLineNo">480</span>     * @return the quote policy<a name="line.480"></a>
+<span class="sourceLineNo">481</span>     */<a name="line.481"></a>
+<span class="sourceLineNo">482</span>    public Quote getQuotePolicy() {<a name="line.482"></a>
+<span class="sourceLineNo">483</span>        return quotePolicy;<a name="line.483"></a>
+<span class="sourceLineNo">484</span>    }<a name="line.484"></a>
+<span class="sourceLineNo">485</span><a name="line.485"></a>
+<span class="sourceLineNo">486</span>    /**<a name="line.486"></a>
+<span class="sourceLineNo">487</span>     * Returns the line separator delimiting output records.<a name="line.487"></a>
+<span class="sourceLineNo">488</span>     *<a name="line.488"></a>
+<span class="sourceLineNo">489</span>     * @return the line separator<a name="line.489"></a>
+<span class="sourceLineNo">490</span>     */<a name="line.490"></a>
+<span class="sourceLineNo">491</span>    public String getRecordSeparator() {<a name="line.491"></a>
+<span class="sourceLineNo">492</span>        return recordSeparator;<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>    /**<a name="line.495"></a>
+<span class="sourceLineNo">496</span>     * Returns whether to skip the header record.<a name="line.496"></a>
+<span class="sourceLineNo">497</span>     *<a name="line.497"></a>
+<span class="sourceLineNo">498</span>     * @return whether to skip the header record.<a name="line.498"></a>
+<span class="sourceLineNo">499</span>     */<a name="line.499"></a>
+<span class="sourceLineNo">500</span>    public boolean getSkipHeaderRecord() {<a name="line.500"></a>
+<span class="sourceLineNo">501</span>        return skipHeaderRecord;<a name="line.501"></a>
+<span class="sourceLineNo">502</span>    }<a name="line.502"></a>
+<span class="sourceLineNo">503</span><a name="line.503"></a>
+<span class="sourceLineNo">504</span>    @Override<a name="line.504"></a>
+<span class="sourceLineNo">505</span>    public int hashCode()<a name="line.505"></a>
+<span class="sourceLineNo">506</span>    {<a name="line.506"></a>
+<span class="sourceLineNo">507</span>        final int prime = 31;<a name="line.507"></a>
+<span class="sourceLineNo">508</span>        int result = 1;<a name="line.508"></a>
+<span class="sourceLineNo">509</span><a name="line.509"></a>
+<span class="sourceLineNo">510</span>        result = prime * result + delimiter;<a name="line.510"></a>
+<span class="sourceLineNo">511</span>        result = prime * result + ((quotePolicy == null) ? 0 : quotePolicy.hashCode());<a name="line.511"></a>
+<span class="sourceLineNo">512</span>        result = prime * result + ((quoteChar == null) ? 0 : quoteChar.hashCode());<a name="line.512"></a>
+<span class="sourceLineNo">513</span>        result = prime * result + ((commentStart == null) ? 0 : commentStart.hashCode());<a name="line.513"></a>
+<span class="sourceLineNo">514</span>        result = prime * result + ((escape == null) ? 0 : escape.hashCode());<a name="line.514"></a>
+<span class="sourceLineNo">515</span>        result = prime * result + (ignoreSurroundingSpaces ? 1231 : 1237);<a name="line.515"></a>
+<span class="sourceLineNo">516</span>        result = prime * result + (ignoreEmptyLines ? 1231 : 1237);<a name="line.516"></a>
+<span class="sourceLineNo">517</span>        result = prime * result + ((recordSeparator == null) ? 0 : recordSeparator.hashCode());<a name="line.517"></a>
+<span class="sourceLineNo">518</span>        result = prime * result + Arrays.hashCode(header);<a name="line.518"></a>
+<span class="sourceLineNo">519</span>        return result;<a name="line.519"></a>
+<span class="sourceLineNo">520</span>    }<a name="line.520"></a>
+<span class="sourceLineNo">521</span><a name="line.521"></a>
+<span class="sourceLineNo">522</span>    /**<a name="line.522"></a>
+<span class="sourceLineNo">523</span>     * Specifies whether comments are supported by this format.<a name="line.523"></a>
+<span class="sourceLineNo">524</span>     *<a name="line.524"></a>
+<span class="sourceLineNo">525</span>     * Note that the comment introducer character is only recognized at the start of a line.<a name="line.525"></a>
+<span class="sourceLineNo">526</span>     *<a name="line.526"></a>
+<span class="sourceLineNo">527</span>     * @return &lt;tt&gt;true&lt;/tt&gt; is comments are supported, &lt;tt&gt;false&lt;/tt&gt; otherwise<a name="line.527"></a>
+<span class="sourceLineNo">528</span>     */<a name="line.528"></a>
+<span class="sourceLineNo">529</span>    public boolean isCommentingEnabled() {<a name="line.529"></a>
+<span class="sourceLineNo">530</span>        return commentStart != null;<a name="line.530"></a>
+<span class="sourceLineNo">531</span>    }<a name="line.531"></a>
+<span class="sourceLineNo">532</span><a name="line.532"></a>
+<span class="sourceLineNo">533</span>    /**<a name="line.533"></a>
+<span class="sourceLineNo">534</span>     * Returns whether escape are being processed.<a name="line.534"></a>
+<span class="sourceLineNo">535</span>     *<a name="line.535"></a>
+<span class="sourceLineNo">536</span>     * @return {@code true} if escapes are processed<a name="line.536"></a>
+<span class="sourceLineNo">537</span>     */<a name="line.537"></a>
+<span class="sourceLineNo">538</span>    public boolean isEscaping() {<a name="line.538"></a>
+<span class="sourceLineNo">539</span>        return escape != null;<a name="line.539"></a>
+<span class="sourceLineNo">540</span>    }<a name="line.540"></a>
+<span class="sourceLineNo">541</span><a name="line.541"></a>
+<span class="sourceLineNo">542</span>    /**<a name="line.542"></a>
+<span class="sourceLineNo">543</span>     * Returns whether a nullString has been defined.<a name="line.543"></a>
+<span class="sourceLineNo">544</span>     *<a name="line.544"></a>
+<span class="sourceLineNo">545</span>     * @return {@code true} if a nullString is defined<a name="line.545"></a>
+<span class="sourceLineNo">546</span>     */<a name="line.546"></a>
+<span class="sourceLineNo">547</span>    public boolean isNullHandling() {<a name="line.547"></a>
+<span class="sourceLineNo">548</span>        return nullString != null;<a name="line.548"></a>
+<span class="sourceLineNo">549</span>    }<a name="line.549"></a>
+<span class="sourceLineNo">550</span><a name="line.550"></a>
+<span class="sourceLineNo">551</span>    /**<a name="line.551"></a>
+<span class="sourceLineNo">552</span>     * Returns whether a quoteChar has been defined.<a name="line.552"></a>
+<span class="sourceLineNo">553</span>     *<a name="line.553"></a>
+<span class="sourceLineNo">554</span>     * @return {@code true} if a quoteChar is defined<a name="line.554"></a>
+<span class="sourceLineNo">555</span>     */<a name="line.555"></a>
+<span class="sourceLineNo">556</span>    public boolean isQuoting() {<a name="line.556"></a>
+<span class="sourceLineNo">557</span>        return quoteChar != null;<a name="line.557"></a>
+<span class="sourceLineNo">558</span>    }<a name="line.558"></a>
+<span class="sourceLineNo">559</span><a name="line.559"></a>
+<span class="sourceLineNo">560</span>    /**<a name="line.560"></a>
+<span class="sourceLineNo">561</span>     * Parses the specified content.<a name="line.561"></a>
+<span class="sourceLineNo">562</span>     *<a name="line.562"></a>
+<span class="sourceLineNo">563</span>     * &lt;p&gt;<a name="line.563"></a>
+<span class="sourceLineNo">564</span>     * See also the various static parse methods on {@link CSVParser}.<a name="line.564"></a>
+<span class="sourceLineNo">565</span>     * &lt;/p&gt;<a name="line.565"></a>
+<span class="sourceLineNo">566</span>     *<a name="line.566"></a>
+<span class="sourceLineNo">567</span>     * @param in<a name="line.567"></a>
+<span class="sourceLineNo">568</span>     *            the input stream<a name="line.568"></a>
+<span class="sourceLineNo">569</span>     * @return a parser over a stream of {@link CSVRecord}s.<a name="line.569"></a>
+<span class="sourceLineNo">570</span>     * @throws IOException<a name="line.570"></a>
+<span class="sourceLineNo">571</span>     *             If an I/O error occurs<a name="line.571"></a>
+<span class="sourceLineNo">572</span>     */<a name="line.572"></a>
+<span class="sourceLineNo">573</span>    public CSVParser parse(final Reader in) throws IOException {<a name="line.573"></a>
+<span class="sourceLineNo">574</span>        return new CSVParser(in, this);<a name="line.574"></a>
+<span class="sourceLineNo">575</span>    }<a name="line.575"></a>
+<span class="sourceLineNo">576</span><a name="line.576"></a>
+<span class="sourceLineNo">577</span>    @Override<a name="line.577"></a>
+<span class="sourceLineNo">578</span>    public String toString() {<a name="line.578"></a>
+<span class="sourceLineNo">579</span>        final StringBuilder sb = new StringBuilder();<a name="line.579"></a>
+<span class="sourceLineNo">580</span>        sb.append("Delimiter=&lt;").append(delimiter).append('&gt;');<a name="line.580"></a>
+<span class="sourceLineNo">581</span>        if (isEscaping()) {<a name="line.581"></a>
+<span class="sourceLineNo">582</span>            sb.append(' ');<a name="line.582"></a>
+<span class="sourceLineNo">583</span>            sb.append("Escape=&lt;").append(escape).append('&gt;');<a name="line.583"></a>
+<span class="sourceLineNo">584</span>        }<a name="line.584"></a>
+<span class="sourceLineNo">585</span>        if (isQuoting()) {<a name="line.585"></a>
+<span class="sourceLineNo">586</span>            sb.append(' ');<a name="line.586"></a>
+<span class="sourceLineNo">587</span>            sb.append("QuoteChar=&lt;").append(quoteChar).append('&gt;');<a name="line.587"></a>
+<span class="sourceLineNo">588</span>        }<a name="line.588"></a>
+<span class="sourceLineNo">589</span>        if (isCommentingEnabled()) {<a name="line.589"></a>
+<span class="sourceLineNo">590</span>            sb.append(' ');<a name="line.590"></a>
+<span class="sourceLineNo">591</span>            sb.append("CommentStart=&lt;").append(commentStart).append('&gt;');<a name="line.591"></a>
+<span class="sourceLineNo">592</span>        }<a name="line.592"></a>
+<span class="sourceLineNo">593</span>        if (isNullHandling()) {<a name="line.593"></a>
+<span class="sourceLineNo">594</span>            sb.append(' ');<a name="line.594"></a>
+<span class="sourceLineNo">595</span>            sb.append("NullString=&lt;").append(nullString).append('&gt;');<a name="line.595"></a>
+<span class="sourceLineNo">596</span>        }<a name="line.596"></a>
+<span class="sourceLineNo">597</span>        if(recordSeparator != null) {<a name="line.597"></a>
+<span class="sourceLineNo">598</span>            sb.append(' ');<a name="line.598"></a>
+<span class="sourceLineNo">599</span>            sb.append("RecordSeparator=&lt;").append(recordSeparator).append('&gt;');<a name="line.599"></a>
+<span class="sourceLineNo">600</span>        }<a name="line.600"></a>
+<span class="sourceLineNo">601</span>        if (getIgnoreEmptyLines()) {<a name="line.601"></a>
+<span class="sourceLineNo">602</span>            sb.append(" EmptyLines:ignored");<a name="line.602"></a>
+<span class="sourceLineNo">603</span>        }<a name="line.603"></a>
+<span class="sourceLineNo">604</span>        if (getIgnoreSurroundingSpaces()) {<a name="line.604"></a>
+<span class="sourceLineNo">605</span>            sb.append(" SurroundingSpaces:ignored");<a name="line.605"></a>
 <span class="sourceLineNo">606</span>        }<a name="line.606"></a>
-<span class="sourceLineNo">607</span>        return sb.toString();<a name="line.607"></a>
-<span class="sourceLineNo">608</span>    }<a name="line.608"></a>
-<span class="sourceLineNo">609</span><a name="line.609"></a>
-<span class="sourceLineNo">610</span>    /**<a name="line.610"></a>
-<span class="sourceLineNo">611</span>     * Verifies the consistency of the parameters and throws an IllegalStateException if necessary.<a name="line.611"></a>
-<span class="sourceLineNo">612</span>     *<a name="line.612"></a>
-<span class="sourceLineNo">613</span>     * @throws IllegalStateException<a name="line.613"></a>
-<span class="sourceLineNo">614</span>     */<a name="line.614"></a>
-<span class="sourceLineNo">615</span>    void validate() throws IllegalStateException {<a name="line.615"></a>
-<span class="sourceLineNo">616</span>        if (quoteChar != null &amp;&amp; delimiter == quoteChar.charValue()) {<a name="line.616"></a>
-<span class="sourceLineNo">617</span>            throw new IllegalStateException(<a name="line.617"></a>
-<span class="sourceLineNo">618</span>                    "The quoteChar character and the delimiter cannot be the same ('" + quoteChar + "')");<a name="line.618"></a>
-<span class="sourceLineNo">619</span>        }<a name="line.619"></a>
-<span class="sourceLineNo">620</span><a name="line.620"></a>
-<span class="sourceLineNo">621</span>        if (escape != null &amp;&amp; delimiter == escape.charValue()) {<a name="line.621"></a>
+<span class="sourceLineNo">607</span>        sb.append(" SkipHeaderRecord:").append(skipHeaderRecord);<a name="line.607"></a>
+<span class="sourceLineNo">608</span>        if (header != null) {<a name="line.608"></a>
+<span class="sourceLineNo">609</span>            sb.append(' ');<a name="line.609"></a>
+<span class="sourceLineNo">610</span>            sb.append("Header:").append(Arrays.toString(header));<a name="line.610"></a>
+<span class="sourceLineNo">611</span>        }<a name="line.611"></a>
+<span class="sourceLineNo">612</span>        return sb.toString();<a name="line.612"></a>
+<span class="sourceLineNo">613</span>    }<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>     * Verifies the consistency of the parameters and throws an IllegalStateException if necessary.<a name="line.616"></a>
+<span class="sourceLineNo">617</span>     *<a name="line.617"></a>
+<span class="sourceLineNo">618</span>     * @throws IllegalStateException<a name="line.618"></a>
+<span class="sourceLineNo">619</span>     */<a name="line.619"></a>
+<span class="sourceLineNo">620</span>    void validate() throws IllegalStateException {<a name="line.620"></a>
+<span class="sourceLineNo">621</span>        if (quoteChar != null &amp;&amp; delimiter == quoteChar.charValue()) {<a name="line.621"></a>
 <span class="sourceLineNo">622</span>            throw new IllegalStateException(<a name="line.622"></a>
-<span class="sourceLineNo">623</span>                    "The escape character and the delimiter cannot be the same ('" + escape + "')");<a name="line.623"></a>
+<span class="sourceLineNo">623</span>                    "The quoteChar character and the delimiter cannot be the same ('" + quoteChar + "')");<a name="line.623"></a>
 <span class="sourceLineNo">624</span>        }<a name="line.624"></a>
 <span class="sourceLineNo">625</span><a name="line.625"></a>
-<span class="sourceLineNo">626</span>        if (commentStart != null &amp;&amp; delimiter == commentStart.charValue()) {<a name="line.626"></a>
+<span class="sourceLineNo">626</span>        if (escape != null &amp;&amp; delimiter == escape.charValue()) {<a name="line.626"></a>
 <span class="sourceLineNo">627</span>            throw new IllegalStateException(<a name="line.627"></a>
-<span class="sourceLineNo">628</span>                    "The comment start character and the delimiter cannot be the same ('" + commentStart + "')");<a name="line.628"></a>
+<span class="sourceLineNo">628</span>                    "The escape character and the delimiter cannot be the same ('" + escape + "')");<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>        if (quoteChar != null &amp;&amp; quoteChar.equals(commentStart)) {<a name="line.631"></a>
+<span class="sourceLineNo">631</span>        if (commentStart != null &amp;&amp; delimiter == commentStart.charValue()) {<a name="line.631"></a>
 <span class="sourceLineNo">632</span>            throw new IllegalStateException(<a name="line.632"></a>
-<span class="sourceLineNo">633</span>                    "The comment start character and the quoteChar cannot be the same ('" + commentStart + "')");<a name="line.633"></a>
+<span class="sourceLineNo">633</span>                    "The comment start character and the delimiter cannot be the same ('" + commentStart + "')");<a name="line.633"></a>
 <span class="sourceLineNo">634</span>        }<a name="line.634"></a>
 <span class="sourceLineNo">635</span><a name="line.635"></a>
-<span class="sourceLineNo">636</span>        if (escape != null &amp;&amp; escape.equals(commentStart)) {<a name="line.636"></a>
+<span class="sourceLineNo">636</span>        if (quoteChar != null &amp;&amp; quoteChar.equals(commentStart)) {<a name="line.636"></a>
 <span class="sourceLineNo">637</span>            throw new IllegalStateException(<a name="line.637"></a>
-<span class="sourceLineNo">638</span>                    "The comment start and the escape character cannot be the same ('" + commentStart + "')");<a name="line.638"></a>

[... 497 lines stripped ...]


Mime
View raw message