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