Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/StateFactory.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 |
comparison
equal
deleted
inserted
replaced
795:cdade5005cba | 796:a5526908f92f |
---|---|
5 import org.apache.log4j.Logger; | 5 import org.apache.log4j.Logger; |
6 | 6 |
7 import org.w3c.dom.Node; | 7 import org.w3c.dom.Node; |
8 | 8 |
9 /** | 9 /** |
10 * This factory should be used to create new state objects with help of a | |
11 * configuration segment. | |
12 * | |
10 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> | 13 * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> |
11 * | 14 * |
12 */ | 15 */ |
13 public class StateFactory { | 16 public class StateFactory { |
14 | 17 |
24 */ | 27 */ |
25 public StateFactory() { | 28 public StateFactory() { |
26 super(); | 29 super(); |
27 } | 30 } |
28 | 31 |
32 /** | |
33 * Return the instance of this class. | |
34 * | |
35 * @return | |
36 */ | |
29 public static StateFactory getInstance() { | 37 public static StateFactory getInstance() { |
30 if (instance == null) { | 38 if (instance == null) { |
31 instance = new StateFactory(); | 39 instance = new StateFactory(); |
32 } | 40 } |
33 return instance; | 41 return instance; |
34 } | 42 } |
35 | 43 |
44 /** | |
45 * This method creates a new state with help of the information in <i> | |
46 * configuration</i> and calls its setup method after creation. | |
47 * | |
48 * @param configuration | |
49 * @return the new state. | |
50 */ | |
36 public State createState(Node configuration) { | 51 public State createState(Node configuration) { |
37 log.debug("StateFactory.createState"); | 52 log.debug("StateFactory.createState"); |
38 State state = null; | 53 State state = null; |
39 try { | 54 try { |
40 String classname = ((org.w3c.dom.Element)configuration).getAttribute("state"); | 55 String classname = ((org.w3c.dom.Element)configuration).getAttribute("state"); |
49 } | 64 } |
50 return state; | 65 return state; |
51 } | 66 } |
52 | 67 |
53 } | 68 } |
69 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |