View Javadoc

1   /*
2    * Copyright 2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.myfaces.webapp.webxml;
17  
18  /***
19   * @author Manfred Geiler (latest modification by $Author: matze $)
20   * @version $Revision: 167257 $ $Date: 2004-10-13 11:51:02 +0000 (Wed, 13 Oct 2004) $
21   */
22  public class ServletMapping
23  {
24      private String _servletName;
25      private Class _servletClass;
26      private String _urlPattern;
27      private boolean _isExtensionMapping = false;
28  
29      public ServletMapping(String servletName,
30                            Class servletClass,
31                            String urlPattern)
32      {
33          _servletName = servletName;
34          _servletClass = servletClass;
35          _urlPattern = urlPattern;
36          if (_urlPattern != null)
37          {
38              if (_urlPattern.startsWith("*."))
39              {
40                  _isExtensionMapping = true;
41              }
42          }
43      }
44  
45      public boolean isExtensionMapping()
46      {
47          return _isExtensionMapping;
48      }
49  
50      public String getServletName()
51      {
52          return _servletName;
53      }
54  
55      public Class getServletClass()
56      {
57          return _servletClass;
58      }
59  
60      public String getUrlPattern()
61      {
62          return _urlPattern;
63      }
64  }