public class SessionWriter extends java.lang.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 java.util.Map<Layer,SessionLayerExporter> |
exporters |
private java.util.List<Layer> |
layers |
private static java.util.Map<java.lang.Class<? extends Layer>,java.lang.Class<? extends SessionLayerExporter>> |
sessionLayerExporters |
private boolean |
zip |
private java.util.zip.ZipOutputStream |
zipOut |
Constructor and Description |
---|
SessionWriter(java.util.List<Layer> layers,
int active,
java.util.Map<Layer,SessionLayerExporter> exporters,
MultiMap<Layer,Layer> dependencies,
boolean zip)
Constructs a new
SessionWriter . |
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Document |
createJosDocument() |
static SessionLayerExporter |
getSessionLayerExporter(Layer layer) |
static void |
registerSessionLayerExporter(java.lang.Class<? extends Layer> layerClass,
java.lang.Class<? extends SessionLayerExporter> exporter)
Register a session layer exporter.
|
void |
write(java.io.File f) |
void |
write(java.io.OutputStream out) |
void |
writeJos(org.w3c.dom.Document doc,
java.io.OutputStream out) |
private static java.util.Map<java.lang.Class<? extends Layer>,java.lang.Class<? extends SessionLayerExporter>> sessionLayerExporters
private final int active
private final java.util.Map<Layer,SessionLayerExporter> exporters
private final MultiMap<Layer,Layer> dependencies
private final boolean zip
private java.util.zip.ZipOutputStream zipOut
public SessionWriter(java.util.List<Layer> layers, int active, java.util.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(java.lang.Class<? extends Layer> layerClass, java.lang.Class<? extends SessionLayerExporter> exporter)
public static SessionLayerExporter getSessionLayerExporter(Layer layer)
public org.w3c.dom.Document createJosDocument() throws java.io.IOException
java.io.IOException
public void writeJos(org.w3c.dom.Document doc, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void write(java.io.File f) throws java.io.IOException
java.io.IOException
public void write(java.io.OutputStream out) throws java.io.IOException
java.io.IOException