[PATCH] Added simple interface to convert an XML DOM element to something opaque

Wald Commits scm-commit at wald.intevation.org
Mon Sep 23 10:50:07 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1379926141 -7200
# Node ID 09b5f7de8b6d4745520810f7e3f0a0a3c705363b
# Parent  d3dbb7b5a164f916875404e7359b0b93ca35f64b
Added simple interface to convert an XML DOM element to something opaque.

diff -r d3dbb7b5a164 -r 09b5f7de8b6d artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultSettings.java
--- a/artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultSettings.java	Mon Sep 16 17:11:26 2013 +0200
+++ b/artifact-database/src/main/java/org/dive4elements/artifactdatabase/state/DefaultSettings.java	Mon Sep 23 10:49:01 2013 +0200
@@ -52,11 +52,11 @@
         Document owner    = parent.getOwnerDocument();
         Element  settings = owner.createElement("settings");
 
-        parent.appendChild(settings);
-
         for (Section section: sections) {
             section.toXML(settings);
         }
+
+        parent.appendChild(settings);
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r d3dbb7b5a164 -r 09b5f7de8b6d artifacts-common/src/main/java/org/dive4elements/artifacts/common/utils/ElementConverter.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts-common/src/main/java/org/dive4elements/artifacts/common/utils/ElementConverter.java	Mon Sep 23 10:49:01 2013 +0200
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2013 by Intevation GmbH
+ *
+ * This program is free software under the LGPL (>=v2.1)
+ * Read the file LGPL.txt coming with the software for details
+ * or visit http://www.gnu.org/licenses/ if it does not exist.
+ */
+package org.dive4elements.artifacts.common.utils;
+
+import org.w3c.dom.Element;
+
+/** Simple interface to convert an XML DOM element to somthing opaque,
+ *  Useful to do some config preprocessing.
+ */
+public interface ElementConverter {
+    Object convert(Element element);
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list