Package org.smallmind.nutsnbolts.csv
Class CSVReader
- java.lang.Object
-
- org.smallmind.nutsnbolts.csv.CSVReader
-
- All Implemented Interfaces:
AutoCloseable
public class CSVReader extends Object implements AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description CSVReader(InputStream stream)CSVReader(InputStream stream, boolean useHeaders)CSVReader(Reader reader)CSVReader(Reader reader, boolean useHeaders)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()StringgetField(String header, String[] fields)String[]getHeaders()String[]readLine()CSVReadersetTrimFields(boolean trimFields)
-
-
-
Constructor Detail
-
CSVReader
public CSVReader(InputStream stream) throws IOException, CSVParseException
- Throws:
IOExceptionCSVParseException
-
CSVReader
public CSVReader(InputStream stream, boolean useHeaders) throws IOException, CSVParseException
- Throws:
IOExceptionCSVParseException
-
CSVReader
public CSVReader(Reader reader) throws IOException, CSVParseException
- Throws:
IOExceptionCSVParseException
-
CSVReader
public CSVReader(Reader reader, boolean useHeaders) throws IOException, CSVParseException
- Throws:
IOExceptionCSVParseException
-
-
Method Detail
-
setTrimFields
public CSVReader setTrimFields(boolean trimFields)
-
getHeaders
public String[] getHeaders()
-
readLine
public String[] readLine() throws IOException, CSVParseException
- Throws:
IOExceptionCSVParseException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
-