01: /*
02: * discRack
03: *
04: * Enhydra super-servlet specification object
05: *
06: */
07: package discRack.spec;
08:
09: public class PersonFactory {
10:
11: /**
12: * Constructor can't be used.
13: */
14: private PersonFactory() {
15: }
16:
17: /**
18: * Create a Person as state object/value object/data transfer object
19: */
20: public static Person getPerson(String fullClassName)
21: throws DiscRackException {
22:
23: Person result = null;
24:
25: Class objectClass = null;
26:
27: try {
28: // Create the value object
29:
30: objectClass = Class.forName(fullClassName);
31:
32: result = (Person) objectClass.newInstance();
33:
34: } catch (Exception ex) {
35: System.out.println("Error on creating the object" + ex);
36: }
37:
38: return result;
39: }
40:
41: }
|