Package mgui.io.domestic.datasources
Class ExportDataTableWriter
java.lang.Object
mgui.io.FileWriter
mgui.io.domestic.datasources.ExportDataTableWriter
- All Implemented Interfaces:
InterfaceIO
,IconObject
- Direct Known Subclasses:
ExportDataTableExcelWriter
,ExportDataTableTextWriter
public abstract class ExportDataTableWriter extends FileWriter
Abstract class for extension by writers which export data from a DataSourceItem to an external
format.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields inherited from class mgui.io.FileWriter
dataFile, dataURL, failure_message, options, success_message
-
Constructor Summary
Constructors Constructor Description ExportDataTableWriter()
-
Method Summary
Modifier and Type Method Description protected java.lang.String
getStringForValue(int datatype, java.lang.Object value)
Returns a String corresponding tovalue
.boolean
write(InterfaceIOOptions options, ProgressUpdater progress_bar)
Writes this object according to the givenoptions
.abstract boolean
writeDataItem(DataSourceItem item, ProgressUpdater progress_bar)
Writes aDataSourceItem
to an external format, using the current settings of this writer.Methods inherited from class mgui.io.FileWriter
getComplementIOType, getFailureMessage, getFile, getIOType, getLoaderComplement, getObjectIcon, getOptions, getProgressMessage, getSuccessMessage, getSupportedObjects, getTitle, getURL, setFile, setOptions, setURL, toString, write, write
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
ExportDataTableWriter
public ExportDataTableWriter()
-
-
Method Details
-
writeDataItem
public abstract boolean writeDataItem(DataSourceItem item, ProgressUpdater progress_bar) throws java.io.IOExceptionWrites aDataSourceItem
to an external format, using the current settings of this writer.- Parameters:
item
-progress_bar
-- Returns:
- Throws:
java.io.IOException
-
write
Description copied from class:FileWriter
Writes this object according to the givenoptions
. If loaded object is of typePersistentObject
, this method should also set the file writer and reference URL for the object.- Specified by:
write
in classFileWriter
- Returns:
-
getStringForValue
protected java.lang.String getStringForValue(int datatype, java.lang.Object value)Returns a String corresponding tovalue
. Ifvalue
is numeric, converts it to a formatted number based onoptions.precision
. Otherwise just returns its String representation as returned from thetoString()
method.- Parameters:
datatype
-value
-- Returns:
-