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