Class ElementWriter
java.lang.Object
org.openstreetmap.osmosis.xml.common.ElementWriter
- Direct Known Subclasses:
BoundWriter,EntityWriter,OsmChangeWriter,OsmWriter,RelationMemberWriter,TagWriter,WayNodeWriter
Provides common functionality for all classes writing elements to xml.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedElementWriter(String anElementName, int anIndentionLevel) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAttribute(String name, String value) Adds an attribute to the element.protected voidWrites an element opening line without the final closing portion of the tag.protected voidWrites the closing tag of the element.protected voidendOpenElement(boolean closeElement) Writes out the opening tag of the element.protected org.openstreetmap.osmosis.core.domain.common.TimestampFormatReturns a timestamp format suitable for xml files.voidSets the writer used as the xml output destination.
-
Constructor Details
-
ElementWriter
Creates a new instance.- Parameters:
anElementName- The name of the element to be written.anIndentionLevel- The indent level of the element.
-
-
Method Details
-
setWriter
Sets the writer used as the xml output destination.- Parameters:
aWriter- The writer.
-
getTimestampFormat
protected org.openstreetmap.osmosis.core.domain.common.TimestampFormat getTimestampFormat()Returns a timestamp format suitable for xml files.- Returns:
- The timestamp format.
-
beginOpenElement
protected void beginOpenElement()Writes an element opening line without the final closing portion of the tag. -
endOpenElement
protected void endOpenElement(boolean closeElement) Writes out the opening tag of the element.- Parameters:
closeElement- If true, the element will be closed immediately and written as a single tag in the output xml file.
-
addAttribute
Adds an attribute to the element.- Parameters:
name- The name of the attribute.value- The value of the attribute.
-
closeElement
protected void closeElement()Writes the closing tag of the element.
-