KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > discRack > spec > DiscGeneratorFactory


1 /*
2  * discRack
3  *
4  * Enhydra super-servlet specification object
5  *
6  */

7 package discRack.spec;
8
9 public class DiscGeneratorFactory {
10 /**
11 * Constructor can't be used.
12 */

13     private DiscGeneratorFactory() {
14     }
15
16 /**
17 * Create a DiscGenerator as state object/value object/data transfer object
18 */

19     public static DiscGenerator getDiscGenerator(String JavaDoc fullClassName) {
20         DiscGenerator result = null;
21         Class JavaDoc objectClass = null;
22
23         try {
24             // Create the value object
25
objectClass = Class.forName(fullClassName);
26             result = (DiscGenerator) objectClass.newInstance();
27        
28         } catch (Exception JavaDoc ex) {
29             System.out.println("Error on creating the object" + ex);
30         }
31
32         return result;
33     }
34 }
Popular Tags