Package com.jadice.web.export.server
Interface Exporter
- All Known Subinterfaces:
JPSExporter
public interface Exporter
A representation of an exporter, that writes the output to an
Example
OutputStream.
Exporter may be used to generate an export based on a collection of pages.
The most common way to access an Exporter instance is, by using the
ExporterFactory. The ExporterFactory defines some static methods to create
instances of commonly used Exporter instances.
Example
Document sourceDocument = // ... initialized somewhere else
OutputStream output = // ... the designated output
Exporter psExporter = ExporterFactory.createPostscriptExporter();
final Lock lock = sourceDocument.getPages().getReadWriteLock().getReadLock();
lock.lock();
try {
// add all pages of a given document to the exporter
psExporter.getSourcePages().addAll(sourceDocument.getPages());
} finally {
lock.unlock();
}
exporter.export(output);
output.close();
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddExportStatusListener(ExportStatusListener exportStatusListener) voidexport(OutputStream output) Perform the export.voidexport(org.jadice.util.base.Provider<OutputStream, IOException> output) Perform the export.org.jadice.util.glazedlists.EventList<Page> AEventListwithpagesthat shall be printed.booleanDetermines, whether the givenExporterinstance is available.default voiddefault voidsetRenderControlsInventory(com.levigo.jadice.document.render.RenderControlsInventory renderControlsInventory)
-
Field Details
-
statusListeners
-
-
Method Details
-
isAvailable
boolean isAvailable()Determines, whether the givenExporterinstance is available. In some cases and on some systems not everyExporteris available due to numerous restrictions like different implementations of the JavaVM.- Returns:
trueif theExporterinstance is available and can be used.
-
getSourcePages
org.jadice.util.glazedlists.EventList<Page> getSourcePages()AEventListwithpagesthat shall be printed.The contents of this
EventListare the sourcepagesthat will be printed.- Returns:
- never
null. A mutableEventListofpages
-
export
Perform the export.- Parameters:
output-- Throws:
Exception
-
export
Perform the export.- Parameters:
output-- Throws:
Exception
-
addExportStatusListener
-
onExportFailed
default void onExportFailed() -
setRenderControlsInventory
default void setRenderControlsInventory(com.levigo.jadice.document.render.RenderControlsInventory renderControlsInventory)
-