KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > mvc > view > jsp > html > test > Bean


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.mvc.view.jsp.html.test;
8
9
10 /**
11  * <p>
12  * This class is a bean used in testing
13  * </p>
14  *
15  * @author Brian Pontarelli
16  * @since 2.0
17  * @version 2.0
18  */

19 public class Bean {
20
21     private String JavaDoc text;
22     private String JavaDoc value;
23     private Bean local;
24
25
26     /**
27      * Constructor for Bean.
28      */

29     public Bean() {
30         super();
31     }
32
33     /**
34      * Constructor for Bean.
35      */

36     public Bean(String JavaDoc text, String JavaDoc value) {
37         this.text = text;
38         this.value = value;
39         this.local = new Bean();
40     }
41
42
43     /**
44      * Retrieves local
45      *
46      * @return Returns local
47      */

48     public Bean getLocal() {
49         return local;
50     }
51
52     /**
53      * Populates local
54      *
55      * @param local The value of local
56      */

57     public void setLocal(Bean local) {
58         this.local = local;
59     }
60
61     /**
62      * Retrieves text
63      *
64      * @return Returns text
65      */

66     public String JavaDoc getText() {
67         return text;
68     }
69
70     /**
71      * Populates text
72      *
73      * @param text The value of text
74      */

75     public void setText(String JavaDoc text) {
76         this.text = text;
77     }
78
79     /**
80      * Retrieves value
81      *
82      * @return Returns value
83      */

84     public String JavaDoc getValue() {
85         return value;
86     }
87
88     /**
89      * Populates value
90      *
91      * @param value The value of value
92      */

93     public void setValue(String JavaDoc value) {
94         this.value = value;
95     }
96
97     /**
98      * compares values
99      */

100     public boolean equals(Object JavaDoc bean) {
101         return ((Bean) bean).getValue().equals(value);
102     }
103
104     /**
105      * Returns text
106      */

107     public String JavaDoc toString() {
108         return text;
109     }
110 }
111
Popular Tags