KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > snapper > spec > IndexFactory


1 /*
2  *
3  */

4 package org.enhydra.snapper.spec;
5
6
7 public class IndexFactory {
8     
9     /**
10      * Constructor can't be used.
11      */

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

18     public static Index getIndex(String JavaDoc fullClassName)throws Exception JavaDoc {
19         
20         Index result = null;
21        
22         Class JavaDoc objectClass = null;
23
24         try {
25             // Create the value object
26

27       
28         objectClass = Class.forName(fullClassName);
29                                    
30           result = (Index)objectClass.newInstance();
31                
32                        
33                     
34       } catch (Exception JavaDoc ex) {
35             System.out.println("Error on creating the object" + ex);
36         }
37
38         return result;
39     }
40     
41      
42     
43     
44     
45     
46     
47     
48 }
Popular Tags