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: BeanNormalOutjection.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine.testelements.outputs;
09:
10: import com.uwyn.rife.engine.Element;
11: import java.util.ArrayList;
12:
13: public class BeanNormalOutjection extends Element {
14: private BeanImpl mInbean;
15:
16: public void setInbean1(BeanImpl inbean) {
17: mInbean = inbean;
18: }
19:
20: public BeanImpl getOutbean1() {
21: BeanImpl bean = new BeanImpl();
22: bean.setString("the string");
23: bean.setStringbuffer(new StringBuffer("the stringbuffer"));
24: bean.setInt(23154);
25: bean.setInteger(new Integer(893749));
26: bean.setChar('u');
27: bean.setCharacter(new Character('R'));
28: bean.setBoolean(true);
29: bean.setBooleanObject(new Boolean(false));
30: bean.setByte((byte) 120);
31: bean.setByteObject(new Byte((byte) 21));
32: bean.setDouble(34878.34);
33: bean.setDoubleObject(new Double(25435.98));
34: bean.setFloat((float) 3434.76);
35: bean.setFloatObject(new Float((float) 6534.8));
36: bean.setLong(34347897L);
37: bean.setLongObject(new Long(2335454L));
38: bean.setShort((short) 32);
39: bean.setShortObject(new Short((short) 12));
40: ArrayList list = new ArrayList();
41: list.add("one");
42: list.add(2);
43: list.add("three");
44: list.add(new Float(44.44));
45: list.add(new StringBuffer("five"));
46: bean.setArrayList(list);
47:
48: return bean;
49: }
50:
51: public void processElement() {
52: if (hasInputValue("string")) {
53: print(getInput("string") + "," + getInput("stringbuffer")
54: + "," + getInput("int") + "," + getInput("integer")
55: + "," + getInput("char") + ","
56: + getElementInfo().containsInput("character") + ","
57: + getInput("boolean") + ","
58: + getInput("booleanObject") + ","
59: + getElementInfo().containsInput("byte") + ","
60: + getInput("byteObject") + "," + getInput("double")
61: + "," + getInput("doubleObject") + ","
62: + getInput("float") + "," + getInput("floatObject")
63: + "," + getInput("long") + ","
64: + getInput("longObject") + "," + getInput("short")
65: + "," + getInput("shortObject") + ","
66: + getInput("arrayList"));
67: print(mInbean);
68: } else {
69: exit("exit");
70: }
71: }
72: }
|