01: /*
02: * snapper
03: *
04: * Enhydra super-servlet specification object
05: *
06: */
07: package org.enhydra.snapperAdmin.spec;
08:
09: 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 fullClassName) {
23:
24: Reader reader = null;
25:
26: Class 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 ex) {
35: System.out.println("Error on creating Reader" + ex);
36: }
37:
38: return reader;
39: }
40: }
|