01: //========================================================================
02: //$Id: ServletMapping.java,v 1.2 2005/11/01 11:42:53 gregwilkins Exp $
03: //Copyright 2004-2005 Mort Bay Consulting Pty. Ltd.
04: //------------------------------------------------------------------------
05: //Licensed under the Apache License, Version 2.0 (the "License");
06: //you may not use this file except in compliance with the License.
07: //You may obtain a copy of the License at
08: //http://www.apache.org/licenses/LICENSE-2.0
09: //Unless required by applicable law or agreed to in writing, software
10: //distributed under the License is distributed on an "AS IS" BASIS,
11: //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: //See the License for the specific language governing permissions and
13: //limitations under the License.
14: //========================================================================
15:
16: package org.mortbay.jetty.servlet;
17:
18: import java.util.Arrays;
19:
20: public class ServletMapping {
21: private String[] _pathSpecs;
22: private String _servletName;
23:
24: /* ------------------------------------------------------------ */
25: public ServletMapping() {
26: }
27:
28: /* ------------------------------------------------------------ */
29: /**
30: * @return Returns the pathSpec.
31: */
32: public String[] getPathSpecs() {
33: return _pathSpecs;
34: }
35:
36: /* ------------------------------------------------------------ */
37: /**
38: * @return Returns the servletName.
39: */
40: public String getServletName() {
41: return _servletName;
42: }
43:
44: /* ------------------------------------------------------------ */
45: /**
46: * @param pathSpec The pathSpec to set.
47: */
48: public void setPathSpecs(String[] pathSpecs) {
49: _pathSpecs = pathSpecs;
50: }
51:
52: /* ------------------------------------------------------------ */
53: /**
54: * @param pathSpec The pathSpec to set.
55: */
56: public void setPathSpec(String pathSpec) {
57: _pathSpecs = new String[] { pathSpec };
58: }
59:
60: /* ------------------------------------------------------------ */
61: /**
62: * @param servletName The servletName to set.
63: */
64: public void setServletName(String servletName) {
65: _servletName = servletName;
66: }
67:
68: /* ------------------------------------------------------------ */
69: public String toString() {
70: return "(S="
71: + _servletName
72: + ","
73: + (_pathSpecs == null ? "[]" : Arrays
74: .asList(_pathSpecs).toString()) + ")";
75: }
76: }
|