Package cdc.impex.exports
Class CheckedSheetExporter
java.lang.Object
cdc.impex.exports.CheckedSheetExporter
- All Implemented Interfaces:
SheetExporter
- Direct Known Subclasses:
CheckedWorkbookExporter
Implementation of
SheetExporter that inserts checks.
It can be extended and used like this:
public class FooExporter extends CheckedSheetExporter {
@Override
public void beginSheetExport(SheetTemplate template,
IssuesHandler<? super ExportIssue> issuesHandler) {
super.beginSheetExport(template, issuesHandler);
// Add your code here
}
@Override
public int getNumberOfRemainingRows() {
checkStatus(ImpExStatus.SHEET);
return ...;
}
@Override
public void exportRow(ExportRow row,
IssuesHandler<? super ExportIssue> issuesHandler) {
super.exportRow(row, issuesHandler);
// Add your code here
}
@Override
public void endSheetExport(SheetTemplate template,
IssuesHandler<? super ExportIssue> issuesHandler) {
super.endSheetExport(template, issuesHandler);
// Add your code here
}
}
- Author:
- Damien Carbonne
-
Field Summary
FieldsFields inherited from interface cdc.impex.exports.SheetExporter
QUIET_VOID, VERBOSE_VOID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginSheetExport(SheetTemplateInstance templateInstance, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Invoked to begin a sheet exports.protected voidcheckStatus(ImpExStatus expected) voidendSheetExport(SheetTemplateInstance templateInstance, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Invoked to end a sheet export.voidInvoked to export the current row in current sheet.intMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cdc.impex.exports.SheetExporter
hasMore
-
Field Details
-
status
-
-
Constructor Details
-
CheckedSheetExporter
public CheckedSheetExporter()
-
-
Method Details
-
checkStatus
-
beginSheetExport
public void beginSheetExport(SheetTemplateInstance templateInstance, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Description copied from interface:SheetExporterInvoked to begin a sheet exports.- Specified by:
beginSheetExportin interfaceSheetExporter- Parameters:
templateInstance- The sheet template instance associated to this extraction.issuesHandler- The issues handler that should be used by the application to generate new issues.
-
getNumberOfRemainingRows
public int getNumberOfRemainingRows()- Specified by:
getNumberOfRemainingRowsin interfaceSheetExporter- Returns:
- The remaining number of rows to extract in current row.
It can be an approximation when
> 0.
WARNING: This must be 0 when there are no more rows to export.
WARNING: This must be a negative number when the number is unknown.
-
exportRow
Description copied from interface:SheetExporterInvoked to export the current row in current sheet.- Specified by:
exportRowin interfaceSheetExporter- Parameters:
row- The row that will contain extracted data.issuesHandler- The issues handler that should be used by the application to generate new issues.
-
endSheetExport
public void endSheetExport(SheetTemplateInstance templateInstance, cdc.issues.IssuesHandler<cdc.issues.Issue> issuesHandler) Description copied from interface:SheetExporterInvoked to end a sheet export.- Specified by:
endSheetExportin interfaceSheetExporter- Parameters:
templateInstance- The sheet template instance associated to this extraction.issuesHandler- The issues handler that should be used by the application to generate new issues.
-