001: /*
002: * Copyright 2002,2004 The Apache Software Foundation.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.apache.commons.jexl;
017:
018: import java.util.ArrayList;
019: import java.util.List;
020:
021: /**
022: * A simple bean used for testing purposes
023: *
024: * @since 1.0
025: * @author <a href="mailto:geirm@apache.org">Geir Magnusson Jr.</a>
026: * @version $Revision: 391861 $
027: */
028: public class Foo {
029:
030: private boolean beenModified = false;
031: private String property1 = "some value";
032:
033: public String bar() {
034: return JexlTest.METHOD_STRING;
035: }
036:
037: public String getBar() {
038: return JexlTest.GET_METHOD_STRING;
039: }
040:
041: public Foo getInnerFoo() {
042: return new Foo();
043: }
044:
045: public String get(String arg) {
046: return "Repeat : " + arg;
047: }
048:
049: public String convertBoolean(boolean b) {
050: return "Boolean : " + b;
051: }
052:
053: public int getCount() {
054: return 5;
055: }
056:
057: public List getCheeseList() {
058: ArrayList answer = new ArrayList();
059: answer.add("cheddar");
060: answer.add("edam");
061: answer.add("brie");
062: return answer;
063: }
064:
065: public String[] getArray() {
066: return JexlTest.GET_METHOD_ARRAY;
067: }
068:
069: public String[][] getArray2() {
070: return JexlTest.GET_METHOD_ARRAY2;
071: }
072:
073: public boolean isSimple() {
074: return true;
075: }
076:
077: public int square(int value) {
078: return value * value;
079: }
080:
081: public boolean getTrueAndModify() {
082: beenModified = true;
083: return true;
084: }
085:
086: public boolean getModified() {
087: return beenModified;
088: }
089:
090: public int getSize() {
091: return 22;
092: }
093:
094: public String getProperty1() {
095: return property1;
096: }
097:
098: public void setProperty1(String newValue) {
099: property1 = newValue;
100: }
101: }
|