01: /**
02: *
03: */package com.bostechcorp.cbesb.runtime.component.script;
04:
05: /**
06: * @author sb.ji
07: *
08: */
09: public enum ScriptPropertiesEnumeration {
10: TRIGGER_TIME {
11: String getValue(ScriptEndpoint endpoint) {
12: return endpoint.getTriggerTime();
13: }
14:
15: void setValue(ScriptEndpoint endpoint, Object value) {
16: if (isSetable())
17: endpoint.setTriggerTime((String) value);
18: }
19:
20: boolean isSetable() {
21: return true;
22: }
23: },
24: TYPE {
25: String getValue(ScriptEndpoint endpoint) {
26: return endpoint.getType();
27: }
28:
29: void setValue(ScriptEndpoint endpoint, Object value) {
30: if (isSetable())
31: endpoint.setType((String) value);
32: }
33:
34: boolean isSetable() {
35: return true;
36: }
37: },
38: SCRIPT_CLASS {
39: String getValue(ScriptEndpoint endpoint) {
40: return endpoint.getScriptClass();
41: }
42:
43: void setValue(ScriptEndpoint endpoint, Object value) {
44: if (isSetable())
45: endpoint.setScriptClass((String) value);
46: }
47:
48: boolean isSetable() {
49: return true;
50: }
51: };
52: /**
53: *
54: * @param endpoint --
55: * endpoint in use
56: * @return - attribute value according to enumeration item
57: */
58: abstract String getValue(ScriptEndpoint endpoint);
59:
60: /**
61: *
62: * @param endpoint--
63: * endpoint in use
64: * @param value -
65: * sets attribute value according to enumeration item
66: */
67: abstract void setValue(ScriptEndpoint endpoint, Object value);
68:
69: /**
70: * tells either is possible or not to set the value false if the attribute
71: * is read only
72: *
73: * @return
74: */
75: abstract boolean isSetable();
76: }
|