Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.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 org.apache.log4j.Logger; | |
4 import org.w3c.dom.Node; | |
2 | 5 |
3 import de.intevation.gnv.artifacts.GNVArtifactBase; | 6 import de.intevation.gnv.artifacts.GNVArtifactBase; |
4 | 7 |
5 import org.apache.log4j.Logger; | |
6 | |
7 import org.w3c.dom.Node; | |
8 | |
9 /** | 8 /** |
9 * This Factoryclass instantiates Objects of Type Transition. | |
10 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> | 10 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
11 * | 11 * |
12 */ | 12 */ |
13 public class TransitionFactory { | 13 public class TransitionFactory { |
14 | 14 |
15 /** | 15 /** |
16 * the logger, used to log exceptions and additonaly information | 16 * the logger, used to log exceptions and additonaly information |
17 */ | 17 */ |
18 private static Logger log = Logger.getLogger(GNVArtifactBase.class); | 18 private static Logger log = Logger.getLogger(GNVArtifactBase.class); |
19 | 19 |
20 /** | |
21 * The Singleton instance of the Transitionfactory. | |
22 */ | |
20 private static TransitionFactory instance = null; | 23 private static TransitionFactory instance = null; |
21 | 24 |
22 /** | 25 /** |
23 * Constructor | 26 * Constructor |
24 */ | 27 */ |
25 public TransitionFactory() { | 28 public TransitionFactory() { |
26 super(); | 29 super(); |
27 } | 30 } |
28 | 31 |
32 /** | |
33 * Returns the Instance of this Class. | |
34 * @return the Instance of this Class. | |
35 */ | |
29 public static TransitionFactory getInstance() { | 36 public static TransitionFactory getInstance() { |
30 if (instance == null) { | 37 if (instance == null) { |
31 instance = new TransitionFactory(); | 38 instance = new TransitionFactory(); |
32 } | 39 } |
33 return instance; | 40 return instance; |
34 } | 41 } |
35 | 42 |
43 /** | |
44 * Creates a new Transition using the Configuration that is provided by the | |
45 * XML-Node. | |
46 * @param configuration The configuration that should be used to initialize | |
47 * the new Transition | |
48 * @return a new Transition. | |
49 */ | |
36 public Transition createTransition(Node configuration) { | 50 public Transition createTransition(Node configuration) { |
37 log.debug("TransitionFactory.createTransition"); | 51 log.debug("TransitionFactory.createTransition"); |
38 Transition state = null; | 52 Transition state = null; |
39 try { | 53 try { |
40 String classname = ((org.w3c.dom.Element)configuration).getAttribute("transition"); | 54 String classname = ((org.w3c.dom.Element)configuration).getAttribute("transition"); |