Skip to content

Commit ddda2af

Browse files
committed
CSVParser constructor with CSVStrategy: SANDBOX-180
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/sandbox/csv/trunk@477503 13f79535-47bb-0310-9956-ffa450edef68
1 parent b73040f commit ddda2af

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/java/org/apache/commons/csv/CSVParser.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,20 @@ public CSVParser(Reader input, char delimiter) {
153153
* @param commentStart a Char used for comment identification
154154
*/
155155
public CSVParser(Reader input, char delimiter, char encapsulator, char commentStart) {
156+
this(input, new CSVStrategy(delimiter, encapsulator, commentStart));
157+
}
158+
159+
/**
160+
* Customized csv parser.
161+
*
162+
* The parser parses according to the given CSV strategy.
163+
*
164+
* @param input a Reader based on "csv-formatted" input
165+
* @param strategy the CSVStrategy used for CSV parsing
166+
*/
167+
public CSVParser(Reader input, CSVStrategy strategy) {
156168
this.in = new ExtendedBufferedReader(input);
157-
this.strategy = new CSVStrategy(delimiter, encapsulator, commentStart);
169+
this.strategy = strategy;
158170
}
159171

160172
// ======================================================

0 commit comments

Comments
 (0)