comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 52:4d6a82b96059

First Implementation of the GNV-Artifacts gnv-artifacts/trunk@32 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 07 Sep 2009 15:29:24 +0000
parents
children e464d9f9d967
comparison
equal deleted inserted replaced
51:71788b63b146 52:4d6a82b96059
1 /**
2 *
3 */
4 package de.intevation.gnv.transition;
5
6 import java.util.ArrayList;
7 import java.util.Collection;
8
9 import org.apache.log4j.Logger;
10 import org.w3c.dom.Document;
11 import org.w3c.dom.Node;
12 import org.w3c.dom.NodeList;
13
14 import de.intevation.artifactdatabase.Config;
15 import de.intevation.gnv.artifacts.GNVArtifactBase;
16
17 /**
18 * @author Tim Englich <tim.englich@intevation.de>
19 *
20 */
21 public abstract class TransitionBase implements Transition {
22 /**
23 * the logger, used to log exceptions and additonaly information
24 */
25 private static Logger log = Logger.getLogger(GNVArtifactBase.class);
26
27 private String id = null;
28
29 protected String queryID = null;
30
31 private Collection<String> reachableTransitions = null;
32
33 private Transition parent = null;
34 /**
35 * Constructor
36 */
37 public TransitionBase() {
38 super();
39 }
40
41 /**
42 * @see de.intevation.gnv.transition.Transition#getID()
43 */
44 public String getID() {
45 return this.id;
46 }
47
48 /**
49 * @see de.intevation.gnv.transition.Transition#reachableTransitions()
50 */
51 public Collection<String> reachableTransitions() {
52 return this.reachableTransitions;
53 }
54
55 /**
56 * @see de.intevation.gnv.transition.Transition#setup(org.w3c.dom.Node)
57 */
58 public void setup(Node configuration) {
59
60 this.id = Config.getStringXPath(configuration,"@id");
61 log.info("Transition-ID = "+ this.id);
62 NodeList nodes = Config.getNodeSetXPath(configuration,"reachableTransitions/transition");
63 this.reachableTransitions = new ArrayList<String>(nodes.getLength());
64 for (int i = 0 ; i < nodes.getLength(); i++){
65 String reachableTransition = nodes.item(i).getTextContent();
66 log.info("ReachableTransition ==> "+ reachableTransition);
67 this.reachableTransitions.add(reachableTransition);
68
69 }
70 this.queryID = Config.getStringXPath(configuration,"queryID");
71 log.info("QueryID ==>"+ this.queryID);
72
73 }
74
75 /**
76 * @see de.intevation.gnv.transition.Transition#getParent()
77 */
78 public Transition getParent() {
79 return this.parent;
80 }
81
82 /**
83 * @see de.intevation.gnv.transition.Transition#setParent(de.intevation.gnv.transition.Transition)
84 */
85 public void setParent(Transition transition) {
86 this.parent = transition;
87 }
88 }

http://dive4elements.wald.intevation.org