@@ -91,23 +91,19 @@ public final class CSVPrinter implements Flushable, Closeable {
91
91
/**
92
92
* Creates a printer that will print values to the given stream following the CSVFormat.
93
93
* <p>
94
- * Currently, only a pure encapsulation format or a pure escaping format is supported. Hybrid formats (encapsulation
95
- * and escaping with a different character) are not supported.
94
+ * Currently, only a pure encapsulation format or a pure escaping format is supported. Hybrid formats (encapsulation and escaping with a different
95
+ * character) are not supported.
96
96
* </p>
97
97
*
98
- * @param appendable
99
- * stream to which to print. Must not be null.
100
- * @param format
101
- * the CSV format. Must not be null.
102
- * @throws IOException
103
- * thrown if the optional header cannot be printed.
104
- * @throws IllegalArgumentException
105
- * thrown if the parameters of the format are inconsistent or if either out or format are null.
98
+ * @param appendable stream to which to print. Must not be null.
99
+ * @param format the CSV format. Must not be null.
100
+ * @throws IOException thrown if the optional header cannot be printed.
101
+ * @throws IllegalArgumentException thrown if the parameters of the format are inconsistent.
102
+ * @throws NullPointerException thrown if either parameters are null.
106
103
*/
107
104
public CSVPrinter (final Appendable appendable , final CSVFormat format ) throws IOException {
108
105
Objects .requireNonNull (appendable , "appendable" );
109
106
Objects .requireNonNull (format , "format" );
110
-
111
107
this .appendable = appendable ;
112
108
this .format = format .copy ();
113
109
// TODO: Is it a good idea to do this here instead of on the first call to a print method?
@@ -130,10 +126,12 @@ public void close() throws IOException {
130
126
131
127
/**
132
128
* Closes the underlying stream with an optional flush first.
129
+ *
133
130
* @param flush whether to flush before the actual close.
134
131
* @throws IOException
135
132
* If an I/O error occurs
136
133
* @since 1.6
134
+ * @see CSVFormat#getAutoFlush()
137
135
*/
138
136
public void close (final boolean flush ) throws IOException {
139
137
if (flush || format .getAutoFlush ()) {
@@ -145,7 +143,7 @@ public void close(final boolean flush) throws IOException {
145
143
}
146
144
147
145
/**
148
- * Outputs the record separator and increments the record count.
146
+ * Prints the record separator and increments the record count.
149
147
*
150
148
* @throws IOException
151
149
* If an I/O error occurs
@@ -174,7 +172,7 @@ public void flush() throws IOException {
174
172
* @return the target Appendable.
175
173
*/
176
174
public Appendable getOut () {
177
- return this . appendable ;
175
+ return appendable ;
178
176
}
179
177
180
178
/**
@@ -267,7 +265,7 @@ public synchronized void printHeaders(final ResultSet resultSet) throws IOExcept
267
265
}
268
266
269
267
/**
270
- * Outputs the record separator.
268
+ * Prints the record separator.
271
269
*
272
270
* @throws IOException
273
271
* If an I/O error occurs
0 commit comments