Class FastXmlReader
java.lang.Object
org.openstreetmap.osmosis.xml.v0_6.impl.BaseXMLReader
org.openstreetmap.osmosis.xml.v0_6.FastXmlReader
- All Implemented Interfaces:
Runnable,org.openstreetmap.osmosis.core.task.common.Task,org.openstreetmap.osmosis.core.task.v0_6.RunnableSource,org.openstreetmap.osmosis.core.task.v0_6.Source
public class FastXmlReader
extends BaseXMLReader
implements org.openstreetmap.osmosis.core.task.v0_6.RunnableSource
An OSM data source reading from an xml file. The entire contents of the file
are read.
-
Constructor Summary
ConstructorsConstructorDescriptionFastXmlReader(File file, boolean enableDateParsing, CompressionMethod compressionMethod) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidparseXML(InputStream stream, DefaultHandler handler) Function to parse xml, this default function just uses the SAXParser.voidrun()Reads all data from the file and send it to the sink.voidsetSink(org.openstreetmap.osmosis.core.task.v0_6.Sink sink) Methods inherited from class org.openstreetmap.osmosis.xml.v0_6.impl.BaseXMLReader
handleXML, isEnableDateParsing
-
Constructor Details
-
FastXmlReader
Creates a new instance.- Parameters:
file- The file to read.enableDateParsing- If true, dates will be parsed from xml data, else the current date will be used thus saving parsing time.compressionMethod- Specifies the compression method to employ.
-
-
Method Details
-
setSink
public void setSink(org.openstreetmap.osmosis.core.task.v0_6.Sink sink) - Specified by:
setSinkin interfaceorg.openstreetmap.osmosis.core.task.v0_6.Source
-
run
public void run()Reads all data from the file and send it to the sink. -
parseXML
protected void parseXML(InputStream stream, DefaultHandler handler) throws SAXException, IOException Description copied from class:BaseXMLReaderFunction to parse xml, this default function just uses the SAXParser.- Overrides:
parseXMLin classBaseXMLReader- Parameters:
stream- InputStream for the XMLhandler- A handler for the XML- Throws:
SAXException- If there is any exceptions while parsing the XMLIOException- If there is any issues with the input stream
-