KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > transactionsDiscRack > spec > PersonGeneratorFactory


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

7 package transactionsDiscRack.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        
30         } catch (Exception JavaDoc ex) {
31             System.out.println("Error on creating the object" + ex);
32         }
33
34         return result;
35     
36     }
37   }
Popular Tags