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