Class OsmChangeBuilder


  • public class OsmChangeBuilder
    extends java.lang.Object
    Creates an OsmChange document from JOSM edits. See http://wiki.openstreetmap.org/index.php/OsmChange for a documentation of the OsmChange format.
    Since:
    1071
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      private void checkProlog()  
      void finish()
      Writes the epilog of the OsmChange document
      java.lang.String getDocument()
      Returns XML document.
      void start()
      Writes the prolog of the OsmChange document
      private void switchMode​(java.lang.String newMode)  
      protected void write​(IPrimitive p)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OsmChangeBuilder

        public OsmChangeBuilder​(Changeset changeset)
        Constructs a new OsmChangeBuilder.
        Parameters:
        changeset - changeset
      • OsmChangeBuilder

        public OsmChangeBuilder​(Changeset changeset,
                                java.lang.String apiVersion)
        Constructs a new OsmChangeBuilder.
        Parameters:
        changeset - changeset
        apiVersion - OSM API version
    • Method Detail

      • switchMode

        private void switchMode​(java.lang.String newMode)
      • start

        public void start()
        Writes the prolog of the OsmChange document
        Throws:
        java.lang.IllegalStateException - if the prologs has already been written
      • append

        public void append​(java.util.Collection<? extends IPrimitive> primitives)
        Appends a collection of Primitives to the OsmChange document.
        Parameters:
        primitives - the collection of primitives. Ignored if null.
        Throws:
        java.lang.IllegalStateException - if the prologs has not been written yet
        See Also:
        start(), append(IPrimitive)
      • append

        public void append​(IPrimitive p)
        Appends an Primitive to the OsmChange document.
        Parameters:
        p - the primitive. Ignored if null.
        Throws:
        java.lang.IllegalStateException - if the prologs has not been written yet
        See Also:
        start(), append(Collection)
      • finish

        public void finish()
        Writes the epilog of the OsmChange document
        Throws:
        java.lang.IllegalStateException - if the prologs has not been written yet
      • getDocument

        public java.lang.String getDocument()
        Returns XML document.
        Returns:
        XML document