comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java @ 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 79c1db3ca7cc
children 2423cefe7d39
comparison
equal deleted inserted replaced
823:499cfbbb61bc 824:7e5995c47125
1 package de.intevation.gnv.transition; 1 package de.intevation.gnv.transition;
2
3 import de.intevation.artifactdatabase.Config;
4
5 import de.intevation.gnv.state.InputData;
6 import de.intevation.gnv.state.State;
7
8 import de.intevation.gnv.state.exception.StateException;
9 2
10 import java.util.Iterator; 3 import java.util.Iterator;
11 4
12 import org.apache.log4j.Logger; 5 import org.apache.log4j.Logger;
13
14 import org.w3c.dom.Node; 6 import org.w3c.dom.Node;
15 7
8 import de.intevation.artifactdatabase.Config;
9 import de.intevation.gnv.state.InputData;
10 import de.intevation.gnv.state.State;
11 import de.intevation.gnv.state.exception.StateException;
12
16 /** 13 /**
14 * Class which supports the possibility to validate if a
15 * Transition could be done using simple Valuecompare Operations.
16 * At this Time equal and notequal-operations are supported.
17 * The Comparation is casesensitive.
17 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> 18 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
18 * 19 *
19 */ 20 */
20 public class ValueCompareTransition extends TransitionBase { 21 public class ValueCompareTransition extends TransitionBase {
21 22
22 /** 23 /**
23 * the logger, used to log exceptions and additonaly information 24 * the logger, used to log exceptions and additonaly information
24 */ 25 */
25 private static Logger log = Logger.getLogger(ValueCompareTransition.class); 26 private static Logger log = Logger.getLogger(ValueCompareTransition.class);
26
27 private String dataName = null;
28 private String dataValue = null;
29 private String operator = null;
30
31 /** 27 /**
32 * The UID of this Class. 28 * The UID of this Class.
33 */ 29 */
34 private static final long serialVersionUID = -7846722158776823205L; 30 private static final long serialVersionUID = -7846722158776823205L;
31
32 /**
33 * The Name of the Datafield the Value that should be compared
34 * should be fetched from.
35 */
36 private String dataName = null;
37 /**
38 * The Value that should be set to the State.
39 */
40 private String dataValue = null;
41 /**
42 * The Operation that should be used (equal notequal)
43 */
44 private String operator = null;
45
35 46
36 /** 47 /**
37 * Constructor 48 * Constructor
38 */ 49 */
39 public ValueCompareTransition() { 50 public ValueCompareTransition() {
40 super(); 51 super();
41 } 52 }
42 53
43 54 /**
55 * validates if a Transition is valid and could be used using simple
56 * Comparevalue-Operations.
57 * @see de.intevation.gnv.transition.Transition#isValid(de.intevation.gnv.state.State)
58 */
44 public boolean isValid(State state) { 59 public boolean isValid(State state) {
45 60
46 try { 61 try {
47 Iterator<InputData> it = state.getInputData().iterator(); 62 Iterator<InputData> it = state.getInputData().iterator();
48 while (it.hasNext()){ 63 while (it.hasNext()){

http://dive4elements.wald.intevation.org