KickJava   Java API By Example, From Geeks To Geeks.

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


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.Reader;
10
11 public class ReaderFactory {
12     
13     /**
14      * Constructor can't be used.
15      */

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

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