public class OsmChangeBuilder extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
apiVersion |
private java.lang.String |
currentMode |
static java.lang.String |
DEFAULT_API_VERSION |
private OsmWriter |
osmwriter |
private boolean |
prologWritten |
private java.io.StringWriter |
swriter |
private java.io.PrintWriter |
writer |
Constructor and Description |
---|
OsmChangeBuilder(Changeset changeset) |
OsmChangeBuilder(Changeset changeset,
java.lang.String apiVersion) |
Modifier and Type | Method and Description |
---|---|
void |
append(java.util.Collection<? extends IPrimitive> primitives)
Appends a collection of Primitives to the OsmChange document.
|
void |
append(IPrimitive p)
Appends an Primitive to the OsmChange document.
|
void |
finish()
Writes the epilog of the OsmChange document
|
java.lang.String |
getDocument() |
void |
start()
Writes the prolog of the OsmChange document
|
private void |
switchMode(java.lang.String newMode) |
protected void |
write(IPrimitive p) |
public static final java.lang.String DEFAULT_API_VERSION
private java.lang.String currentMode
private java.io.PrintWriter writer
private java.io.StringWriter swriter
private java.lang.String apiVersion
private boolean prologWritten
public OsmChangeBuilder(Changeset changeset)
public OsmChangeBuilder(Changeset changeset, java.lang.String apiVersion)
protected void write(IPrimitive p)
private void switchMode(java.lang.String newMode)
public void start()
java.lang.IllegalStateException
- if the prologs has already been writtenpublic void append(java.util.Collection<? extends IPrimitive> primitives)
primitives
- the collection of primitives. Ignored if null.java.lang.IllegalStateException
- if the prologs has not been written yetstart()
,
append(IPrimitive)
public void append(IPrimitive p)
p
- the primitive. Ignored if null.java.lang.IllegalStateException
- if the prologs has not been written yetstart()
,
append(Collection)
public void finish()
java.lang.IllegalStateException
- if the prologs has not been written yetpublic java.lang.String getDocument()