Index: /trunk/src/org/openstreetmap/josm/io/OsmWriterFactory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmWriterFactory.java	(revision 11850)
+++ /trunk/src/org/openstreetmap/josm/io/OsmWriterFactory.java	(revision 11851)
@@ -3,4 +3,5 @@
 
 import java.io.PrintWriter;
+import java.util.Objects;
 
 /**
@@ -17,5 +18,13 @@
 public class OsmWriterFactory {
 
-    public static volatile OsmWriterFactory theFactory;
+    private static volatile OsmWriterFactory theFactory;
+
+    /**
+     * Creates new {@code OsmWriter}.
+     * @param out print writer
+     * @param osmConform if {@code true}, prevents modification attributes to be written to the common part
+     * @param version OSM API version (0.6)
+     * @return new {@code OsmWriter}
+     */
     public static OsmWriter createOsmWriter(PrintWriter out, boolean osmConform, String version) {
         // pre-set factory with this default implementation; can still be overwritten
@@ -28,4 +37,20 @@
     }
 
+    /**
+     * Sets the default factory.
+     * @param factory new default factory
+     * @since 11851
+     */
+    public static void setDefaultFactory(OsmWriterFactory factory) {
+        theFactory = Objects.requireNonNull(factory);
+    }
+
+    /**
+     * Creates new {@code OsmWriter}.
+     * @param out print writer
+     * @param osmConform if {@code true}, prevents modification attributes to be written to the common part
+     * @param version OSM API version (0.6)
+     * @return new {@code OsmWriter}
+     */
     protected OsmWriter createOsmWriterImpl(PrintWriter out, boolean osmConform, String version) {
         return new OsmWriter(out, osmConform, version);
