|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.converters.resultset.csv.TextColumnStrategy
Strategy to retrieve a text value from the database.
Field Summary | |
private static char[] |
charBuffer
|
private static int |
charBufferSize
|
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
private CSVConfigurator |
mConfigurator
Configurator object defining CSV file format |
Constructor Summary | |
TextColumnStrategy(CSVConfigurator configurator)
Constructs strategy for textual fields. |
Method Summary | |
void |
convertField(java.lang.StringBuffer output,
java.sql.ResultSet rs,
int column)
Convert a single field from the current row of the result set into string and appends them to the output string buffer. |
private java.lang.String |
prepareField(java.lang.String input)
Searches for double quotes in input string and returns a string with each double quote escaped by preceeding double quote. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private CSVConfigurator mConfigurator
private static char[] charBuffer
private static int charBufferSize
Constructor Detail |
public TextColumnStrategy(CSVConfigurator configurator)
configurator
- that defines CSV file format.Method Detail |
public void convertField(java.lang.StringBuffer output, java.sql.ResultSet rs, int column) throws java.sql.SQLException, java.io.IOException
ColumnStrategy
convertField
in interface ColumnStrategy
output
- output stream to write the converted bytesrs
- result set containing the fieldcolumn
- index of the column within the current row containing the
field
java.sql.SQLException
- if a database error occurs during the processing of the
result set
java.io.IOException
- if there is an error with accessing streams used in conversionprivate java.lang.String prepareField(java.lang.String input)
input
- string
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |