View Javadoc

    1   //========================================================================
    2   //$Id: ServletMapping.java,v 1.2 2005/11/01 11:42:53 gregwilkins Exp $
    3   //Copyright 2004-2005 Mort Bay Consulting Pty. Ltd.
    4   //------------------------------------------------------------------------
    5   //Licensed under the Apache License, Version 2.0 (the "License");
    6   //you may not use this file except in compliance with the License.
    7   //You may obtain a copy of the License at
    8   //http://www.apache.org/licenses/LICENSE-2.0
    9   //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
    21  public class ServletMapping
    22  {
    23      private String[] _pathSpecs;
    24      private String _servletName;
    25
    26      /* ------------------------------------------------------------ */
    27      public ServletMapping()
    28      {
    29      }
    30
    31      /* ------------------------------------------------------------ */
    32      /**
    33       * @return Returns the pathSpec.
    34       */
    35      public String[] getPathSpecs()
    36      {
    37          return _pathSpecs;
    38      }
    39
    40      /* ------------------------------------------------------------ */
    41      /**
    42       * @return Returns the servletName.
    43       */
    44      public String getServletName()
    45      {
    46          return _servletName;
    47      }
    48
    49      /* ------------------------------------------------------------ */
    50      /**
    51       * @param pathSpec The pathSpec to set.
    52       */
    53      public void setPathSpecs(String[] pathSpecs)
    54      {
    55          _pathSpecs = pathSpecs;
    56      }
    57
    58      /* ------------------------------------------------------------ */
    59      /**
    60       * @param pathSpec The pathSpec to set.
    61       */
    62      public void setPathSpec(String pathSpec)
    63      {
    64          _pathSpecs = new String[]{pathSpec};
    65      }
    66
    67      /* ------------------------------------------------------------ */
    68      /**
    69       * @param servletName The servletName to set.
    70       */
    71      public void setServletName(String servletName)
    72      {
    73          _servletName = servletName;
    74      }
    75
    76
    77      /* ------------------------------------------------------------ */
    78      public String toString()
    79      {
    80          return "(S="+_servletName+","+(_pathSpecs==null?"[]":Arrays.asList(_pathSpecs).toString())+")";
    81      }
    82  }