KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > webapp > admin > LabelValueBean


1 /*
2  * Copyright 1999-2001,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
17
18 package org.apache.webapp.admin;
19
20 import java.io.Serializable JavaDoc;
21
22 /**
23  * Simple JavaBean to represent label-value pairs for use in collections
24  * that are utilized by the <code>&lt;form:options&gt;</code> tag.
25  *
26  * @author Craig R. McClanahan
27  * @version $Revision: 1.2 $ $Date: 2004/02/27 14:59:01 $
28  */

29
30 public class LabelValueBean implements Serializable JavaDoc {
31
32
33     // ----------------------------------------------------------- Constructors
34

35
36     /**
37      * Construct a new LabelValueBean with the specified values.
38      *
39      * @param label The label to be displayed to the user
40      * @param value The value to be returned to the server
41      */

42     public LabelValueBean(String JavaDoc label, String JavaDoc value) {
43         this.label = label;
44         this.value = value;
45     }
46
47
48     // ------------------------------------------------------------- Properties
49

50
51     /**
52      * The label to be displayed to the user.
53      */

54     protected String JavaDoc label = null;
55
56     public String JavaDoc getLabel() {
57         return (this.label);
58     }
59
60
61     /**
62      * The value to be returned to the server.
63      */

64     protected String JavaDoc value = null;
65
66     public String JavaDoc getValue() {
67         return (this.value);
68     }
69
70
71     // --------------------------------------------------------- Public Methods
72

73
74     /**
75      * Return a string representation of this object.
76      */

77     public String JavaDoc toString() {
78         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("LabelValueBean[");
79         sb.append(this.label);
80         sb.append(", ");
81         sb.append(this.value);
82         sb.append("]");
83         return (sb.toString());
84     }
85
86
87 }
88
Popular Tags