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: BeanPrefix.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine.testelements.inputs;
09:
10: import com.uwyn.rife.engine.Element;
11: import com.uwyn.rife.site.ValidationError;
12: import java.util.Set;
13:
14: public class BeanPrefix extends Element {
15: public void processElement() {
16: BeanImpl bean = getInputBean(BeanImpl.class, "prefix_");
17: boolean notnumeric_int = false;
18: boolean notnumeric_double = false;
19: boolean notnumeric_longobject = false;
20:
21: Set<ValidationError> errors = bean.getValidationErrors();
22: for (ValidationError error : errors) {
23: if (error.getIdentifier().equals("NOTNUMERIC")) {
24: if (error.getSubject().equals("int")) {
25: notnumeric_int = true;
26: }
27: if (error.getSubject().equals("double")) {
28: notnumeric_double = true;
29: }
30: if (error.getSubject().equals("longObject")) {
31: notnumeric_longobject = true;
32: }
33: }
34: }
35: if (notnumeric_int) {
36: print("NOTNUMERIC : int\n");
37: }
38: if (notnumeric_double) {
39: print("NOTNUMERIC : double\n");
40: }
41: if (notnumeric_longobject) {
42: print("NOTNUMERIC : longObject\n");
43: }
44: print(bean.getString() + "," + bean.getStringbuffer() + ","
45: + bean.getInt() + "," + bean.getInteger() + ","
46: + bean.getChar() + "," + bean.getCharacter() + ","
47: + bean.isBoolean() + "," + bean.getBooleanObject()
48: + "," + bean.getByte() + "," + bean.getByteObject()
49: + "," + bean.getDouble() + "," + bean.getDoubleObject()
50: + "," + bean.getFloat() + "," + bean.getFloatObject()
51: + "," + bean.getLong() + "," + bean.getLongObject()
52: + "," + bean.getShort() + "," + bean.getShortObject());
53: }
54: }
|