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: NamedBeanNormal.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 NamedBeanNormal extends Element {
15: private BeanImpl bean;
16:
17: public void setThe_bean(BeanImpl bean) {
18: this .bean = bean;
19: }
20:
21: public void processElement() {
22: boolean notnumeric_int = false;
23: boolean notnumeric_double = false;
24: boolean notnumeric_longobject = false;
25:
26: Set<ValidationError> errors = bean.getValidationErrors();
27: for (ValidationError error : errors) {
28: if (error.getIdentifier().equals("NOTNUMERIC")) {
29: if (error.getSubject().equals("int")) {
30: notnumeric_int = true;
31: }
32: if (error.getSubject().equals("double")) {
33: notnumeric_double = true;
34: }
35: if (error.getSubject().equals("longObject")) {
36: notnumeric_longobject = true;
37: }
38: }
39: }
40: if (notnumeric_int) {
41: print("NOTNUMERIC : int\n");
42: }
43: if (notnumeric_double) {
44: print("NOTNUMERIC : double\n");
45: }
46: if (notnumeric_longobject) {
47: print("NOTNUMERIC : longObject\n");
48: }
49: print(bean.getString() + "," + bean.getStringbuffer() + ","
50: + bean.getInt() + "," + bean.getInteger() + ","
51: + bean.getChar() + "," + bean.getCharacter() + ","
52: + bean.isBoolean() + "," + bean.getBooleanObject()
53: + "," + bean.getByte() + "," + bean.getByteObject()
54: + "," + bean.getDouble() + "," + bean.getDoubleObject()
55: + "," + bean.getFloat() + "," + bean.getFloatObject()
56: + "," + bean.getLong() + "," + bean.getLongObject()
57: + "," + bean.getShort() + "," + bean.getShortObject());
58: }
59: }
|