KickJava   Java API By Example, From Geeks To Geeks.

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


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

7 package org.enhydra.snapper.spec;
8
9 import org.enhydra.snapper.api.Indexer;
10
11 public class IndexerFactory {
12     /**
13      * Constructor can't be used.
14      */

15     private IndexerFactory() {
16     }
17
18     /**
19      * Create a coin as state object/value object/data transfer object
20      */

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