changeset 824:7e5995c47125

Added more Javadoc. gnv-artifacts/trunk@913 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 13 Apr 2010 08:49:42 +0000
parents 499cfbbb61bc
children b43e7205e83c
files gnv-artifacts/src/main/java/de/intevation/gnv/transition/PresettingsValueCompareTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/package.html
diffstat 4 files changed, 69 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/PresettingsValueCompareTransition.java	Tue Apr 13 08:25:34 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/PresettingsValueCompareTransition.java	Tue Apr 13 08:49:42 2010 +0000
@@ -1,17 +1,20 @@
 package de.intevation.gnv.transition;
 
-import de.intevation.artifactdatabase.Config;
-
-import de.intevation.gnv.state.InputData;
-import de.intevation.gnv.state.State;
-
 import java.util.Map;
 
 import org.apache.log4j.Logger;
-
 import org.w3c.dom.Node;
 
+import de.intevation.artifactdatabase.Config;
+import de.intevation.gnv.state.InputData;
+import de.intevation.gnv.state.State;
+
 /**
+ * Class which supports the possibility to validate if a
+ * Transition could be done using simple Valuecompare Operations.
+ * The Compareoperations will use the preSettings of an Artifact.
+ * At this Time equal and notequal-operations are supported.
+ * The Comparation is casesensitive.
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
  *
  */
@@ -22,8 +25,18 @@
      */
     private static Logger log = Logger.getLogger(PresettingsValueCompareTransition.class);
 
+    /**
+     * The Name of the Datafield the Value  that should be compared 
+     * should be fetched from.
+     */
     private String dataName = null;
+    /**
+     * The Value that should be set to the State.
+     */
     private String dataValue = null;
+    /**
+     * The Operation that should be used (equal notequal)
+     */
     private String operator = null;
 
     /**
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java	Tue Apr 13 08:25:34 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java	Tue Apr 13 08:49:42 2010 +0000
@@ -1,12 +1,12 @@
 package de.intevation.gnv.transition;
 
+import org.apache.log4j.Logger;
+import org.w3c.dom.Node;
+
 import de.intevation.gnv.artifacts.GNVArtifactBase;
 
-import org.apache.log4j.Logger;
-
-import org.w3c.dom.Node;
-
 /**
+ * This Factoryclass instantiates Objects of Type Transition.
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
  *
  */
@@ -17,6 +17,9 @@
      */
     private static Logger log = Logger.getLogger(GNVArtifactBase.class);
 
+    /**
+     * The Singleton instance of the Transitionfactory.
+     */
     private static TransitionFactory instance = null;
 
     /**
@@ -26,6 +29,10 @@
         super();
     }
 
+    /**
+     * Returns the Instance of this Class.
+     * @return the Instance of this Class.
+     */
     public static TransitionFactory getInstance() {
         if (instance == null) {
             instance = new TransitionFactory();
@@ -33,6 +40,13 @@
         return instance;
     }
 
+    /**
+     * Creates a new Transition using the Configuration that is provided by the
+     * XML-Node.
+     * @param configuration The configuration that should be used to initialize 
+     *                      the new Transition
+     * @return a new Transition.
+     */
     public Transition createTransition(Node configuration) {
         log.debug("TransitionFactory.createTransition");
         Transition state = null;
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java	Tue Apr 13 08:25:34 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java	Tue Apr 13 08:49:42 2010 +0000
@@ -1,19 +1,20 @@
 package de.intevation.gnv.transition;
 
-import de.intevation.artifactdatabase.Config;
-
-import de.intevation.gnv.state.InputData;
-import de.intevation.gnv.state.State;
-
-import de.intevation.gnv.state.exception.StateException;
-
 import java.util.Iterator;
 
 import org.apache.log4j.Logger;
-
 import org.w3c.dom.Node;
 
+import de.intevation.artifactdatabase.Config;
+import de.intevation.gnv.state.InputData;
+import de.intevation.gnv.state.State;
+import de.intevation.gnv.state.exception.StateException;
+
 /**
+ * Class which supports the possibility to validate if a
+ * Transition could be done using simple Valuecompare Operations.
+ * At this Time equal and notequal-operations are supported.
+ * The Comparation is casesensitive.
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
  *
  */
@@ -23,24 +24,38 @@
      * the logger, used to log exceptions and additonaly information
      */
     private static Logger log = Logger.getLogger(ValueCompareTransition.class);
-
-    private String dataName = null;
-    private String dataValue = null;
-    private String operator = null;
-
     /**
      * The UID of this Class.
      */
     private static final long serialVersionUID = -7846722158776823205L;
 
     /**
+     * The Name of the Datafield the Value  that should be compared 
+     * should be fetched from.
+     */
+    private String dataName = null;
+    /**
+     * The Value that should be set to the State.
+     */
+    private String dataValue = null;
+    /**
+     * The Operation that should be used (equal notequal)
+     */
+    private String operator = null;
+
+
+    /**
      * Constructor
      */
     public ValueCompareTransition() {
         super();
     }
 
-
+    /**
+     * validates if a Transition is valid and could be used using simple
+     * Comparevalue-Operations.
+     * @see de.intevation.gnv.transition.Transition#isValid(de.intevation.gnv.state.State)
+     */
     public boolean isValid(State state) {
 
         try {
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/package.html	Tue Apr 13 08:25:34 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/package.html	Tue Apr 13 08:49:42 2010 +0000
@@ -3,6 +3,8 @@
 <head>
 </head>
 <body>
-DOCUMENT ME!
+This package contains interfaces and classes providing the Transitionlogic to 
+switch between different States and validate if the Transition to an State is 
+possible or not.
 </body>
 </html>

http://dive4elements.wald.intevation.org