1
17 package org.apache.tomcat.util.descriptor.web;
18
19 import java.io.Serializable;
20 import java.util.HashMap;
21 import java.util.HashSet;
22 import java.util.Map;
23 import java.util.Set;
24
25 import org.apache.tomcat.util.res.StringManager;
26
27
28
32
33 public class ServletDef implements Serializable {
34
35 private static final long serialVersionUID = 1L;
36
37 private static final StringManager sm =
38 StringManager.getManager(Constants.PACKAGE_NAME);
39
40
41
42
43
46 private String description = null;
47
48 public String getDescription() {
49 return this.description;
50 }
51
52 public void setDescription(String description) {
53 this.description = description;
54 }
55
56
57
60 private String displayName = null;
61
62 public String getDisplayName() {
63 return this.displayName;
64 }
65
66 public void setDisplayName(String displayName) {
67 this.displayName = displayName;
68 }
69
70
71
74 private String smallIcon = null;
75
76 public String getSmallIcon() {
77 return this.smallIcon;
78 }
79
80 public void setSmallIcon(String smallIcon) {
81 this.smallIcon = smallIcon;
82 }
83
84
87 private String largeIcon = null;
88
89 public String getLargeIcon() {
90 return this.largeIcon;
91 }
92
93 public void setLargeIcon(String largeIcon) {
94 this.largeIcon = largeIcon;
95 }
96
97
98
102 private String servletName = null;
103
104 public String getServletName() {
105 return this.servletName;
106 }
107
108 public void setServletName(String servletName) {
109 if (servletName == null || servletName.equals("")) {
110 throw new IllegalArgumentException(
111 sm.getString("servletDef.invalidServletName", servletName));
112 }
113 this.servletName = servletName;
114 }
115
116
117
120 private String servletClass = null;
121
122 public String getServletClass() {
123 return this.servletClass;
124 }
125
126 public void setServletClass(String servletClass) {
127 this.servletClass = servletClass;
128 }
129
130
131
134 private String jspFile = null;
135
136 public String getJspFile() {
137 return this.jspFile;
138 }
139
140 public void setJspFile(String jspFile) {
141 this.jspFile = jspFile;
142 }
143
144
145
149 private final Map<String, String> parameters = new HashMap<>();
150
151 public Map<String, String> getParameterMap() {
152 return this.parameters;
153 }
154
155
162 public void addInitParameter(String name, String value) {
163
164 if (parameters.containsKey(name)) {
165
166
167 return;
168 }
169 parameters.put(name, value);
170
171 }
172
173
176 private Integer loadOnStartup = null;
177
178 public Integer getLoadOnStartup() {
179 return this.loadOnStartup;
180 }
181
182 public void setLoadOnStartup(String loadOnStartup) {
183 this.loadOnStartup = Integer.valueOf(loadOnStartup);
184 }
185
186
187
190 private String runAs = null;
191
192 public String getRunAs() {
193 return this.runAs;
194 }
195
196 public void setRunAs(String runAs) {
197 this.runAs = runAs;
198 }
199
200
201
204 private final Set<SecurityRoleRef> securityRoleRefs = new HashSet<>();
205
206 public Set<SecurityRoleRef> getSecurityRoleRefs() {
207 return this.securityRoleRefs;
208 }
209
210
215 public void addSecurityRoleRef(SecurityRoleRef securityRoleRef) {
216 securityRoleRefs.add(securityRoleRef);
217 }
218
219
222 private MultipartDef multipartDef = null;
223
224 public MultipartDef getMultipartDef() {
225 return this.multipartDef;
226 }
227
228 public void setMultipartDef(MultipartDef multipartDef) {
229 this.multipartDef = multipartDef;
230 }
231
232
233
236 private Boolean asyncSupported = null;
237
238 public Boolean getAsyncSupported() {
239 return this.asyncSupported;
240 }
241
242 public void setAsyncSupported(String asyncSupported) {
243 this.asyncSupported = Boolean.valueOf(asyncSupported);
244 }
245
246
247
250 private Boolean enabled = null;
251
252 public Boolean getEnabled() {
253 return this.enabled;
254 }
255
256 public void setEnabled(String enabled) {
257 this.enabled = Boolean.valueOf(enabled);
258 }
259
260
261
264 private boolean overridable = false;
265
266 public boolean isOverridable() {
267 return overridable;
268 }
269
270 public void setOverridable(boolean overridable) {
271 this.overridable = overridable;
272 }
273
274 }
275