comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java @ 171:7fb9441dd8af

Format Code to max 80 Chars per Row and Cleanup gnv-artifacts/trunk@208 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 09 Oct 2009 07:54:48 +0000
parents 4d6a82b96059
children 734ac082c8d1
comparison
equal deleted inserted replaced
170:7be22e76c270 171:7fb9441dd8af
9 import de.intevation.artifactdatabase.Config; 9 import de.intevation.artifactdatabase.Config;
10 import de.intevation.gnv.artifacts.GNVArtifactBase; 10 import de.intevation.gnv.artifacts.GNVArtifactBase;
11 11
12 /** 12 /**
13 * @author Tim Englich <tim.englich@intevation.de> 13 * @author Tim Englich <tim.englich@intevation.de>
14 * 14 *
15 */ 15 */
16 public class TransitionFactory { 16 public class TransitionFactory {
17 17
18 /** 18 /**
19 * the logger, used to log exceptions and additonaly information 19 * the logger, used to log exceptions and additonaly information
20 */ 20 */
21 private static Logger log = Logger.getLogger(GNVArtifactBase.class); 21 private static Logger log = Logger.getLogger(GNVArtifactBase.class);
22 22
23 private static TransitionFactory instance = null; 23 private static TransitionFactory instance = null;
24
24 /** 25 /**
25 * Constructor 26 * Constructor
26 */ 27 */
27 public TransitionFactory() { 28 public TransitionFactory() {
28 super(); 29 super();
29 } 30 }
30 31
31 public static TransitionFactory getInstance(){ 32 public static TransitionFactory getInstance() {
32 if (instance == null){ 33 if (instance == null) {
33 instance = new TransitionFactory(); 34 instance = new TransitionFactory();
34 } 35 }
35 return instance; 36 return instance;
36 } 37 }
37 38
38 39 public Transition createTransition(Node configuration) {
39 public Transition createTransition(Node configuration){
40 log.debug("TransitionFactory.createTransition"); 40 log.debug("TransitionFactory.createTransition");
41 Transition transition = null; 41 Transition transition = null;
42 try { 42 try {
43 String classname = Config.getStringXPath(configuration, "@transition"); 43 String classname = Config.getStringXPath(configuration,
44 transition = (Transition)(Class.forName(classname).newInstance()); 44 "@transition");
45 transition = (Transition) (Class.forName(classname).newInstance());
45 transition.setup(configuration); 46 transition.setup(configuration);
46 } catch (InstantiationException e) { 47 } catch (InstantiationException e) {
47 log.error(e,e); 48 log.error(e, e);
48 } catch (IllegalAccessException e) { 49 } catch (IllegalAccessException e) {
49 log.error(e,e); 50 log.error(e, e);
50 } catch (ClassNotFoundException e) { 51 } catch (ClassNotFoundException e) {
51 log.error(e,e); 52 log.error(e, e);
52 } 53 }
53 return transition; 54 return transition;
54 } 55 }
55 56
56 } 57 }

http://dive4elements.wald.intevation.org