KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > discRack > spec > PersonGeneratorFactory


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

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

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

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