001: /*
002: * $Id: IndexedTestBean.java 438363 2006-08-30 04:48:00Z bayard $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one or more
005: * contributor license agreements. See the NOTICE file distributed with
006: * this work for additional information regarding copyright ownership.
007: * The ASF licenses this file to You under the Apache License, Version 2.0
008: * (the "License"); you may not use this file except in compliance with
009: * the License. You may obtain a copy of the License at
010: *
011: * http://www.apache.org/licenses/LICENSE-2.0
012: *
013: * Unless required by applicable law or agreed to in writing, software
014: * distributed under the License is distributed on an "AS IS" BASIS,
015: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016: * See the License for the specific language governing permissions and
017: * limitations under the License.
018: */
019:
020: package org.apache.commons.beanutils;
021:
022: import java.util.List;
023: import java.util.ArrayList;
024:
025: /**
026: * Indexed Properties Test bean for JUnit tests for the "beanutils" component.
027: *
028: * @author Niall Pemberton
029: * @version $Revision: 438363 $ $Date: 2006-08-30 05:48:00 +0100 (Wed, 30 Aug 2006) $
030: */
031: public class IndexedTestBean {
032:
033: private String[] stringArray;
034: private List stringList;
035: private ArrayList arrayList;
036:
037: // ----------------------------------------------------------- Constructors
038:
039: /**
040: * Default Constructor.
041: */
042: public IndexedTestBean() {
043: }
044:
045: /**
046: * Getter for the String[] property.
047: */
048: public String[] getStringArray() {
049: return stringArray;
050: }
051:
052: /**
053: * Setter for the String[] property.
054: */
055: public void setStringArray(String[] stringArray) {
056: this .stringArray = stringArray;
057: }
058:
059: /**
060: * Indexed Getter for the String[] property.
061: */
062: public String getStringArray(int index) {
063: return (String) stringArray[index];
064: }
065:
066: /**
067: * Indexed Setter for the String[] property.
068: */
069: public void setStringArray(int index, String value) {
070: stringArray[index] = value;
071: }
072:
073: /**
074: * Getter for the java.util.List property.
075: */
076: public List getStringList() {
077: return stringList;
078: }
079:
080: /**
081: * Setter for the java.util.List property.
082: */
083: public void setStringList(List stringList) {
084: this .stringList = stringList;
085: }
086:
087: /**
088: * Indexed Getter for the java.util.List property.
089: */
090: public String getStringList(int index) {
091: return (String) stringList.get(index);
092: }
093:
094: /**
095: * Indexed Setter for the java.util.List property.
096: */
097: public void setStringList(int index, String value) {
098: stringList.add(index, value);
099: }
100:
101: /**
102: * Getter for the java.util.ArrayList property.
103: */
104: public ArrayList getArrayList() {
105: return arrayList;
106: }
107:
108: /**
109: * Setter for the java.util.ArrayList property.
110: */
111: public void setArrayList(ArrayList arrayList) {
112: this .arrayList = arrayList;
113: }
114:
115: /**
116: * Indexed Getter for the java.util.ArrayList property.
117: */
118: public Object getArrayList(int index) {
119: return arrayList.get(index);
120: }
121:
122: /**
123: * Indexed Setter for the java.util.ArrayList property.
124: */
125: public void setArrayList(int index, Object value) {
126: arrayList.add(index, value);
127: }
128:
129: }
|