public abstract class FormatWriter<H extends FormatHeader>
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
appendFile |
| Modifier | Constructor and Description |
|---|---|
protected |
FormatWriter()
Deprecated.
Use constructor FormatWriter(File outputFile) instead
|
protected |
FormatWriter(java.io.File outputFile,
boolean append) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addRecord(java.lang.Object[] record)
This method writes a record in the output file.
|
abstract FormatField |
convertGExportFieldDetailsToFormatField(GExportFieldDetails details)
This method generates the appropriate FormatField given a GExportFieldDetails instance.
|
static FormatWriter<? extends FormatHeader<? extends FormatField>> |
createFormatWriter(boolean append,
java.lang.String... fileSpec)
This method selects the appropriate FormatWriter class.
|
protected java.lang.String |
getFilename()
This method returns the name of the output file.
|
H |
getHeader()
This method returns the header of the output file.
|
void |
setFields(FormatHeader<FormatField> formatHeader)
This method sets the fields in the header.
|
void |
setFields(java.util.List<FormatField> fields)
This method sets the fields in the header.
|
protected void |
setFormatHeader(H header)
This method sets the header of the output file.
|
protected void |
validateRecord(java.lang.Object[] record)
This method validates the record before adding it to the output file.
|
@Deprecated protected FormatWriter()
protected FormatWriter(java.io.File outputFile,
boolean append)
throws java.io.IOException
java.io.IOExceptionpublic H getHeader()
protected void setFormatHeader(H header)
header - a FormatHeader instancepublic void setFields(FormatHeader<FormatField> formatHeader) throws java.io.IOException
formatHeader - a H instancejava.io.IOExceptionpublic void setFields(java.util.List<FormatField> fields) throws java.io.IOException
fields - a Vector of FormatField instancesjava.io.IOExceptionprotected java.lang.String getFilename()
public abstract void addRecord(java.lang.Object[] record)
throws java.io.IOException
record - an Array of object to be written in the output filejava.io.IOExceptionprotected void validateRecord(java.lang.Object[] record)
throws java.io.IOException
record - java.io.IOExceptionpublic static FormatWriter<? extends FormatHeader<? extends FormatField>> createFormatWriter(boolean append, java.lang.String... fileSpec) throws java.io.IOException
append - true if the file is to be appended or false otherwisefileSpec - a series of string, the first being at least the name of the output file, the second can be the table if exporting in a database for examplejava.io.IOExceptionpublic abstract FormatField convertGExportFieldDetailsToFormatField(GExportFieldDetails details)
details - a GExportFieldDetails object