Added: websites/production/commons/content/proper/commons-csv/archives/1.1/apidocs/org/apache/commons/csv/CSVFormat.html ============================================================================== --- websites/production/commons/content/proper/commons-csv/archives/1.1/apidocs/org/apache/commons/csv/CSVFormat.html (added) +++ websites/production/commons/content/proper/commons-csv/archives/1.1/apidocs/org/apache/commons/csv/CSVFormat.html Wed Nov 26 13:28:09 2014 @@ -0,0 +1,1650 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!-- NewPage --> +<html lang="en"> +<head> +<!-- Generated by javadoc --> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>CSVFormat (Apache Commons CSV 1.1 API)</title> +<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> +<script type="text/javascript" src="../../../../script.js"></script> +</head> +<body> +<script type="text/javascript"><!-- + try { + if (location.href.indexOf('is-external=true') == -1) { + parent.document.title="CSVFormat (Apache Commons CSV 1.1 API)"; + } + } + catch(err) { + } +//--> +var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":9,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10}; +var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; +var altColor = "altColor"; +var rowColor = "rowColor"; +var tableTab = "tableTab"; +var activeTableTab = "activeTableTab"; +</script> +<noscript> +<div>JavaScript is disabled on your browser.</div> +</noscript> +<!-- ========= START OF TOP NAVBAR ======= --> +<div class="topNav"><a name="navbar.top"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.top.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../../../org/apache/commons/csv/package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="class-use/CSVFormat.html">Use</a></li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../../../deprecated-list.html">Deprecated</a></li> +<li><a href="../../../../index-all.html">Index</a></li> +<li><a href="../../../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Class</li> +<li><a href="../../../../org/apache/commons/csv/CSVParser.html" title="class in org.apache.commons.csv"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../../index.html?org/apache/commons/csv/CSVFormat.html" target="_top">Frames</a></li> +<li><a href="CSVFormat.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_top"> +<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_top"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //--> +</script> +</div> +<div> +<ul class="subNavList"> +<li>Summary: </li> +<li>Nested | </li> +<li><a href="#field.summary">Field</a> | </li> +<li>Constr | </li> +<li><a href="#method.summary">Method</a></li> +</ul> +<ul class="subNavList"> +<li>Detail: </li> +<li><a href="#field.detail">Field</a> | </li> +<li>Constr | </li> +<li><a href="#method.detail">Method</a></li> +</ul> +</div> +<a name="skip.navbar.top"> +<!-- --> +</a></div> +<!-- ========= END OF TOP NAVBAR ========= --> +<!-- ======== START OF CLASS DATA ======== --> +<div class="header"> +<div class="subTitle">org.apache.commons.csv</div> +<h2 title="Class CSVFormat" class="title">Class CSVFormat</h2> +</div> +<div class="contentContainer"> +<ul class="inheritance"> +<li><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> +<li> +<ul class="inheritance"> +<li>org.apache.commons.csv.CSVFormat</li> +</ul> +</li> +</ul> +<div class="description"> +<ul class="blockList"> +<li class="blockList"> +<dl> +<dt>All Implemented Interfaces:</dt> +<dd><a href="http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd> +</dl> +<hr> +<br> +<pre>public final class <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.148">CSVFormat</a> +extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> +implements <a href="http://docs.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre> +<div class="block">Specifies the format of a CSV file and parses input. + + <h2>Using predefined formats</h2> + + <p> + You can use one of the predefined formats: + </p> + + <ul> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#DEFAULT"><code>DEFAULT</code></a></li> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#EXCEL"><code>EXCEL</code></a></li> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#MYSQL"><code>MYSQL</code></a></li> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#RFC4180"><code>RFC4180</code></a></li> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#TDF"><code>TDF</code></a></li> + </ul> + + <p> + For example: + </p> + + <pre> + CSVParser parser = CSVFormat.EXCEL.parse(reader); + </pre> + + <p> + The <a href="../../../../org/apache/commons/csv/CSVParser.html" title="class in org.apache.commons.csv"><code>CSVParser</code></a> provides static methods to parse other input types, for example: + </p> + + <pre> + CSVParser parser = CSVParser.parse(file, StandardCharsets.US_ASCII, CSVFormat.EXCEL); + </pre> + + <h2>Defining formats</h2> + + <p> + You can extend a format by calling the <code>with</code> methods. For example: + </p> + + <pre> + CSVFormat.EXCEL.withNullString("N/A").withIgnoreSurroundingSpaces(true); + </pre> + + <h2>Defining column names</h2> + + <p> + To define the column names you want to use to access records, write: + </p> + + <pre> + CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3"); + </pre> + + <p> + Calling <a href="../../../../org/apache/commons/csv/CSVFormat.html#withHeader-java.lang.String...-"><code>withHeader(String...)</code></a> let's you use the given names to address values in a <a href="../../../../org/apache/commons/csv/CSVRecord.html" title="class in org.apache.commons.csv"><code>CSVRecord</code></a>, and + assumes that your CSV source does not contain a first record that also defines column names. + + If it does, then you are overriding this metadata with your names and you should skip the first record by calling + <a href="../../../../org/apache/commons/csv/CSVFormat.html#withSkipHeaderRecord-boolean-"><code>withSkipHeaderRecord(boolean)</code></a> with <code>true</code>. + </p> + + <h2>Parsing</h2> + + <p> + You can use a format directly to parse a reader. For example, to parse an Excel file with columns header, write: + </p> + + <pre> + Reader in = ...; + CSVFormat.EXCEL.withHeader("Col1", "Col2", "Col3").parse(in); + </pre> + + <p> + For other input types, like resources, files, and URLs, use the static methods on <a href="../../../../org/apache/commons/csv/CSVParser.html" title="class in org.apache.commons.csv"><code>CSVParser</code></a>. + </p> + + <h2>Referencing columns safely</h2> + + <p> + If your source contains a header record, you can simplify your code and safely reference columns, by using + <a href="../../../../org/apache/commons/csv/CSVFormat.html#withHeader-java.lang.String...-"><code>withHeader(String...)</code></a> with no arguments: + </p> + + <pre> + CSVFormat.EXCEL.withHeader(); + </pre> + + <p> + This causes the parser to read the first record and use its values as column names. + + Then, call one of the <a href="../../../../org/apache/commons/csv/CSVRecord.html" title="class in org.apache.commons.csv"><code>CSVRecord</code></a> get method that takes a String column name argument: + </p> + + <pre> + String value = record.get("Col1"); + </pre> + + <p> + This makes your code impervious to changes in column order in the CSV file. + </p> + + <h2>Notes</h2> + + <p> + This class is immutable. + </p></div> +<dl> +<dt><span class="simpleTagLabel">Version:</span></dt> +<dd>$Id$</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../../../serialized-form.html#org.apache.commons.csv.CSVFormat">Serialized Form</a></dd> +</dl> +</li> +</ul> +</div> +<div class="summary"> +<ul class="blockList"> +<li class="blockList"> +<!-- =========== FIELD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field.summary"> +<!-- --> +</a> +<h3>Field Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> +<caption><span>Fields</span><span class="tabEnd"> </span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Field and Description</th> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#DEFAULT">DEFAULT</a></span></code> +<div class="block">Standard comma separated format, as for <a href="../../../../org/apache/commons/csv/CSVFormat.html#RFC4180"><code>RFC4180</code></a> but allowing empty lines.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#EXCEL">EXCEL</a></span></code> +<div class="block">Excel file format (using a comma as the value delimiter).</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#MYSQL">MYSQL</a></span></code> +<div class="block">Default MySQL format used by the <code>SELECT INTO OUTFILE</code> and <code>LOAD DATA INFILE</code> operations.</div> +</td> +</tr> +<tr class="rowColor"> +<td class="colFirst"><code>static <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#RFC4180">RFC4180</a></span></code> +<div class="block">Comma separated format as defined by <a href="http://tools.ietf.org/html/rfc4180">RFC 4180</a>.</div> +</td> +</tr> +<tr class="altColor"> +<td class="colFirst"><code>static <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#TDF">TDF</a></span></code> +<div class="block">Tab-delimited format.</div> +</td> +</tr> +</table> +</li> +</ul> +<!-- ========== METHOD SUMMARY =========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.summary"> +<!-- --> +</a> +<h3>Method Summary</h3> +<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> +<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> +<tr> +<th class="colFirst" scope="col">Modifier and Type</th> +<th class="colLast" scope="col">Method and Description</th> +</tr> +<tr id="i0" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#equals-java.lang.Object-">equals</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> obj)</code> </td> +</tr> +<tr id="i1" class="rowColor"> +<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#format-java.lang.Object...-">format</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... values)</code> +<div class="block">Formats the specified values.</div> +</td> +</tr> +<tr id="i2" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getAllowMissingColumnNames--">getAllowMissingColumnNames</a></span>()</code> +<div class="block">Specifies whether missing column names are allowed when parsing the header line.</div> +</td> +</tr> +<tr id="i3" class="rowColor"> +<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getCommentMarker--">getCommentMarker</a></span>()</code> +<div class="block">Returns the character marking the start of a line comment.</div> +</td> +</tr> +<tr id="i4" class="altColor"> +<td class="colFirst"><code>char</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getDelimiter--">getDelimiter</a></span>()</code> +<div class="block">Returns the character delimiting the values (typically ';', ',' or '\t').</div> +</td> +</tr> +<tr id="i5" class="rowColor"> +<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getEscapeCharacter--">getEscapeCharacter</a></span>()</code> +<div class="block">Returns the escape character.</div> +</td> +</tr> +<tr id="i6" class="altColor"> +<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getHeader--">getHeader</a></span>()</code> +<div class="block">Returns a copy of the header array.</div> +</td> +</tr> +<tr id="i7" class="rowColor"> +<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getHeaderComments--">getHeaderComments</a></span>()</code> +<div class="block">Returns a copy of the header comment array.</div> +</td> +</tr> +<tr id="i8" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getIgnoreEmptyLines--">getIgnoreEmptyLines</a></span>()</code> +<div class="block">Specifies whether empty lines between records are ignored when parsing input.</div> +</td> +</tr> +<tr id="i9" class="rowColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getIgnoreSurroundingSpaces--">getIgnoreSurroundingSpaces</a></span>()</code> +<div class="block">Specifies whether spaces around values are ignored when parsing input.</div> +</td> +</tr> +<tr id="i10" class="altColor"> +<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getNullString--">getNullString</a></span>()</code> +<div class="block">Gets the String to convert to and from <code>null</code>.</div> +</td> +</tr> +<tr id="i11" class="rowColor"> +<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getQuoteCharacter--">getQuoteCharacter</a></span>()</code> +<div class="block">Returns the character used to encapsulate values containing special characters.</div> +</td> +</tr> +<tr id="i12" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/QuoteMode.html" title="enum in org.apache.commons.csv">QuoteMode</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getQuoteMode--">getQuoteMode</a></span>()</code> +<div class="block">Returns the quote policy output fields.</div> +</td> +</tr> +<tr id="i13" class="rowColor"> +<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getRecordSeparator--">getRecordSeparator</a></span>()</code> +<div class="block">Returns the record separator delimiting output records.</div> +</td> +</tr> +<tr id="i14" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#getSkipHeaderRecord--">getSkipHeaderRecord</a></span>()</code> +<div class="block">Returns whether to skip the header record.</div> +</td> +</tr> +<tr id="i15" class="rowColor"> +<td class="colFirst"><code>int</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#hashCode--">hashCode</a></span>()</code> </td> +</tr> +<tr id="i16" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#isCommentMarkerSet--">isCommentMarkerSet</a></span>()</code> +<div class="block">Specifies whether comments are supported by this format.</div> +</td> +</tr> +<tr id="i17" class="rowColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#isEscapeCharacterSet--">isEscapeCharacterSet</a></span>()</code> +<div class="block">Returns whether escape are being processed.</div> +</td> +</tr> +<tr id="i18" class="altColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#isNullStringSet--">isNullStringSet</a></span>()</code> +<div class="block">Returns whether a nullString has been defined.</div> +</td> +</tr> +<tr id="i19" class="rowColor"> +<td class="colFirst"><code>boolean</code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#isQuoteCharacterSet--">isQuoteCharacterSet</a></span>()</code> +<div class="block">Returns whether a quoteChar has been defined.</div> +</td> +</tr> +<tr id="i20" class="altColor"> +<td class="colFirst"><code>static <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#newFormat-char-">newFormat</a></span>(char delimiter)</code> +<div class="block">Creates a new CSV format with the specified delimiter.</div> +</td> +</tr> +<tr id="i21" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVParser.html" title="class in org.apache.commons.csv">CSVParser</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#parse-java.io.Reader-">parse</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</a> in)</code> +<div class="block">Parses the specified content.</div> +</td> +</tr> +<tr id="i22" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVPrinter.html" title="class in org.apache.commons.csv">CSVPrinter</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#print-java.lang.Appendable-">print</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</a> out)</code> +<div class="block">Prints to the specified output.</div> +</td> +</tr> +<tr id="i23" class="rowColor"> +<td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#toString--">toString</a></span>()</code> </td> +</tr> +<tr id="i24" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withAllowMissingColumnNames--">withAllowMissingColumnNames</a></span>()</code> +<div class="block">Sets the missing column names behavior of the format to <code>true</code></div> +</td> +</tr> +<tr id="i25" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withAllowMissingColumnNames-boolean-">withAllowMissingColumnNames</a></span>(boolean allowMissingColumnNames)</code> +<div class="block">Sets the missing column names behavior of the format.</div> +</td> +</tr> +<tr id="i26" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withCommentMarker-char-">withCommentMarker</a></span>(char commentMarker)</code> +<div class="block">Sets the comment start marker of the format to the specified character.</div> +</td> +</tr> +<tr id="i27" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withCommentMarker-java.lang.Character-">withCommentMarker</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a> commentMarker)</code> +<div class="block">Sets the comment start marker of the format to the specified character.</div> +</td> +</tr> +<tr id="i28" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withDelimiter-char-">withDelimiter</a></span>(char delimiter)</code> +<div class="block">Sets the delimiter of the format to the specified character.</div> +</td> +</tr> +<tr id="i29" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withEscape-char-">withEscape</a></span>(char escape)</code> +<div class="block">Sets the escape character of the format to the specified character.</div> +</td> +</tr> +<tr id="i30" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withEscape-java.lang.Character-">withEscape</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a> escape)</code> +<div class="block">Sets the escape character of the format to the specified character.</div> +</td> +</tr> +<tr id="i31" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withHeader-java.sql.ResultSet-">withHeader</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html?is-external=true" title="class or interface in java.sql">ResultSet</a> resultSet)</code> +<div class="block">Sets the header of the format.</div> +</td> +</tr> +<tr id="i32" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withHeader-java.sql.ResultSetMetaData-">withHeader</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSetMetaData.html?is-external=true" title="class or interface in java.sql">ResultSetMetaData</a> metaData)</code> +<div class="block">Sets the header of the format.</div> +</td> +</tr> +<tr id="i33" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withHeader-java.lang.String...-">withHeader</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>... header)</code> +<div class="block">Sets the header of the format.</div> +</td> +</tr> +<tr id="i34" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withHeaderComments-java.lang.Object...-">withHeaderComments</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... headerComments)</code> +<div class="block">Sets the header comments of the format.</div> +</td> +</tr> +<tr id="i35" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withIgnoreEmptyLines--">withIgnoreEmptyLines</a></span>()</code> +<div class="block">Sets the empty line skipping behavior of the format to <code>true</code>.</div> +</td> +</tr> +<tr id="i36" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withIgnoreEmptyLines-boolean-">withIgnoreEmptyLines</a></span>(boolean ignoreEmptyLines)</code> +<div class="block">Sets the empty line skipping behavior of the format.</div> +</td> +</tr> +<tr id="i37" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withIgnoreSurroundingSpaces--">withIgnoreSurroundingSpaces</a></span>()</code> +<div class="block">Sets the trimming behavior of the format to <code>true</code>.</div> +</td> +</tr> +<tr id="i38" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withIgnoreSurroundingSpaces-boolean-">withIgnoreSurroundingSpaces</a></span>(boolean ignoreSurroundingSpaces)</code> +<div class="block">Sets the trimming behavior of the format.</div> +</td> +</tr> +<tr id="i39" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withNullString-java.lang.String-">withNullString</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> nullString)</code> +<div class="block">Performs conversions to and from null for strings on input and output.</div> +</td> +</tr> +<tr id="i40" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withQuote-char-">withQuote</a></span>(char quoteChar)</code> +<div class="block">Sets the quoteChar of the format to the specified character.</div> +</td> +</tr> +<tr id="i41" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withQuote-java.lang.Character-">withQuote</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a> quoteChar)</code> +<div class="block">Sets the quoteChar of the format to the specified character.</div> +</td> +</tr> +<tr id="i42" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withQuoteMode-org.apache.commons.csv.QuoteMode-">withQuoteMode</a></span>(<a href="../../../../org/apache/commons/csv/QuoteMode.html" title="enum in org.apache.commons.csv">QuoteMode</a> quoteModePolicy)</code> +<div class="block">Sets the output quote policy of the format to the specified value.</div> +</td> +</tr> +<tr id="i43" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withRecordSeparator-char-">withRecordSeparator</a></span>(char recordSeparator)</code> +<div class="block">Sets the record separator of the format to the specified character.</div> +</td> +</tr> +<tr id="i44" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withRecordSeparator-java.lang.String-">withRecordSeparator</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> recordSeparator)</code> +<div class="block">Sets the record separator of the format to the specified String.</div> +</td> +</tr> +<tr id="i45" class="rowColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withSkipHeaderRecord--">withSkipHeaderRecord</a></span>()</code> +<div class="block">Sets skipping the header record to <code>true</code>.</div> +</td> +</tr> +<tr id="i46" class="altColor"> +<td class="colFirst"><code><a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a></code></td> +<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/commons/csv/CSVFormat.html#withSkipHeaderRecord-boolean-">withSkipHeaderRecord</a></span>(boolean skipHeaderRecord)</code> +<div class="block">Sets whether to skip the header record.</div> +</td> +</tr> +</table> +<ul class="blockList"> +<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> +<!-- --> +</a> +<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> +<code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-ex ternal=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +<div class="details"> +<ul class="blockList"> +<li class="blockList"> +<!-- ============ FIELD DETAIL =========== --> +<ul class="blockList"> +<li class="blockList"><a name="field.detail"> +<!-- --> +</a> +<h3>Field Detail</h3> +<a name="DEFAULT"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>DEFAULT</h4> +<pre>public static final <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.179">DEFAULT</a></pre> +<div class="block">Standard comma separated format, as for <a href="../../../../org/apache/commons/csv/CSVFormat.html#RFC4180"><code>RFC4180</code></a> but allowing empty lines. + + <p> + Settings are: + </p> + <ul> + <li>withDelimiter(',')</li> + <li>withQuote('"')</li> + <li>withRecordSeparator("\r\n")</li> + <li>withIgnoreEmptyLines(true)</li> + </ul></div> +</li> +</ul> +<a name="RFC4180"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>RFC4180</h4> +<pre>public static final <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.195">RFC4180</a></pre> +<div class="block">Comma separated format as defined by <a href="http://tools.ietf.org/html/rfc4180">RFC 4180</a>. + + <p> + Settings are: + </p> + <ul> + <li>withDelimiter(',')</li> + <li>withQuote('"')</li> + <li>withRecordSeparator("\r\n")</li> + <li>withIgnoreEmptyLines(false)</li> + </ul></div> +</li> +</ul> +<a name="EXCEL"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>EXCEL</h4> +<pre>public static final <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.224">EXCEL</a></pre> +<div class="block">Excel file format (using a comma as the value delimiter). Note that the actual value delimiter used by Excel is + locale dependent, it might be necessary to customize this format to accommodate to your regional settings. + + <p> + For example for parsing or generating a CSV file on a French system the following format will be used: + </p> + + <pre> + CSVFormat fmt = CSVFormat.EXCEL.withDelimiter(';'); + </pre> + + <p> + Settings are: + </p> + <ul> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#withDelimiter-char-"><code>withDelimiter(',')</code></a></li> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#withQuote-char-"><code>withQuote('"')</code></a></li> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#withRecordSeparator-java.lang.String-"><code>withRecordSeparator("\r\n")</code></a></li> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#withIgnoreEmptyLines-boolean-"><code>withIgnoreEmptyLines(false)</code></a></li> + <li><a href="../../../../org/apache/commons/csv/CSVFormat.html#withAllowMissingColumnNames-boolean-"><code>withAllowMissingColumnNames(true)</code></a></li> + </ul> + <p> + Note: this is currently like <a href="../../../../org/apache/commons/csv/CSVFormat.html#RFC4180"><code>RFC4180</code></a> plus <a href="../../../../org/apache/commons/csv/CSVFormat.html#withAllowMissingColumnNames-boolean-"><code>withAllowMissingColumnNames(true)</code></a>. + </p></div> +</li> +</ul> +<a name="TDF"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>TDF</h4> +<pre>public static final <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.239">TDF</a></pre> +<div class="block">Tab-delimited format. + + <p> + Settings are: + </p> + <ul> + <li>withDelimiter('\t')</li> + <li>withQuote('"')</li> + <li>withRecordSeparator("\r\n")</li> + <li>withIgnoreSurroundingSpaces(true)</li> + </ul></div> +</li> +</ul> +<a name="MYSQL"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>MYSQL</h4> +<pre>public static final <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.263">MYSQL</a></pre> +<div class="block">Default MySQL format used by the <code>SELECT INTO OUTFILE</code> and <code>LOAD DATA INFILE</code> operations. + + <p> + This is a tab-delimited format with a LF character as the line separator. Values are not quoted and special + characters are escaped with '\'. + </p> + + <p> + Settings are: + </p> + <ul> + <li>withDelimiter('\t')</li> + <li>withQuote(null)</li> + <li>withRecordSeparator('\n')</li> + <li>withIgnoreEmptyLines(false)</li> + <li>withEscape('\\')</li> + </ul></div> +<dl> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="http://dev.mysql.com/doc/refman/5.1/en/load-data.html"> + http://dev.mysql.com/doc/refman/5.1/en/load-data.html</a></dd> +</dl> +</li> +</ul> +</li> +</ul> +<!-- ============ METHOD DETAIL ========== --> +<ul class="blockList"> +<li class="blockList"><a name="method.detail"> +<!-- --> +</a> +<h3>Method Detail</h3> +<a name="newFormat-char-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>newFormat</h4> +<pre>public static <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.310">newFormat</a>(char delimiter)</pre> +<div class="block">Creates a new CSV format with the specified delimiter. + + <p> + Use this method if you want to create a CSVFormat from scratch. All fields but the delimiter will be initialized + with null/false. + </p></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>delimiter</code> - the char used for value separation, must not be a line break character</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>a new CSV format.</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the delimiter is a line break character</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../../../org/apache/commons/csv/CSVFormat.html#DEFAULT"><code>DEFAULT</code></a>, +<a href="../../../../org/apache/commons/csv/CSVFormat.html#RFC4180"><code>RFC4180</code></a>, +<a href="../../../../org/apache/commons/csv/CSVFormat.html#MYSQL"><code>MYSQL</code></a>, +<a href="../../../../org/apache/commons/csv/CSVFormat.html#EXCEL"><code>EXCEL</code></a>, +<a href="../../../../org/apache/commons/csv/CSVFormat.html#TDF"><code>TDF</code></a></dd> +</dl> +</li> +</ul> +<a name="equals-java.lang.Object-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>equals</h4> +<pre>public boolean <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.380">equals</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> obj)</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a></code> in class <code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> +</dl> +</li> +</ul> +<a name="format-java.lang.Object...-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>format</h4> +<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.455">format</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... values)</pre> +<div class="block">Formats the specified values.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>values</code> - the values to format</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>the formatted values</dd> +</dl> +</li> +</ul> +<a name="getCommentMarker--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getCommentMarker</h4> +<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.471">getCommentMarker</a>()</pre> +<div class="block">Returns the character marking the start of a line comment.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>the comment start marker, may be <code>null</code></dd> +</dl> +</li> +</ul> +<a name="getDelimiter--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getDelimiter</h4> +<pre>public char <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.480">getDelimiter</a>()</pre> +<div class="block">Returns the character delimiting the values (typically ';', ',' or '\t').</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>the delimiter character</dd> +</dl> +</li> +</ul> +<a name="getEscapeCharacter--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getEscapeCharacter</h4> +<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.489">getEscapeCharacter</a>()</pre> +<div class="block">Returns the escape character.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>the escape character, may be <code>null</code></dd> +</dl> +</li> +</ul> +<a name="getHeader--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getHeader</h4> +<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.498">getHeader</a>()</pre> +<div class="block">Returns a copy of the header array.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>a copy of the header array; <code>null</code> if disabled, the empty array if to be read from the file</dd> +</dl> +</li> +</ul> +<a name="getHeaderComments--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getHeaderComments</h4> +<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.507">getHeaderComments</a>()</pre> +<div class="block">Returns a copy of the header comment array.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>a copy of the header comment array; <code>null</code> if disabled.</dd> +</dl> +</li> +</ul> +<a name="getAllowMissingColumnNames--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getAllowMissingColumnNames</h4> +<pre>public boolean <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.517">getAllowMissingColumnNames</a>()</pre> +<div class="block">Specifies whether missing column names are allowed when parsing the header line.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd><code>true</code> if missing column names are allowed when parsing the header line, <code>false</code> to throw an + <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang"><code>IllegalArgumentException</code></a>.</dd> +</dl> +</li> +</ul> +<a name="getIgnoreEmptyLines--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getIgnoreEmptyLines</h4> +<pre>public boolean <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.527">getIgnoreEmptyLines</a>()</pre> +<div class="block">Specifies whether empty lines between records are ignored when parsing input.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd><code>true</code> if empty lines between records are ignored, <code>false</code> if they are turned into empty + records.</dd> +</dl> +</li> +</ul> +<a name="getIgnoreSurroundingSpaces--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getIgnoreSurroundingSpaces</h4> +<pre>public boolean <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.536">getIgnoreSurroundingSpaces</a>()</pre> +<div class="block">Specifies whether spaces around values are ignored when parsing input.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd><code>true</code> if spaces around values are ignored, <code>false</code> if they are treated as part of the value.</dd> +</dl> +</li> +</ul> +<a name="getNullString--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getNullString</h4> +<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.552">getNullString</a>()</pre> +<div class="block">Gets the String to convert to and from <code>null</code>. + <ul> + <li> + <strong>Reading:</strong> Converts strings equal to the given <code>nullString</code> to <code>null</code> when reading + records.</li> + <li> + <strong>Writing:</strong> Writes <code>null</code> as the given <code>nullString</code> when writing records.</li> + </ul></div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>the String to convert to and from <code>null</code>. No substitution occurs if <code>null</code></dd> +</dl> +</li> +</ul> +<a name="getQuoteCharacter--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getQuoteCharacter</h4> +<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.561">getQuoteCharacter</a>()</pre> +<div class="block">Returns the character used to encapsulate values containing special characters.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>the quoteChar character, may be <code>null</code></dd> +</dl> +</li> +</ul> +<a name="getQuoteMode--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getQuoteMode</h4> +<pre>public <a href="../../../../org/apache/commons/csv/QuoteMode.html" title="enum in org.apache.commons.csv">QuoteMode</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.570">getQuoteMode</a>()</pre> +<div class="block">Returns the quote policy output fields.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>the quote policy</dd> +</dl> +</li> +</ul> +<a name="getRecordSeparator--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getRecordSeparator</h4> +<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.579">getRecordSeparator</a>()</pre> +<div class="block">Returns the record separator delimiting output records.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>the record separator</dd> +</dl> +</li> +</ul> +<a name="getSkipHeaderRecord--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>getSkipHeaderRecord</h4> +<pre>public boolean <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.588">getSkipHeaderRecord</a>()</pre> +<div class="block">Returns whether to skip the header record.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>whether to skip the header record.</dd> +</dl> +</li> +</ul> +<a name="hashCode--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>hashCode</h4> +<pre>public int <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.593">hashCode</a>()</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a></code> in class <code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> +</dl> +</li> +</ul> +<a name="isCommentMarkerSet--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>isCommentMarkerSet</h4> +<pre>public boolean <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.618">isCommentMarkerSet</a>()</pre> +<div class="block">Specifies whether comments are supported by this format. + + Note that the comment introducer character is only recognized at the start of a line.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd><code>true</code> is comments are supported, <code>false</code> otherwise</dd> +</dl> +</li> +</ul> +<a name="isEscapeCharacterSet--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>isEscapeCharacterSet</h4> +<pre>public boolean <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.627">isEscapeCharacterSet</a>()</pre> +<div class="block">Returns whether escape are being processed.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd><code>true</code> if escapes are processed</dd> +</dl> +</li> +</ul> +<a name="isNullStringSet--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>isNullStringSet</h4> +<pre>public boolean <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.636">isNullStringSet</a>()</pre> +<div class="block">Returns whether a nullString has been defined.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd><code>true</code> if a nullString is defined</dd> +</dl> +</li> +</ul> +<a name="isQuoteCharacterSet--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>isQuoteCharacterSet</h4> +<pre>public boolean <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.645">isQuoteCharacterSet</a>()</pre> +<div class="block">Returns whether a quoteChar has been defined.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd><code>true</code> if a quoteChar is defined</dd> +</dl> +</li> +</ul> +<a name="parse-java.io.Reader-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>parse</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVParser.html" title="class in org.apache.commons.csv">CSVParser</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.662">parse</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</a> in) + throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre> +<div class="block">Parses the specified content. + + <p> + See also the various static parse methods on <a href="../../../../org/apache/commons/csv/CSVParser.html" title="class in org.apache.commons.csv"><code>CSVParser</code></a>. + </p></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>in</code> - the input stream</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>a parser over a stream of <a href="../../../../org/apache/commons/csv/CSVRecord.html" title="class in org.apache.commons.csv"><code>CSVRecord</code></a>s.</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - If an I/O error occurs</dd> +</dl> +</li> +</ul> +<a name="print-java.lang.Appendable-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>print</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVPrinter.html" title="class in org.apache.commons.csv">CSVPrinter</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.679">print</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Appendable.html?is-external=true" title="class or interface in java.lang">Appendable</a> out) + throws <a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre> +<div class="block">Prints to the specified output. + + <p> + See also <a href="../../../../org/apache/commons/csv/CSVPrinter.html" title="class in org.apache.commons.csv"><code>CSVPrinter</code></a>. + </p></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>out</code> - the output</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>a printer to an output</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - thrown if the optional header cannot be printed.</dd> +</dl> +</li> +</ul> +<a name="toString--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>toString</h4> +<pre>public <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.684">toString</a>()</pre> +<dl> +<dt><span class="overrideSpecifyLabel">Overrides:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code> in class <code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> +</dl> +</li> +</ul> +<a name="withCommentMarker-char-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withCommentMarker</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.787">withCommentMarker</a>(char commentMarker)</pre> +<div class="block">Sets the comment start marker of the format to the specified character. + + Note that the comment start character is only recognized at the start of a line.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>commentMarker</code> - the comment start marker</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this one but with the specified character as the comment start marker</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - thrown if the specified character is a line break</dd> +</dl> +</li> +</ul> +<a name="withCommentMarker-java.lang.Character-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withCommentMarker</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.802">withCommentMarker</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a> commentMarker)</pre> +<div class="block">Sets the comment start marker of the format to the specified character. + + Note that the comment start character is only recognized at the start of a line.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>commentMarker</code> - the comment start marker, use <code>null</code> to disable</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this one but with the specified character as the comment start marker</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - thrown if the specified character is a line break</dd> +</dl> +</li> +</ul> +<a name="withDelimiter-char-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withDelimiter</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.820">withDelimiter</a>(char delimiter)</pre> +<div class="block">Sets the delimiter of the format to the specified character.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>delimiter</code> - the delimiter character</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this with the specified character as delimiter</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - thrown if the specified character is a line break</dd> +</dl> +</li> +</ul> +<a name="withEscape-char-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withEscape</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.838">withEscape</a>(char escape)</pre> +<div class="block">Sets the escape character of the format to the specified character.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>escape</code> - the escape character</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to his but with the specified character as the escape character</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - thrown if the specified character is a line break</dd> +</dl> +</li> +</ul> +<a name="withEscape-java.lang.Character-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withEscape</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.851">withEscape</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a> escape)</pre> +<div class="block">Sets the escape character of the format to the specified character.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>escape</code> - the escape character, use <code>null</code> to disable</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified character as the escape character</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - thrown if the specified character is a line break</dd> +</dl> +</li> +</ul> +<a name="withHeader-java.lang.String...-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withHeader</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.881">withHeader</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>... header)</pre> +<div class="block">Sets the header of the format. The header can either be parsed automatically from the input file with: + + <pre> + CSVFormat format = aformat.withHeader(); + </pre> + + or specified manually with: + + <pre> + CSVFormat format = aformat.withHeader("name", "email", "phone"); + </pre> + <p> + The header is also used by the <a href="../../../../org/apache/commons/csv/CSVPrinter.html" title="class in org.apache.commons.csv"><code>CSVPrinter</code></a>.. + </p></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>header</code> - the header, <code>null</code> if disabled, empty if parsed automatically, user specified otherwise.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified header</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../../../org/apache/commons/csv/CSVFormat.html#withSkipHeaderRecord-boolean-"><code>withSkipHeaderRecord(boolean)</code></a></dd> +</dl> +</li> +</ul> +<a name="withHeader-java.sql.ResultSet-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withHeader</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.912">withHeader</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html?is-external=true" title="class or interface in java.sql">ResultSet</a> resultSet) + throws <a href="http://docs.oracle.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</a></pre> +<div class="block">Sets the header of the format. The header can either be parsed automatically from the input file with: + + <pre> + CSVFormat format = aformat.withHeader(); + </pre> + + or specified manually with: + + <pre> + CSVFormat format = aformat.withHeader(resultSet); + </pre> + <p> + The header is also used by the <a href="../../../../org/apache/commons/csv/CSVPrinter.html" title="class in org.apache.commons.csv"><code>CSVPrinter</code></a>.. + </p></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>resultSet</code> - the resultSet for the header, <code>null</code> if disabled, empty if parsed automatically, user specified + otherwise.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified header</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</a></code> - SQLException if a database access error occurs or this method is called on a closed result set.</dd> +<dt><span class="simpleTagLabel">Since:</span></dt> +<dd>1.1</dd> +</dl> +</li> +</ul> +<a name="withHeader-java.sql.ResultSetMetaData-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withHeader</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.941">withHeader</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSetMetaData.html?is-external=true" title="class or interface in java.sql">ResultSetMetaData</a> metaData) + throws <a href="http://docs.oracle.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</a></pre> +<div class="block">Sets the header of the format. The header can either be parsed automatically from the input file with: + + <pre> + CSVFormat format = aformat.withHeader(); + </pre> + + or specified manually with: + + <pre> + CSVFormat format = aformat.withHeader(metaData); + </pre> + <p> + The header is also used by the <a href="../../../../org/apache/commons/csv/CSVPrinter.html" title="class in org.apache.commons.csv"><code>CSVPrinter</code></a>.. + </p></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>metaData</code> - the metaData for the header, <code>null</code> if disabled, empty if parsed automatically, user specified + otherwise.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified header</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</a></code> - SQLException if a database access error occurs or this method is called on a closed result set.</dd> +<dt><span class="simpleTagLabel">Since:</span></dt> +<dd>1.1</dd> +</dl> +</li> +</ul> +<a name="withHeaderComments-java.lang.Object...-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withHeaderComments</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.970">withHeaderComments</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... headerComments)</pre> +<div class="block">Sets the header comments of the format. The comments will be printed first, before the headers. This setting is + ignored by the parser. + + <pre> + CSVFormat format = aformat.withHeaderComments("Generated by Apache Commons CSV 1.1.", new Date()); + </pre></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>headerComments</code> - the headerComments which will be printed by the Printer before the actual CSV data.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified header</dd> +<dt><span class="simpleTagLabel">Since:</span></dt> +<dd>1.1</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../../../org/apache/commons/csv/CSVFormat.html#withSkipHeaderRecord-boolean-"><code>withSkipHeaderRecord(boolean)</code></a></dd> +</dl> +</li> +</ul> +<a name="withAllowMissingColumnNames--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withAllowMissingColumnNames</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.983">withAllowMissingColumnNames</a>()</pre> +<div class="block">Sets the missing column names behavior of the format to <code>true</code></div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified missing column names behavior.</dd> +<dt><span class="simpleTagLabel">Since:</span></dt> +<dd>1.1</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../../../org/apache/commons/csv/CSVFormat.html#withAllowMissingColumnNames-boolean-"><code>withAllowMissingColumnNames(boolean)</code></a></dd> +</dl> +</li> +</ul> +<a name="withAllowMissingColumnNames-boolean-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withAllowMissingColumnNames</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.995">withAllowMissingColumnNames</a>(boolean allowMissingColumnNames)</pre> +<div class="block">Sets the missing column names behavior of the format.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>allowMissingColumnNames</code> - the missing column names behavior, <code>true</code> to allow missing column names in the header line, + <code>false</code> to cause an <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang"><code>IllegalArgumentException</code></a> to be thrown.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified missing column names behavior.</dd> +</dl> +</li> +</ul> +<a name="withIgnoreEmptyLines--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withIgnoreEmptyLines</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1008">withIgnoreEmptyLines</a>()</pre> +<div class="block">Sets the empty line skipping behavior of the format to <code>true</code>.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified empty line skipping behavior.</dd> +<dt><span class="simpleTagLabel">Since:</span></dt> +<dd><a href="../../../../org/apache/commons/csv/CSVFormat.html#withIgnoreEmptyLines-boolean-"><code>withIgnoreEmptyLines(boolean)</code></a>, 1.1</dd> +</dl> +</li> +</ul> +<a name="withIgnoreEmptyLines-boolean-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withIgnoreEmptyLines</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1020">withIgnoreEmptyLines</a>(boolean ignoreEmptyLines)</pre> +<div class="block">Sets the empty line skipping behavior of the format.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>ignoreEmptyLines</code> - the empty line skipping behavior, <code>true</code> to ignore the empty lines between the records, + <code>false</code> to translate empty lines to empty records.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified empty line skipping behavior.</dd> +</dl> +</li> +</ul> +<a name="withIgnoreSurroundingSpaces--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withIgnoreSurroundingSpaces</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1033">withIgnoreSurroundingSpaces</a>()</pre> +<div class="block">Sets the trimming behavior of the format to <code>true</code>.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified trimming behavior.</dd> +<dt><span class="simpleTagLabel">Since:</span></dt> +<dd>1.1</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../../../org/apache/commons/csv/CSVFormat.html#withIgnoreSurroundingSpaces-boolean-"><code>withIgnoreSurroundingSpaces(boolean)</code></a></dd> +</dl> +</li> +</ul> +<a name="withIgnoreSurroundingSpaces-boolean-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withIgnoreSurroundingSpaces</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1045">withIgnoreSurroundingSpaces</a>(boolean ignoreSurroundingSpaces)</pre> +<div class="block">Sets the trimming behavior of the format.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>ignoreSurroundingSpaces</code> - the trimming behavior, <code>true</code> to remove the surrounding spaces, <code>false</code> to leave the + spaces as is.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified trimming behavior.</dd> +</dl> +</li> +</ul> +<a name="withNullString-java.lang.String-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withNullString</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1066">withNullString</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> nullString)</pre> +<div class="block">Performs conversions to and from null for strings on input and output. + <ul> + <li> + <strong>Reading:</strong> Converts strings equal to the given <code>nullString</code> to <code>null</code> when reading + records.</li> + <li> + <strong>Writing:</strong> Writes <code>null</code> as the given <code>nullString</code> when writing records.</li> + </ul></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>nullString</code> - the String to convert to and from <code>null</code>. No substitution occurs if <code>null</code></dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified null conversion string.</dd> +</dl> +</li> +</ul> +<a name="withQuote-char-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withQuote</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1081">withQuote</a>(char quoteChar)</pre> +<div class="block">Sets the quoteChar of the format to the specified character.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>quoteChar</code> - the quoteChar character</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified character as quoteChar</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - thrown if the specified character is a line break</dd> +</dl> +</li> +</ul> +<a name="withQuote-java.lang.Character-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withQuote</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1094">withQuote</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Character.html?is-external=true" title="class or interface in java.lang">Character</a> quoteChar)</pre> +<div class="block">Sets the quoteChar of the format to the specified character.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>quoteChar</code> - the quoteChar character, use <code>null</code> to disable</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified character as quoteChar</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - thrown if the specified character is a line break</dd> +</dl> +</li> +</ul> +<a name="withQuoteMode-org.apache.commons.csv.QuoteMode-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withQuoteMode</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1110">withQuoteMode</a>(<a href="../../../../org/apache/commons/csv/QuoteMode.html" title="enum in org.apache.commons.csv">QuoteMode</a> quoteModePolicy)</pre> +<div class="block">Sets the output quote policy of the format to the specified value.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>quoteModePolicy</code> - the quote policy to use for output.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the specified quote policy</dd> +</dl> +</li> +</ul> +<a name="withRecordSeparator-char-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withRecordSeparator</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1129">withRecordSeparator</a>(char recordSeparator)</pre> +<div class="block">Sets the record separator of the format to the specified character. + + <p> + <strong>Note:</strong> This setting is only used during printing and does not affect parsing. Parsing currently + only works for inputs with '\n', '\r' and "\r\n" + </p></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>recordSeparator</code> - the record separator to use for output.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the the specified output record separator</dd> +</dl> +</li> +</ul> +<a name="withRecordSeparator-java.lang.String-"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withRecordSeparator</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1148">withRecordSeparator</a>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> recordSeparator)</pre> +<div class="block">Sets the record separator of the format to the specified String. + + <p> + <strong>Note:</strong> This setting is only used during printing and does not affect parsing. Parsing currently + only works for inputs with '\n', '\r' and "\r\n" + </p></div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>recordSeparator</code> - the record separator to use for output.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the the specified output record separator</dd> +<dt><span class="throwsLabel">Throws:</span></dt> +<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if recordSeparator is none of CR, LF or CRLF</dd> +</dl> +</li> +</ul> +<a name="withSkipHeaderRecord--"> +<!-- --> +</a> +<ul class="blockList"> +<li class="blockList"> +<h4>withSkipHeaderRecord</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1162">withSkipHeaderRecord</a>()</pre> +<div class="block">Sets skipping the header record to <code>true</code>.</div> +<dl> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the the specified skipHeaderRecord setting.</dd> +<dt><span class="simpleTagLabel">Since:</span></dt> +<dd>1.1</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../../../org/apache/commons/csv/CSVFormat.html#withSkipHeaderRecord-boolean-"><code>withSkipHeaderRecord(boolean)</code></a>, +<a href="../../../../org/apache/commons/csv/CSVFormat.html#withHeader-java.lang.String...-"><code>withHeader(String...)</code></a></dd> +</dl> +</li> +</ul> +<a name="withSkipHeaderRecord-boolean-"> +<!-- --> +</a> +<ul class="blockListLast"> +<li class="blockList"> +<h4>withSkipHeaderRecord</h4> +<pre>public <a href="../../../../org/apache/commons/csv/CSVFormat.html" title="class in org.apache.commons.csv">CSVFormat</a> <a href="../../../../src-html/org/apache/commons/csv/CSVFormat.html#line.1175">withSkipHeaderRecord</a>(boolean skipHeaderRecord)</pre> +<div class="block">Sets whether to skip the header record.</div> +<dl> +<dt><span class="paramLabel">Parameters:</span></dt> +<dd><code>skipHeaderRecord</code> - whether to skip the header record.</dd> +<dt><span class="returnLabel">Returns:</span></dt> +<dd>A new CSVFormat that is equal to this but with the the specified skipHeaderRecord setting.</dd> +<dt><span class="seeLabel">See Also:</span></dt> +<dd><a href="../../../../org/apache/commons/csv/CSVFormat.html#withHeader-java.lang.String...-"><code>withHeader(String...)</code></a></dd> +</dl> +</li> +</ul> +</li> +</ul> +</li> +</ul> +</div> +</div> +<!-- ========= END OF CLASS DATA ========= --> +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<div class="bottomNav"><a name="navbar.bottom"> +<!-- --> +</a> +<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> +<a name="navbar.bottom.firstrow"> +<!-- --> +</a> +<ul class="navList" title="Navigation"> +<li><a href="../../../../org/apache/commons/csv/package-summary.html">Package</a></li> +<li class="navBarCell1Rev">Class</li> +<li><a href="class-use/CSVFormat.html">Use</a></li> +<li><a href="package-tree.html">Tree</a></li> +<li><a href="../../../../deprecated-list.html">Deprecated</a></li> +<li><a href="../../../../index-all.html">Index</a></li> +<li><a href="../../../../help-doc.html">Help</a></li> +</ul> +</div> +<div class="subNav"> +<ul class="navList"> +<li>Prev Class</li> +<li><a href="../../../../org/apache/commons/csv/CSVParser.html" title="class in org.apache.commons.csv"><span class="typeNameLink">Next Class</span></a></li> +</ul> +<ul class="navList"> +<li><a href="../../../../index.html?org/apache/commons/csv/CSVFormat.html" target="_top">Frames</a></li> +<li><a href="CSVFormat.html" target="_top">No Frames</a></li> +</ul> +<ul class="navList" id="allclasses_navbar_bottom"> +<li><a href="../../../../allclasses-noframe.html">All Classes</a></li> +</ul> +<div> +<script type="text/javascript"><!-- + allClassesLink = document.getElementById("allclasses_navbar_bottom"); + if(window==top) { + allClassesLink.style.display = "block"; + } + else { + allClassesLink.style.display = "none"; + } + //-->
[... 25 lines stripped ...]