diff gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java @ 796:a5526908f92f

Added javadoc in state package. gnv-artifacts/trunk@878 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 01 Apr 2010 09:15:36 +0000
parents c4156275c1e1
children feae2f9d6c6f
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java	Wed Mar 31 13:48:07 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java	Thu Apr 01 09:15:36 2010 +0000
@@ -33,6 +33,10 @@
 import org.w3c.dom.Node;
 
 /**
+ * This state handles input of a min and max value and validates the user input.
+ * The min value needs to be equal or smaller than the max value, otherwise the
+ * input results in an error.
+ *
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
  */
@@ -51,8 +55,13 @@
     }
 
     /**
-     * @see de.intevation.gnv.state.StateBase#purifyResult(java.util.Collection,
-     *      java.lang.String)
+     * The objects returned by the database are searched for two fields with
+     * 'MIN' and 'MAX' as names. These objects are stored and used to be
+     * displayed in the gui to give the user an orientation of the range he is
+     * able to insert.
+     *
+     * @param uuid 
+     * @return
      */
     @Override
     protected List<Object> purifyResult(
@@ -77,10 +86,14 @@
 
 
     /**
-     * @see de.intevation.gnv.state.StateBase#feed(java.util.Collection,
-     *      java.lang.String)
+     * @param context
+     * @param uuid
+     * @param inputData 
+     * @return
+     * @throws StateException
      */
     @Override
+    @SuppressWarnings("static-access")
     public Document feed(
         CallContext           context,
         Collection<InputData> inputData,
@@ -113,7 +126,8 @@
                 return feedFailure(msg);
             }
 
-            boolean valid = iv.isInputValid(value, type);
+            @SuppressWarnings("static-access")
+            boolean valid = InputValidator.isInputValid(value, type);
             if (!valid) {
                 String msg = "Input is not valid for this state.";
                 log.error(msg);
@@ -129,7 +143,7 @@
             }
 
             if (min != null && max != null) {
-                if (!iv.isInputValid((String) min, (String) max, type)) {
+                if (!InputValidator.isInputValid((String) min, (String) max, type)) {
                     String msg = "Input is not valid for this state.";
                     log.error(msg);
                     return feedFailure(msg);
@@ -148,6 +162,14 @@
     }
 
 
+    /**
+     *
+     * @param artCreator
+     * @param creator
+     * @param document
+     * @param staticNode
+     * @param callMeta
+     */
     @Override
     protected void appendToStaticNode(
         XMLUtils.ElementCreator artCreator,
@@ -220,4 +242,4 @@
         staticNode.appendChild(groupNode);
     }
 }
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org