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