public class CsvDatabase extends AbstractDatabase
An implementation of the AbstractDatabase lookup service, that reads data from a CSV file at initialization time.
| Modifier and Type | Field and Description |
|---|---|
(package private) boolean |
header |
(package private) String[] |
keys |
(package private) String |
separator |
database, key, log, url| Constructor and Description |
|---|
CsvDatabase() |
| Modifier and Type | Method and Description |
|---|---|
String[] |
getKeys() |
String |
getSeparator() |
boolean |
isHeader() |
protected void |
populateDatabase(SourceURL url,
Map<String,Data> database) |
void |
setHeader(boolean header) |
void |
setKeys(String[] keys) |
void |
setSeparator(String separator) |
finish, getKey, getUrl, init, lookup, readDatabase, reset, setKey, setUrlprotected void populateDatabase(SourceURL url, Map<String,Data> database) throws Exception
populateDatabase in class AbstractDatabaseExceptionAbstractDatabase.populateDatabase(stream.io.SourceURL,
java.util.Map)public boolean isHeader()
@Parameter(description="Whether to use the first line as headers (keys/attribute names). ", required=false) public void setHeader(boolean header)
header - the header to setpublic String[] getKeys()
@Parameter(description="The keys of the CSV file. If not specified, the first line of the CSV will be used as keys.", required=false) public void setKeys(String[] keys)
keys - the keys to setpublic String getSeparator()
@Parameter(description="The separator string used for the CSV stream reading.", required=false) public void setSeparator(String separator)
separator - the separator to setCopyright © 2018. All rights reserved.