Class XmlWriter

java.lang.Object
org.openstreetmap.osmosis.xml.common.BaseXmlWriter
org.openstreetmap.osmosis.xml.v0_6.XmlWriter
All Implemented Interfaces:
AutoCloseable, org.openstreetmap.osmosis.core.lifecycle.Closeable, org.openstreetmap.osmosis.core.lifecycle.Completable, org.openstreetmap.osmosis.core.task.common.Task, org.openstreetmap.osmosis.core.task.v0_6.Initializable, org.openstreetmap.osmosis.core.task.v0_6.Sink

public class XmlWriter extends BaseXmlWriter implements org.openstreetmap.osmosis.core.task.v0_6.Sink
An OSM data sink for storing all data to an xml file.
  • Constructor Details

    • XmlWriter

      public XmlWriter(BufferedWriter writer)
      Creates a new instance.
      Parameters:
      writer - The writer to send all data to.
    • XmlWriter

      public XmlWriter(File file, CompressionMethod compressionMethod)
      Creates a new instance.
      Parameters:
      file - The file to write.
      compressionMethod - Specifies the compression method to employ.
    • XmlWriter

      public XmlWriter(File file, CompressionMethod compressionMethod, boolean legacyBound)
      Creates a new instance.
      Parameters:
      file - The file to write.
      compressionMethod - Specifies the compression method to employ.
      legacyBound - If true, write the legacy <bound> element instead of the correct <bounds> one.
  • Method Details

    • process

      public void process(org.openstreetmap.osmosis.core.container.v0_6.EntityContainer entityContainer)
      Specified by:
      process in interface org.openstreetmap.osmosis.core.task.v0_6.Sink
    • beginElementWriter

      protected void beginElementWriter()
      Calls the begin method of the element writer used for this implementation.
      Specified by:
      beginElementWriter in class BaseXmlWriter
    • endElementWriter

      protected void endElementWriter()
      Calls the end method of the element writer used for this implementation.
      Specified by:
      endElementWriter in class BaseXmlWriter
    • setWriterOnElementWriter

      protected void setWriterOnElementWriter(BufferedWriter writer)
      Sets the writer on the element writer used for this implementation.
      Specified by:
      setWriterOnElementWriter in class BaseXmlWriter
      Parameters:
      writer - The writer receiving xml data.