01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: BeanNormalSource.java 3714 2007-04-08 02:57:38Z gbevin $
07: */
08: package com.uwyn.rife.engine.testelements.exits;
09:
10: import com.uwyn.rife.config.RifeConfig;
11: import com.uwyn.rife.engine.Element;
12: import java.util.Calendar;
13:
14: public class BeanNormalSource extends Element {
15: public void processElement() {
16: Calendar cal = Calendar.getInstance(RifeConfig.Tools
17: .getDefaultTimeZone());
18: cal.clear();
19:
20: if (getInput("selector").equals("first")) {
21: cal.set(2007, 2, 13, 8, 32, 17);
22: BeanImpl1 bean = new BeanImpl1();
23: bean.setString1("stringvalue1");
24: bean.setString2("stringvalue2");
25: bean.setString3("stringvalue3");
26: bean.setEnum4(BeanImpl1.Day.MONDAY);
27: bean.setDate5(cal.getTime());
28:
29: setOutputBean(bean);
30: } else if (getInput("selector").equals("second")) {
31: BeanImpl2 bean = new BeanImpl2();
32: bean.setEnum4(BeanImpl1.Day.TUESDAY);
33: cal.set(2007, 3, 21, 8, 32, 17);
34: bean.setDate5(cal.getTime());
35: bean.setString6("stringvalue6");
36: bean.setString7("stringvalue7");
37: bean.setString8("stringvalue8");
38:
39: setOutputBean(bean);
40: }
41: exit("beanexit");
42: }
43: }
|