1 package com.sri.emo.wizard.completion;
2
3 import com.sri.emo.dbobj.IPartHandler;
4 import com.sri.emo.dbobj.ISetting;
5 import com.sri.emo.wizard.defaults.EmoWizardMetadata;
6
7 import java.util.List;
8
9
10 /***
11 * Constructs metadata for a custom part handler. Put in here any special
12 * data hooks needed to load the criteria.
13 *
14 * @author Larry Hamel
15 */
16 public class CustomPartHandlerMetadata extends EmoWizardMetadata {
17
18 /***
19 *
20 */
21 private static final long serialVersionUID = 1L;
22
23 /***
24 * name of handler class
25 */
26 private String handlerClassName;
27
28 private List inputList;
29 private ISetting settingPrototype;
30
31 /***
32 * Default constructor.
33 */
34 public CustomPartHandlerMetadata() {
35 }
36
37 /***
38 * Overrides the view id to return the custom handler entry.
39 * {@inheritDoc}
40 *
41 * @return 'CustomHandlerEntry'
42 */
43 public String getViewId() {
44 return "CustomHandlerEntry";
45 }
46
47 public void setCustomHandlerClassName(String handlerClass) {
48 this.handlerClassName = handlerClass;
49 }
50
51 /***
52 * create instance of custom handler; uses 'forName' and depends on no-args constructor
53 *
54 * @return instance of this custom handler; never null
55 */
56 public IPartHandler getCustomHandler()
57 throws ClassNotFoundException, IllegalAccessException, InstantiationException {
58 Class clazz = Class.forName(handlerClassName);
59 return (IPartHandler) clazz.newInstance();
60 }
61
62 public List getInputList() {
63 return inputList;
64 }
65
66 public void setInputList(List list) {
67 inputList = list;
68 }
69
70 public void setSettingPrototype(ISetting settingPrototype) {
71 this.settingPrototype = settingPrototype;
72 }
73
74 public ISetting getSettingPrototype() {
75 return settingPrototype;
76 }
77 }