Class BaseXmlWriter
java.lang.Object
org.openstreetmap.osmosis.xml.common.BaseXmlWriter
- Direct Known Subclasses:
XmlChangeWriter,XmlWriter
An OSM data sink for storing all data to an xml file.
-
Constructor Summary
ConstructorsConstructorDescriptionBaseXmlWriter(BufferedWriter writer) Creates a new instance to write to the provided writer.BaseXmlWriter(File file, CompressionMethod compressionMethod) Creates a new instance to write to the specified file. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidCalls the begin method of the element writer used for this implementation.voidclose()Cleans up any open file handles.voidcomplete()Flushes all changes to file.protected abstract voidCalls the end method of the element writer used for this implementation.protected voidInitialises the output file for writing.voidinitialize(Map<String, Object> metaData) Initialize the object.protected abstract voidsetWriterOnElementWriter(BufferedWriter resultWriter) Sets the writer on the element writer used for this implementation.
-
Constructor Details
-
BaseXmlWriter
Creates a new instance to write to the provided writer.- Parameters:
writer- The writer to receive data. This writer will not be closed on completion.
-
BaseXmlWriter
Creates a new instance to write to the specified file.- Parameters:
file- The file to write.compressionMethod- Specifies the compression method to employ.
-
-
Method Details
-
setWriterOnElementWriter
Sets the writer on the element writer used for this implementation.- Parameters:
resultWriter- The writer receiving xml data.
-
beginElementWriter
protected abstract void beginElementWriter()Calls the begin method of the element writer used for this implementation. -
endElementWriter
protected abstract void endElementWriter()Calls the end method of the element writer used for this implementation. -
initialize
Initialize the object.- Parameters:
metaData- Meta data applicable to this pipeline invocation.
-
initialize
protected void initialize()Initialises the output file for writing. This must be called by sub-classes before any writing is performed. This method may be called multiple times without adverse affect allowing sub-classes to invoke it every time they perform processing. -
complete
public void complete()Flushes all changes to file. -
close
public void close()Cleans up any open file handles.
-