public class SessionWriter extends Object
Modifier and Type | Class and Description |
---|---|
class |
SessionWriter.ExportSupport
A class that provides some context for the individual
SessionLayerExporter
when doing the export. |
Modifier and Type | Field and Description |
---|---|
private int |
active |
private MultiMap<Layer,Layer> |
dependencies |
private Map<Layer,SessionLayerExporter> |
exporters |
private List<Layer> |
layers |
private static Map<Class<? extends Layer>,Class<? extends SessionLayerExporter>> |
sessionLayerExporters |
private boolean |
zip |
private ZipOutputStream |
zipOut |
Constructor and Description |
---|
SessionWriter(List<Layer> layers,
int active,
Map<Layer,SessionLayerExporter> exporters,
MultiMap<Layer,Layer> dependencies,
boolean zip)
Constructs a new
SessionWriter . |
Modifier and Type | Method and Description |
---|---|
Document |
createJosDocument() |
static SessionLayerExporter |
getSessionLayerExporter(Layer layer) |
static void |
registerSessionLayerExporter(Class<? extends Layer> layerClass,
Class<? extends SessionLayerExporter> exporter)
Register a session layer exporter.
|
void |
write(File f) |
void |
write(OutputStream out) |
void |
writeJos(Document doc,
OutputStream out) |
private static Map<Class<? extends Layer>,Class<? extends SessionLayerExporter>> sessionLayerExporters
private final int active
private final Map<Layer,SessionLayerExporter> exporters
private final MultiMap<Layer,Layer> dependencies
private final boolean zip
private ZipOutputStream zipOut
public SessionWriter(List<Layer> layers, int active, Map<Layer,SessionLayerExporter> exporters, MultiMap<Layer,Layer> dependencies, boolean zip)
SessionWriter
.layers
- The ordered list of layers to saveactive
- The index of active layer in layers
(starts to 0). Ignored if set to -1exporters
- The exporters to use to save layerszip
- true
if a joz archive has to be created, false otherwise
public static void registerSessionLayerExporter(Class<? extends Layer> layerClass, Class<? extends SessionLayerExporter> exporter)
public static SessionLayerExporter getSessionLayerExporter(Layer layer)
public Document createJosDocument() throws IOException
IOException
public void writeJos(Document doc, OutputStream out) throws IOException
IOException
public void write(File f) throws IOException
IOException
public void write(OutputStream out) throws IOException
IOException