org.openstreetmap.josm.io.session
Class SessionWriter.ExportSupport
java.lang.Object
org.openstreetmap.josm.io.session.SessionWriter.ExportSupport
- Enclosing class:
- SessionWriter
public class SessionWriter.ExportSupport
- extends java.lang.Object
A class that provides some context for the individual SessionLayerExporter
when doing the export.
Field Summary |
private org.w3c.dom.Document |
doc
|
private int |
layerIndex
|
Method Summary |
org.w3c.dom.Element |
createElement(java.lang.String name)
|
org.w3c.dom.Text |
createTextNode(java.lang.String text)
|
int |
getLayerIndex()
Get the index of the layer that is currently exported. |
java.io.OutputStream |
getOutputStreamZip(java.lang.String zipPath)
Create a file inside the zip archive. |
boolean |
isZip()
Check, if the session is exported as a zip archive. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
doc
private org.w3c.dom.Document doc
layerIndex
private int layerIndex
SessionWriter.ExportSupport
public SessionWriter.ExportSupport(org.w3c.dom.Document doc,
int layerIndex)
createElement
public org.w3c.dom.Element createElement(java.lang.String name)
createTextNode
public org.w3c.dom.Text createTextNode(java.lang.String text)
getLayerIndex
public int getLayerIndex()
- Get the index of the layer that is currently exported.
- Returns:
- the index of the layer that is currently exported
getOutputStreamZip
public java.io.OutputStream getOutputStreamZip(java.lang.String zipPath)
throws java.io.IOException
- Create a file inside the zip archive.
- Parameters:
zipPath
- the path inside the zip archive, e.g. "layers/03/data.xml"
- Returns:
- the OutputStream you can write to. Never close the returned
output stream, but make sure to flush buffers.
- Throws:
java.io.IOException
isZip
public boolean isZip()
- Check, if the session is exported as a zip archive.
- Returns:
- true, if the session is exported as a zip archive (.joz file
extension). It will always return true, if one of the
SessionLayerExporter
returns true for the
SessionLayerExporter.requiresZip()
method. Otherwise, the
user can decide in the file chooser dialog.
JOSM