|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.storage.jdbc.export.RelationalDelimitedValuesExporter
public class RelationalDelimitedValuesExporter
Exporter class that tranforms non multidimensional data into delimited values data streams like Comma Separated Values streams
or Tab Separated Values streams.
By default it generates a CSV stream, to produce a different delimited values stream either use the
RelationalDelimitedValuesExporter(String)
constructor or
set the dataDelimiter and the lineDelimiter attributes by calling
the setDataDelimiter(String)
and the setLineDelimiter(String)
methods respectively.
Constructor Summary | |
---|---|
RelationalDelimitedValuesExporter()
Creates a new RelationalDelimitedValuesExporter object using ExportDelimiters.COMMA as dataDelimiter and
ExportDelimiters.CARRIAGE_RETURN as lineDelimiter. |
|
RelationalDelimitedValuesExporter(java.lang.String dataDelimiter)
Creates a new RelationalDelimitedValuesExporter object using the specified dataDelimiter and ExportDelimiters.CARRIAGE_RETURN as lineDelimiter. |
Method Summary | |
---|---|
java.lang.String |
getColumnHeaderLine(java.lang.Object[] columnHeaders)
Generates a string containing the values of the column headers to export. |
java.lang.String |
getDataDelimiter()
Returns the string used to delimit the data values. |
java.lang.String |
getFileHeader()
Returns what is used as the header of the exported file. |
java.lang.String |
getFileTrailer()
Returns what is used as the trailer of the exported file. |
java.lang.String |
getLine(java.lang.Object rowHeader,
java.lang.Object[] data)
Generates a string containing the values of the rowHeader (if not null) followed by the values of the data to export. |
java.lang.String |
getLineDelimiter()
Returns the string used to delimit the lines of values. |
protected java.lang.String |
objectToString(java.lang.Object value)
Transforms an Object into a String. |
void |
setDataDelimiter(java.lang.String dataDelimiter)
Sets the string used to delimit the data values. |
void |
setLineDelimiter(java.lang.String lineDelimiter)
Sets the string used to delimit the lines of values. |
protected void |
writeString(java.lang.String str,
java.lang.StringBuffer line)
Writes a string into a StringBuffer, checking for embedded double quotes. |
Constructor Detail |
---|
public RelationalDelimitedValuesExporter()
ExportDelimiters.COMMA
as dataDelimiter and
ExportDelimiters.CARRIAGE_RETURN
as lineDelimiter.
public RelationalDelimitedValuesExporter(java.lang.String dataDelimiter)
ExportDelimiters.CARRIAGE_RETURN
as lineDelimiter.
dataDelimiter
- The string that delimits the data values.Method Detail |
---|
public java.lang.String getDataDelimiter()
ExportDelimiters.COMMA
,
ExportDelimiters.TAB
public void setDataDelimiter(java.lang.String dataDelimiter)
dataDelimiter
- The string used to delimit the data values.
Example of valid values are:
ExportDelimiters.COMMA
and ExportDelimiters.TAB
public java.lang.String getLineDelimiter()
ExportDelimiters.CARRIAGE_RETURN
public void setLineDelimiter(java.lang.String lineDelimiter)
lineDelimiter
- The string used to delimit the lines of values.
An example of line delimiter is ExportDelimiters.CARRIAGE_RETURN
protected void writeString(java.lang.String str, java.lang.StringBuffer line)
str
- The string to write.line
- The StringBuffer to fill.protected java.lang.String objectToString(java.lang.Object value)
value
- The object to transform.
public java.lang.String getFileHeader()
RelationalExportInterface
getFileHeader
in interface RelationalExportInterface
public java.lang.String getColumnHeaderLine(java.lang.Object[] columnHeaders)
RelationalExportInterface
getColumnHeaderLine
in interface RelationalExportInterface
columnHeaders
- The column header objects.
public java.lang.String getLine(java.lang.Object rowHeader, java.lang.Object[] data)
RelationalExportInterface
getLine
in interface RelationalExportInterface
rowHeader
- The object holding the row header value.data
- The object holding the data values.
public java.lang.String getFileTrailer()
RelationalExportInterface
getFileTrailer
in interface RelationalExportInterface
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |