Class OsmDataSessionImporter
- java.lang.Object
-
- org.openstreetmap.josm.io.session.OsmDataSessionImporter
-
- All Implemented Interfaces:
SessionLayerImporter
public class OsmDataSessionImporter extends java.lang.Object implements SessionLayerImporter
Session importer forOsmDataLayer.- Since:
- 4685
-
-
Constructor Summary
Constructors Constructor Description OsmDataSessionImporter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckMetaVersion(org.w3c.dom.Element elem)Checks that element defines the expected version number.static java.lang.StringextractFileName(org.w3c.dom.Element elem, SessionReader.ImportSupport support)Extract file name from element.static LayerimportData(OsmImporter osmImporter, SessionReader.ImportSupport support, java.lang.String fileStr, ProgressMonitor progressMonitor)Import data as a new layer.Layerload(org.w3c.dom.Element elem, SessionReader.ImportSupport support, ProgressMonitor progressMonitor)Load the layer from xml meta-data.
-
-
-
Constructor Detail
-
OsmDataSessionImporter
public OsmDataSessionImporter()
-
-
Method Detail
-
load
public Layer load(org.w3c.dom.Element elem, SessionReader.ImportSupport support, ProgressMonitor progressMonitor) throws java.io.IOException, IllegalDataException
Description copied from interface:SessionLayerImporterLoad the layer from xml meta-data.- Specified by:
loadin interfaceSessionLayerImporter- Parameters:
elem- XML elementsupport- support class providing import utilitiesprogressMonitor- progress monitor- Returns:
- the resulting layer
- Throws:
java.io.IOException- if any I/O error occursIllegalDataException- if invalid data is read
-
checkMetaVersion
public static void checkMetaVersion(org.w3c.dom.Element elem) throws IllegalDataException
Checks that element defines the expected version number.- Parameters:
elem- element to check- Throws:
IllegalDataException- if version is not the expected one- Since:
- 15377
-
extractFileName
public static java.lang.String extractFileName(org.w3c.dom.Element elem, SessionReader.ImportSupport support) throws IllegalDataException
Extract file name from element.- Parameters:
elem- element to parsesupport- import/export support- Returns:
- file name, if present
- Throws:
IllegalDataException- if file name missing or empty- Since:
- 15377
-
importData
public static Layer importData(OsmImporter osmImporter, SessionReader.ImportSupport support, java.lang.String fileStr, ProgressMonitor progressMonitor) throws java.io.IOException, IllegalDataException
Import data as a new layer.- Parameters:
osmImporter- OSM importersupport- import/export supportfileStr- file name to importprogressMonitor- progress monitor- Returns:
- new layer
- Throws:
java.io.IOException- in case of I/O errorIllegalDataException- in case of illegal data- Since:
- 15377
-
-