|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscriptella.driver.csv.CsvQuery
public class CsvQuery
Query for CSV file.
| Field Summary | |
|---|---|
protected boolean |
headers
|
protected static java.util.logging.Logger |
LOG
|
protected java.lang.String |
nullString
|
protected boolean |
trim
|
| Constructor Summary | |
|---|---|
CsvQuery(CSVReader queryReader,
scriptella.expression.PropertiesSubstitutor substitutor,
java.lang.String nullString,
boolean headers,
boolean trim)
Creates a query for CSVReader. |
|
| Method Summary | |
|---|---|
void |
execute(CSVReader reader,
scriptella.spi.QueryCallback queryCallback,
scriptella.spi.AbstractConnection.StatementCounter counter)
Executes a query over a specified text content. |
protected scriptella.util.ColumnsMap |
getColumnsMap()
|
protected java.lang.Object |
getCurrentRowValueAt(int columnIndex,
java.lang.String columnName)
Returns the value of a specified column. |
java.lang.Object |
getParameter(java.lang.String name)
|
protected scriptella.util.ColumnsMap |
parseHeader(CSVReader reader)
|
protected void |
processRow(scriptella.spi.QueryCallback queryCallback,
java.lang.String[] r)
Processes the current row. |
protected boolean |
rowMatches(java.lang.String[] r)
Checks if current CSV row matches any of the specified patterns. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.util.logging.Logger LOG
protected final boolean headers
protected final boolean trim
protected final java.lang.String nullString
| Constructor Detail |
|---|
public CsvQuery(CSVReader queryReader,
scriptella.expression.PropertiesSubstitutor substitutor,
java.lang.String nullString,
boolean headers,
boolean trim)
queryReader - query CSVReader.substitutor - properties substitutor to use. The parameters for the substitutor must be set by a caller.headers - true if first line of input CSV file contains headers.trim - true if if extra whitespaces should be trimmed.nullString - string to treat as NULL.| Method Detail |
|---|
public void execute(CSVReader reader,
scriptella.spi.QueryCallback queryCallback,
scriptella.spi.AbstractConnection.StatementCounter counter)
throws java.io.IOException
reader - CSV content reader.queryCallback - callback to use for result set iteration.counter - statements counter.
java.io.IOException - if IO error occurs.
protected scriptella.util.ColumnsMap parseHeader(CSVReader reader)
throws java.io.IOException
java.io.IOExceptionprotected boolean rowMatches(java.lang.String[] r)
r - row to check
protected void processRow(scriptella.spi.QueryCallback queryCallback,
java.lang.String[] r)
This template method may be used for customizations by sublasses.
queryCallback - query callback to use.r - row to pass as current parameters callback.public java.lang.Object getParameter(java.lang.String name)
getParameter in interface scriptella.spi.ParametersCallback
protected java.lang.Object getCurrentRowValueAt(int columnIndex,
java.lang.String columnName)
This method may be overriden to perform conversion etc
2 parameters are passed for performance reasons, so that subclasses may decide wich one to use.
columnIndex - column indexcolumnName - column name.
protected scriptella.util.ColumnsMap getColumnsMap()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||