public class CsvStream extends AbstractLineStream
| Modifier and Type | Field and Description |
|---|---|
(package private) ArrayList<String> |
columns |
(package private) boolean |
header |
(package private) String[] |
keys |
(package private) long |
lineNo |
(package private) static org.slf4j.Logger |
log |
(package private) String |
splitExpression |
attributes, encoding, readerclosed, count, id, in, limit, prefix, seqId, sequenceKey, urlSOURCE_KEY| Constructor and Description |
|---|
CsvStream(InputStream in) |
CsvStream(InputStream in,
Charset charset,
String splitter) |
CsvStream(InputStream in,
String splitter) |
CsvStream(SourceURL url) |
CsvStream(SourceURL url,
String splitExp) |
| Modifier and Type | Method and Description |
|---|---|
String[] |
getKeys() |
String |
getSeparator() |
void |
init() |
boolean |
isHeader() |
String |
readLine()
This implementation of the readLine() method simply skips all comments,
i.e.
|
Data |
readNext() |
protected String |
removeQuotes(String str) |
void |
setHeader(boolean header) |
void |
setKeys(String[] keys) |
void |
setSeparator(String separator) |
close, getEncoding, setEncodinggetId, getInputStream, getLimit, getPrefix, getSequenceKey, getUrl, read, setId, setLimit, setPrefix, setSequenceKey, setUrlstatic org.slf4j.Logger log
String[] keys
String splitExpression
long lineNo
boolean header
public CsvStream(InputStream in) throws Exception
Exceptionpublic CsvStream(InputStream in, String splitter) throws Exception
Exceptionpublic CsvStream(InputStream in, Charset charset, String splitter) throws Exception
Exceptionpublic void init()
throws Exception
init in interface Sourceinit in class AbstractLineStreamExceptionSource.init()public boolean isHeader()
@Parameter(description="Determines whether the first line should be used as header (column names), defaults to \'true\'.", required=false) public void setHeader(boolean header)
header - the header to set@Parameter(name="separator", required=false, defaultValue="(;|,)") public void setSeparator(String separator)
public String getSeparator()
public String[] getKeys()
public void setKeys(String[] keys)
keys - the keys to setpublic Data readNext() throws Exception
readNext in class AbstractStreamExceptionSource.read()public String readLine() throws Exception
readLine in class AbstractLineStreamExceptionAbstractLineStream.readLine()Copyright © 2018. All rights reserved.