KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > transactionsDiscRack > spec > DiscFactory


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

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

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

18     public static Disc getDisc(String JavaDoc fullClassName)
19     {
20         Disc result=null;
21         Class JavaDoc objectClass = null;
22         
23         try{
24          // Create the value object
25
objectClass = Class.forName(fullClassName);
26                                    
27           result = (Disc)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   
37    }
Popular Tags