changeset 338:ec5c7e54cae1

Cosmetics (and fix for XMLUtils.toString(Element)). artifacts/trunk@2913 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 10 Oct 2011 07:37:06 +0000
parents 6d239c58c636
children f6beb4ffcf23
files artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactCollection.java artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java
diffstat 2 files changed, 17 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactCollection.java	Fri Oct 07 15:32:58 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactCollection.java	Mon Oct 10 07:37:06 2011 +0000
@@ -36,33 +36,23 @@
 public class DefaultArtifactCollection
 implements   ArtifactCollection
 {
-    /** The logger used in this class.*/
+    /** The logger used in this class. */
     private static Logger logger =
         Logger.getLogger(DefaultArtifactCollection.class);
 
-    /**
-     * The identifier of the collection.
-     */
+    /** The identifier of the collection. */
     protected String identifier;
 
-    /**
-     * The identifier of the collection.
-     */
+    /** The identifier of the collection. */
     protected String name;
 
-    /**
-     * The owner of this collection.
-     */
+    /** The owner of this collection. */
     protected User user;
 
-    /**
-     * The attribute of this collection.
-     */
+    /** The attribute of this collection. */
     protected Document attribute;
 
-    /**
-     * The artifacts stored in this collection.
-     */
+    /** The artifacts stored in this collection. */
     protected List<Artifact> artifacts;
 
     /**
--- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java	Fri Oct 07 15:32:58 2011 +0000
+++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java	Mon Oct 10 07:37:06 2011 +0000
@@ -60,15 +60,13 @@
  */
 public final class XMLUtils
 {
-    /**
-     * W3C URL of XForms
-     */
+    /** W3C URL of XForms. */
     public static final String XFORM_URL    = "http://www.w3.org/2002/xforms";
-    /**
-     * W3C prefix of XForms
-     */
+
+    /** W3C prefix of XForms. */
     public static final String XFORM_PREFIX = "xform";
 
+    /** Logger for this class. */
     private static Logger logger = Logger.getLogger(XMLUtils.class);
 
     private XMLUtils() {
@@ -80,17 +78,13 @@
      */
     public static class ElementCreator
     {
-        /**
-         * owner document of the elements to be created
-         */
+        /** Owner document of the elements to be created. */
         protected Document document;
-        /**
-         * namespace to be used
-         */
+
+        /** Namespace to be used. */
         protected String   ns;
-        /**
-         * prefix to be used
-         */
+
+        /** Prefix to be used. */
         protected String   prefix;
 
         /**
@@ -184,27 +178,14 @@
      * @param element element to inspect in string.
      * @return string with xml representation of element.
      */
-    public final static String toString(Element element) {
+    public final static String toString(Node node) {
         Document doc = newDocument();
-        doc.appendChild(doc.importNode(element,true));
+        doc.appendChild(doc.importNode(node,true));
         return toString(doc);
     }
 
 
     /**
-     * Creates xml/string representation of node (nested in otherwise empty
-     * document).
-     * @param element element to inspect in string.
-     * @return string with xml representation of element.
-     */
-    public final static String toString(Node node) {
-        Document doc = newDocument();
-        doc.importNode(node, true);
-        return toString(doc);
-    }
-     
-
-    /**
      * Loads a XML document namespace aware from a file
      * @param file The file to load.
      * @return the XML document or null if something went wrong

http://dive4elements.wald.intevation.org