001: /**
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2006 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU General Public License as published by the
009: * Free Software Foundation; either version 2 of the License, or (at your option)
010: * any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
014: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
015: * for more details.
016: *
017: * You should have received a copy of the GNU General Public License along with
018: * this program; if not, write to the Free Software Foundation, Inc.,
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: *
022: * $Id$
023: */package com.bostechcorp.cbesb.runtime.component.cbr;
024:
025: /**
026: * @author LPS
027: *
028: */
029: public enum CbrPropertiesEnumeration {
030: ROUTING_RULES {
031: String getValue(CBREndpoint endpoint) {
032: return endpoint.getRoutingRules();
033: }
034:
035: void setValue(CBREndpoint endpoint, Object value) {
036: if (isSetable())
037: endpoint.setRoutingRules((String) value);
038: }
039:
040: boolean isSetable() {
041: return true;
042: }
043: },
044: TYPE {
045: String getValue(CBREndpoint endpoint) {
046: return endpoint.getType();
047: }
048:
049: void setValue(CBREndpoint endpoint, Object value) {
050: if (isSetable())
051: endpoint.setType((String) value);
052: }
053:
054: boolean isSetable() {
055: return true;
056: }
057: },
058: OFFSET {
059: String getValue(CBREndpoint endpoint) {
060: return endpoint.getOffset();
061: }
062:
063: void setValue(CBREndpoint endpoint, Object value) {
064: if (isSetable())
065: endpoint.setOffset((String) value);
066: }
067:
068: boolean isSetable() {
069: return true;
070: }
071: },
072: LENGHT {
073: String getValue(CBREndpoint endpoint) {
074: return endpoint.getLength();
075: }
076:
077: void setValue(CBREndpoint endpoint, Object value) {
078: if (isSetable())
079: endpoint.setLength((String) value);
080: }
081:
082: boolean isSetable() {
083: return true;
084: }
085: },
086: DELIMITIER {
087: String getValue(CBREndpoint endpoint) {
088: return endpoint.getDelimiter();
089: }
090:
091: void setValue(CBREndpoint endpoint, Object value) {
092: if (isSetable())
093: endpoint.setDelimiter((String) value);
094: }
095:
096: boolean isSetable() {
097: return true;
098: }
099: },
100: INDEX {
101: String getValue(CBREndpoint endpoint) {
102: return endpoint.getIndex();
103: }
104:
105: void setValue(CBREndpoint endpoint, Object value) {
106: if (isSetable())
107: endpoint.setIndex((String) value);
108: }
109:
110: boolean isSetable() {
111: return true;
112: }
113: },
114: EXPRESSION {
115: String getValue(CBREndpoint endpoint) {
116: return endpoint.getExpression();
117: }
118:
119: void setValue(CBREndpoint endpoint, Object value) {
120: if (isSetable())
121: endpoint.setExpression((String) value);
122: }
123:
124: boolean isSetable() {
125: return true;
126: }
127: },
128: SCRIPT_ENGINE {
129: String getValue(CBREndpoint endpoint) {
130: return endpoint.getScriptEngine();
131: }
132:
133: void setValue(CBREndpoint endpoint, Object value) {
134: if (isSetable())
135: endpoint.setScriptEngine((String) value);
136: }
137:
138: boolean isSetable() {
139: return true;
140: }
141: },
142: SCRIPT_CLASS {
143: String getValue(CBREndpoint endpoint) {
144: return endpoint.getScriptClass();
145: }
146:
147: void setValue(CBREndpoint endpoint, Object value) {
148: if (isSetable())
149: endpoint.setScriptClass((String) value);
150: }
151:
152: boolean isSetable() {
153: return true;
154: }
155: },
156: SCRIPT_METHOD {
157: String getValue(CBREndpoint endpoint) {
158: return endpoint.getScriptMethod();
159: }
160:
161: void setValue(CBREndpoint endpoint, Object value) {
162: if (isSetable())
163: endpoint.setScriptMethod((String) value);
164: }
165:
166: boolean isSetable() {
167: return true;
168: }
169: };
170: /**
171: *
172: * @param endpoint -- endpoint in use
173: * @return - attribute value according to enumeration item
174: */
175: abstract String getValue(CBREndpoint endpoint);
176:
177: /**
178: *
179: * @param endpoint-- endpoint in use
180: * @param value - sets attribute value according to enumeration item
181: */
182: abstract void setValue(CBREndpoint endpoint, Object value);
183:
184: /**
185: * tells either is possible or not to set the value
186: * false if the attribute is read only
187: * @return
188: */
189: abstract boolean isSetable();
190: }
|