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: BeanNormal.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 BeanNormal extends Element {
14: public void processElement() {
15: if (hasInputValue("string")) {
16: print(getInput("string") + "," + getInput("stringbuffer")
17: + "," + getInput("int") + "," + getInput("integer")
18: + "," + getInput("char") + ","
19: + getElementInfo().containsInput("character") + ","
20: + getInput("boolean") + ","
21: + getInput("booleanObject") + ","
22: + getElementInfo().containsInput("byte") + ","
23: + getInput("byteObject") + "," + getInput("double")
24: + "," + getInput("doubleObject") + ","
25: + getInput("float") + "," + getInput("floatObject")
26: + "," + getInput("long") + ","
27: + getInput("longObject") + "," + getInput("short")
28: + "," + getInput("shortObject") + ","
29: + getInput("arrayList"));
30: BeanImpl bean = getInputBean(BeanImpl.class);
31: print(bean);
32: } else {
33: BeanImpl bean = new BeanImpl();
34: bean.setString("the string");
35: bean.setStringbuffer(new StringBuffer("the stringbuffer"));
36: bean.setInt(23154);
37: bean.setInteger(new Integer(893749));
38: bean.setChar('u');
39: bean.setCharacter(new Character('R'));
40: bean.setBoolean(true);
41: bean.setBooleanObject(new Boolean(false));
42: bean.setByte((byte) 120);
43: bean.setByteObject(new Byte((byte) 21));
44: bean.setDouble(34878.34);
45: bean.setDoubleObject(new Double(25435.98));
46: bean.setFloat((float) 3434.76);
47: bean.setFloatObject(new Float((float) 6534.8));
48: bean.setLong(34347897L);
49: bean.setLongObject(new Long(2335454L));
50: bean.setShort((short) 32);
51: bean.setShortObject(new Short((short) 12));
52: ArrayList list = new ArrayList();
53: list.add("one");
54: list.add(2);
55: list.add("three");
56: list.add(new Float(44.44));
57: list.add(new StringBuffer("five"));
58: bean.setArrayList(list);
59:
60: setOutputBean(bean);
61:
62: exit("exit");
63: }
64: }
65: }
|