Skip to content

Commit 3916442

Browse files
committed
Javadoc
1 parent 04cf4ee commit 3916442

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

src/main/java/org/apache/commons/csv/CSVFormat.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ public synchronized void printRecord(final Appendable appendable, final Object..
23152315
}
23162316

23172317
/*
2318-
* Note: Must only be called if escaping is enabled, otherwise can throw exceptions.
2318+
* This method must only be called if escaping is enabled, otherwise can throw exceptions.
23192319
*/
23202320
private void printWithEscapes(final CharSequence charSeq, final Appendable appendable) throws IOException {
23212321
int start = 0;
@@ -2358,7 +2358,7 @@ private void printWithEscapes(final CharSequence charSeq, final Appendable appen
23582358
}
23592359

23602360
/*
2361-
* Note: Must only be called if escaping is enabled, otherwise can throw exceptions.
2361+
* This method must only be called if escaping is enabled, otherwise can throw exceptions.
23622362
*/
23632363
private void printWithEscapes(final Reader reader, final Appendable appendable) throws IOException {
23642364
int start = 0;
@@ -2408,9 +2408,9 @@ private void printWithEscapes(final Reader reader, final Appendable appendable)
24082408
}
24092409

24102410
/*
2411-
* Note: must only be called if quoting is enabled, otherwise will generate NPE
2411+
* This method must only be called if quoting is enabled, otherwise will generate NPE.
2412+
* The original object is needed so can check for Number
24122413
*/
2413-
// the original object is needed so can check for Number
24142414
private void printWithQuotes(final Object object, final CharSequence charSeq, final Appendable out, final boolean newRecord) throws IOException {
24152415
boolean quote = false;
24162416
int start = 0;

src/main/java/org/apache/commons/csv/CSVPrinter.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,19 @@ public final class CSVPrinter implements Flushable, Closeable {
9191
/**
9292
* Creates a printer that will print values to the given stream following the CSVFormat.
9393
* <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.
9696
* </p>
9797
*
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.
106103
*/
107104
public CSVPrinter(final Appendable appendable, final CSVFormat format) throws IOException {
108105
Objects.requireNonNull(appendable, "appendable");
109106
Objects.requireNonNull(format, "format");
110-
111107
this.appendable = appendable;
112108
this.format = format.copy();
113109
// 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 {
130126

131127
/**
132128
* Closes the underlying stream with an optional flush first.
129+
*
133130
* @param flush whether to flush before the actual close.
134131
* @throws IOException
135132
* If an I/O error occurs
136133
* @since 1.6
134+
* @see CSVFormat#getAutoFlush()
137135
*/
138136
public void close(final boolean flush) throws IOException {
139137
if (flush || format.getAutoFlush()) {
@@ -145,7 +143,7 @@ public void close(final boolean flush) throws IOException {
145143
}
146144

147145
/**
148-
* Outputs the record separator and increments the record count.
146+
* Prints the record separator and increments the record count.
149147
*
150148
* @throws IOException
151149
* If an I/O error occurs
@@ -174,7 +172,7 @@ public void flush() throws IOException {
174172
* @return the target Appendable.
175173
*/
176174
public Appendable getOut() {
177-
return this.appendable;
175+
return appendable;
178176
}
179177

180178
/**
@@ -267,7 +265,7 @@ public synchronized void printHeaders(final ResultSet resultSet) throws IOExcept
267265
}
268266

269267
/**
270-
* Outputs the record separator.
268+
* Prints the record separator.
271269
*
272270
* @throws IOException
273271
* If an I/O error occurs

0 commit comments

Comments
 (0)