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
18
19 package org.apache.tomcat.util.descriptor.web;
20
21 import java.io.Serializable;
22
23
24 /**
25  * Representation of a context initialization parameter that is configured
26  * in the server configuration file, rather than the application deployment
27  * descriptor.  This is convenient for establishing default values (which
28  * may be configured to allow application overrides or not) without having
29  * to modify the application deployment descriptor itself.
30  *
31  * @author Craig R. McClanahan
32  */

33 public class ApplicationParameter implements Serializable {
34
35     private static final long serialVersionUID = 1L;
36
37     // ------------------------------------------------------------- Properties
38
39
40     /**
41      * The description of this environment entry.
42      */

43     private String description = null;
44
45     public String getDescription() {
46         return this.description;
47     }
48
49     public void setDescription(String description) {
50         this.description = description;
51     }
52
53
54     /**
55      * The name of this application parameter.
56      */

57     private String name = null;
58
59     public String getName() {
60         return this.name;
61     }
62
63     public void setName(String name) {
64         this.name = name;
65     }
66
67
68     /**
69      * Does this application parameter allow overrides by the application
70      * deployment descriptor?
71      */

72     private boolean override = true;
73
74     public boolean getOverride() {
75         return this.override;
76     }
77
78     public void setOverride(boolean override) {
79         this.override = override;
80     }
81
82
83     /**
84      * The value of this application parameter.
85      */

86     private String value = null;
87
88     public String getValue() {
89         return this.value;
90     }
91
92     public void setValue(String value) {
93         this.value = value;
94     }
95
96     // --------------------------------------------------------- Public Methods
97
98
99     /**
100      * Return a String representation of this object.
101      */

102     @Override
103     public String toString() {
104
105         StringBuilder sb = new StringBuilder("ApplicationParameter[");
106         sb.append("name=");
107         sb.append(name);
108         if (description != null) {
109             sb.append(", description=");
110             sb.append(description);
111         }
112         sb.append(", value=");
113         sb.append(value);
114         sb.append(", override=");
115         sb.append(override);
116         sb.append("]");
117         return sb.toString();
118
119     }
120
121
122 }
123