Class SessionWriter.ExportSupport
java.lang.Object
org.openstreetmap.josm.io.session.SessionWriter.ExportSupport
- Enclosing class:
- SessionWriter
A class that provides some context for the individual
SessionLayerExporter
when doing the export.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateElement(String name) Creates an element of the type specified.createTextNode(String text) Creates a text node given the specified string.intGet the index of the layer that is currently exported.intgetLayerIndexOf(Layer layer) Get the index of the specified layergetOutputStreamZip(String zipPath) Create a file inside the zip archive.booleanisZip()Check, if the session is exported as a zip archive.
-
Field Details
-
doc
-
layerIndex
-
-
Constructor Details
-
ExportSupport
Constructs a newExportSupport.- Parameters:
doc- XML documentlayerIndex- layer index
-
-
Method Details
-
createElement
Creates an element of the type specified.- Parameters:
name- The name of the element type to instantiate- Returns:
- A new
Elementobject - See Also:
-
createTextNode
Creates a text node given the specified string.- Parameters:
text- The data for the node.- Returns:
- The new
Textobject. - See Also:
-
getLayerIndex
Get the index of the layer that is currently exported.- Returns:
- the index of the layer that is currently exported
-
getLayerIndexOf
Get the index of the specified layer- Parameters:
layer- the layer- Returns:
- the index of the specified layer
- Since:
- 18466
-
getOutputStreamZip
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:
IOException- if any I/O error occurs
-
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
SessionLayerExporterreturns true for theSessionLayerExporter.requiresZip()method. Otherwise, the user can decide in the file chooser dialog.
-