View Javadoc

1   // ========================================================================
2   // Copyright (c) 2004-2009 Mort Bay Consulting Pty. Ltd.
3   // ------------------------------------------------------------------------
4   // All rights reserved. This program and the accompanying materials
5   // are made available under the terms of the Eclipse Public License v1.0
6   // and Apache License v2.0 which accompanies this distribution.
7   // The Eclipse Public License is available at 
8   // http://www.eclipse.org/legal/epl-v10.html
9   // The Apache License v2.0 is available at
10  // http://www.opensource.org/licenses/apache2.0.php
11  // You may elect to redistribute this code under either of these licenses. 
12  // ========================================================================
13  
14  package org.eclipse.jetty.servlet;
15  
16  import java.util.Arrays;
17  
18  
19  public class ServletMapping
20  {
21      private String[] _pathSpecs;
22      private String _servletName;
23  
24      /* ------------------------------------------------------------ */
25      public ServletMapping()
26      {
27      }
28      
29      /* ------------------------------------------------------------ */
30      /**
31       * @return Returns the pathSpec.
32       */
33      public String[] getPathSpecs()
34      {
35          return _pathSpecs;
36      }
37      
38      /* ------------------------------------------------------------ */
39      /**
40       * @return Returns the servletName.
41       */
42      public String getServletName()
43      {
44          return _servletName;
45      }
46      
47      /* ------------------------------------------------------------ */
48      /**
49       * @param pathSpec The pathSpec to set.
50       */
51      public void setPathSpecs(String[] pathSpecs)
52      {
53          _pathSpecs = pathSpecs;
54      }
55  
56      /* ------------------------------------------------------------ */
57      /**
58       * @param pathSpec The pathSpec to set.
59       */
60      public void setPathSpec(String pathSpec)
61      {
62          _pathSpecs = new String[]{pathSpec};
63      }
64      
65      /* ------------------------------------------------------------ */
66      /**
67       * @param servletName The servletName to set.
68       */
69      public void setServletName(String servletName)
70      {
71          _servletName = servletName;
72      }
73      
74  
75      /* ------------------------------------------------------------ */
76      public String toString()
77      {
78          return (_pathSpecs==null?"[]":Arrays.asList(_pathSpecs).toString())+"=>"+_servletName; 
79      }
80  }