KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > webapp > webxml > ServletMapping


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: 1.2 $ $Date: 2004/10/13 11:51:01 $
21  */

22 public class ServletMapping
23 {
24     private String JavaDoc _servletName;
25     private Class JavaDoc _servletClass;
26     private String JavaDoc _urlPattern;
27     private boolean _isExtensionMapping = false;
28
29     public ServletMapping(String JavaDoc servletName,
30                           Class JavaDoc servletClass,
31                           String JavaDoc 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 JavaDoc getServletName()
51     {
52         return _servletName;
53     }
54
55     public Class JavaDoc getServletClass()
56     {
57         return _servletClass;
58     }
59
60     public String JavaDoc getUrlPattern()
61     {
62         return _urlPattern;
63     }
64 }
65
Popular Tags