001: /*
002: * $Id: PojoBean.java 471754 2006-11-06 14:55:09Z husted $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.struts.validator;
022:
023: import java.util.HashMap;
024: import java.util.Map;
025:
026: /**
027: * Test Bean class.
028: */
029: public class PojoBean {
030: protected String stringValue1;
031: protected String stringValue2;
032: protected int intValue1;
033: protected int intValue2;
034: protected Integer integerValue1;
035: protected Integer integerValue2;
036: protected PojoBean[] beans;
037: protected Map map = new HashMap();
038:
039: /**
040: * Default Constructor
041: */
042: public PojoBean() {
043: }
044:
045: /**
046: * Construct Bean with a pair of String values.
047: */
048: public PojoBean(String stringValue1, String stringValue2) {
049: setStringValue1(stringValue1);
050: setStringValue2(stringValue2);
051: }
052:
053: /**
054: * Construct Bean with a pair of integer values.
055: */
056: public PojoBean(int intValue1, int intValue2) {
057: setIntValue1(intValue1);
058: setIntValue2(intValue2);
059: setIntegerValue1(new Integer(intValue1));
060: setIntegerValue2(new Integer(intValue2));
061: }
062:
063: /**
064: * Set the stringValue1.
065: */
066: public void setStringValue1(String stringValue1) {
067: this .stringValue1 = stringValue1;
068: }
069:
070: /**
071: * Return stringValue1.
072: */
073: public String getStringValue1() {
074: return stringValue1;
075: }
076:
077: /**
078: * Set the stringValue2.
079: */
080: public void setStringValue2(String stringValue2) {
081: this .stringValue2 = stringValue2;
082: }
083:
084: /**
085: * Return stringValue2.
086: */
087: public String getStringValue2() {
088: return stringValue2;
089: }
090:
091: /**
092: * Set the intValue1.
093: */
094: public void setIntValue1(int intValue1) {
095: this .intValue1 = intValue1;
096: }
097:
098: /**
099: * Return intValue1.
100: */
101: public int getIntValue1() {
102: return intValue1;
103: }
104:
105: /**
106: * Set the intValue2.
107: */
108: public void setIntValue2(int intValue2) {
109: this .intValue2 = intValue2;
110: }
111:
112: /**
113: * Return intValue2.
114: */
115: public int getIntValue2() {
116: return intValue2;
117: }
118:
119: /**
120: * Set the integerValue1.
121: */
122: public void setIntegerValue1(Integer integerValue1) {
123: this .integerValue1 = integerValue1;
124: }
125:
126: /**
127: * Return integerValue1.
128: */
129: public Integer getIntegerValue1() {
130: return integerValue1;
131: }
132:
133: /**
134: * Set the integerValue2.
135: */
136: public void setIntegerValue2(Integer integerValue2) {
137: this .integerValue2 = integerValue2;
138: }
139:
140: /**
141: * Return integerValue2.
142: */
143: public Integer getIntegerValue2() {
144: return integerValue2;
145: }
146:
147: /**
148: * Set the PojoBean[].
149: */
150: public void setBeans(PojoBean[] beans) {
151: this .beans = beans;
152: }
153:
154: /**
155: * Return PojoBean[].
156: */
157: public PojoBean[] getBeans() {
158: return beans;
159: }
160:
161: /**
162: * Return and indexed Bean
163: */
164: public PojoBean getBean(int index) {
165: return beans[index];
166: }
167:
168: /**
169: * Return the Map
170: */
171: public Object getMap() {
172: return map;
173: }
174:
175: /**
176: * Return the Map
177: */
178: public void setMap(Map map) {
179: this .map = map;
180: }
181:
182: /**
183: * Set a Mapped property
184: */
185: public void setMapped(String key, Object value) {
186: map.put(key, value);
187: }
188:
189: /**
190: * Set a Mapped property
191: */
192: public Object getMapped(String key) {
193: return map.get(key);
194: }
195: }
|