View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.jxpath;
18  
19  /**
20   * A general purpose JavaBean for JUnit tests for the "jxpath" component.
21   *
22   * @author Dmitri Plotnikov
23   * @version $Revision: 480417 $ $Date: 2006-11-29 06:37:40 +0100 (Mi, 29 Nov 2006) $
24   */
25  public class NestedTestBean {
26      private String name = "Name 0";
27      private int integer = 1;
28  
29      public NestedTestBean() {
30      }
31  
32      public NestedTestBean(String name) {
33          this.name = name;
34      }
35  
36      public void setName(String name) {
37          this.name = name;
38      }
39  
40      /**
41       * A read-only boolean property
42       */
43      public boolean isBoolean() {
44          return false;
45      }
46  
47      /**
48       * A read-only int property
49       */
50      public int getInt() {
51          return integer;
52      }
53  
54      public void setInt(int value) {
55          this.integer = value;
56      }
57  
58      /**
59       * A read-only String property
60       */
61      public String getName() {
62          return name;
63      }
64  
65      private String[] strings =
66          new String[] { "String 1", "String 2", "String 3" };
67  
68      public String[] getStrings() {
69          return strings;
70      }
71  
72      public void setStrings(String[] array) {
73          strings = array;
74      }
75  
76      public String toString() {
77          return "Nested: " + name;
78      }
79  }