1   /*
2    * $Id: IndexedTestBean.java 438363 2006-08-30 04:48:00Z bayard $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   * 
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   * 
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */ 
19  
20  package org.apache.commons.beanutils;
21  
22  import java.util.List;
23  import java.util.ArrayList;
24  
25  /***
26   * Indexed Properties Test bean for JUnit tests for the "beanutils" component.
27   *
28   * @author Niall Pemberton
29   * @version $Revision: 438363 $ $Date: 2006-08-30 05:48:00 +0100 (Wed, 30 Aug 2006) $
30   */
31  public class IndexedTestBean {
32  
33      private String[] stringArray;
34      private List stringList;
35      private ArrayList arrayList;
36  
37  
38      // ----------------------------------------------------------- Constructors
39  
40      /***
41       * Default Constructor.
42       */
43      public IndexedTestBean() {
44      }
45  
46      /***
47       * Getter for the String[] property.
48       */
49      public String[] getStringArray() {
50          return stringArray;
51      }
52  
53      /***
54       * Setter for the String[] property.
55       */
56      public void setStringArray(String[] stringArray) {
57          this.stringArray = stringArray;
58      }
59  
60      /***
61       * Indexed Getter for the String[] property.
62       */
63      public String getStringArray(int index) {
64          return (String)stringArray[index];
65      }
66  
67      /***
68       * Indexed Setter for the String[] property.
69       */
70      public void setStringArray(int index, String value) {
71          stringArray[index] = value;
72      }
73  
74      /***
75       * Getter for the java.util.List property.
76       */
77      public List getStringList() {
78          return stringList;
79      }
80  
81      /***
82       * Setter for the java.util.List property.
83       */
84      public void setStringList(List stringList) {
85          this.stringList = stringList;
86      }
87  
88      /***
89       * Indexed Getter for the java.util.List property.
90       */
91      public String getStringList(int index) {
92          return (String)stringList.get(index);
93      }
94  
95      /***
96       * Indexed Setter for the java.util.List property.
97       */
98      public void setStringList(int index, String value) {
99          stringList.add(index, value);
100     }
101 
102     /***
103      * Getter for the java.util.ArrayList property.
104      */
105     public ArrayList getArrayList() {
106         return arrayList;
107     }
108 
109     /***
110      * Setter for the java.util.ArrayList property.
111      */
112     public void setArrayList(ArrayList arrayList) {
113         this.arrayList = arrayList;
114     }
115 
116     /***
117      * Indexed Getter for the java.util.ArrayList property.
118      */
119     public Object getArrayList(int index) {
120         return arrayList.get(index);
121     }
122 
123     /***
124      * Indexed Setter for the java.util.ArrayList property.
125      */
126     public void setArrayList(int index, Object value) {
127         arrayList.add(index, value);
128     }
129 
130 }