Package org.hl7.fhir.utilities
Class CSVReader
- java.lang.Object
-
- java.io.Reader
-
- java.io.InputStreamReader
-
- org.hl7.fhir.utilities.CSVReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
- Direct Known Subclasses:
CSVProcessor.DataReader
public class CSVReader extends InputStreamReader
Baseclass for readers that read data from files in comma separated file format- Author:
- Ewout
-
-
Constructor Summary
Constructors Constructor Description CSVReader(InputStream in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringcell(String name)voidcheckColumn(int i, String name, String desc)protected static StringgetColumn(String[] titles, String[] values, String column)chargetDelimiter()booleanhas(String name)booleanisMultiline()booleanline()protected booleanparseBoolean(String column)String[]parseLine()Split one line in a CSV file into its cells.voidreadHeaders()voidsetDelimiter(char delimiter)voidsetMultiline(boolean multiline)Stringvalue(int i)-
Methods inherited from class java.io.InputStreamReader
close, getEncoding, read, read, ready
-
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, reset, skip, transferTo
-
-
-
-
Constructor Detail
-
CSVReader
public CSVReader(InputStream in) throws FHIRException, IOException
- Throws:
FHIRExceptionIOException
-
-
Method Detail
-
readHeaders
public void readHeaders() throws IOException, FHIRException
- Throws:
IOExceptionFHIRException
-
line
public boolean line() throws IOException, FHIRException
- Throws:
IOExceptionFHIRException
-
parseBoolean
protected boolean parseBoolean(String column)
-
parseLine
public String[] parseLine() throws IOException, FHIRException
Split one line in a CSV file into its cells. Comma's appearing in double quoted strings will not be seen as a separator.- Returns:
- Throws:
IOExceptionFHIRException
-
checkColumn
public void checkColumn(int i, String name, String desc) throws FHIRException
- Throws:
FHIRException
-
getDelimiter
public char getDelimiter()
-
setDelimiter
public void setDelimiter(char delimiter)
-
isMultiline
public boolean isMultiline()
-
setMultiline
public void setMultiline(boolean multiline)
-
-