1   /*
2    * Copyright 2002,2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.commons.jexl;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  /***
22   * A simple bean used for testing purposes
23   * 
24   * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
25   * @version $Revision: 1.6 $
26   */
27  public class Foo {
28      
29      private boolean beenModified = false;
30      
31      public String bar()
32      {
33          return JexlTest.METHOD_STRING;
34      }
35  
36      public String getBar()
37      {
38          return JexlTest.GET_METHOD_STRING;
39      }
40  
41      public Foo getInnerFoo()
42      {
43          return new Foo();
44      }
45  
46      public String get(String arg)
47      {
48          return "Repeat : " + arg;
49      }
50  
51      public String convertBoolean(boolean b)
52      {
53          return "Boolean : " + b;
54      }
55  
56      public int getCount() {
57          return 5;
58      }
59  
60      public List getCheeseList()
61      {
62          ArrayList answer = new ArrayList();
63          answer.add("cheddar");
64          answer.add("edam");
65          answer.add("brie");
66          return answer;
67      }
68  
69      public String[] getArray()
70      {
71          return JexlTest.GET_METHOD_ARRAY;
72      }
73  
74      public String[][] getArray2()
75      {
76          return JexlTest.GET_METHOD_ARRAY2;
77      }
78  
79      public boolean isSimple()
80      {
81          return true;
82      }
83  
84      public int square(int value)
85      {
86          return value * value;
87      }
88  
89      public boolean getTrueAndModify()
90      {
91          beenModified = true;
92          return true;
93      }
94  
95      public boolean getModified()
96      {
97          return beenModified;
98      }
99  
100 
101     public int getSize()
102     {
103         return 22;
104     }
105 }