KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > pageflow > internal > CachedPageFlowInfo


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  * $Header:$
17  */

18 package org.apache.beehive.netui.pageflow.internal;
19
20 import org.apache.beehive.netui.pageflow.PageFlowConstants;
21
22 import javax.servlet.ServletContext JavaDoc;
23
24
25 /**
26  * Information that is cached per pageflow class.
27  */

28 public class CachedPageFlowInfo
29         extends CachedSharedFlowRefInfo
30 {
31     /**
32      * A cached copy of the module path for this PageFlowController (the path starting at the webapp root).
33      */

34     private String JavaDoc _modulePath;
35     
36     /**
37      * A cached copy of the webapp-relative URI for this PageFlowController.
38      */

39     private String JavaDoc _URI;
40     
41     
42     public CachedPageFlowInfo( Class JavaDoc pageFlowClass, ServletContext JavaDoc servletContext )
43     {
44         AnnotationReader annReader = AnnotationReader.getAnnotationReader( pageFlowClass, servletContext );
45         initSharedFlowFields( annReader, pageFlowClass.getDeclaredFields() );
46         
47         //
48
// URI
49
//
50
String JavaDoc className = pageFlowClass.getName();
51         _URI = '/' + className.replace( '.', '/' ) + PageFlowConstants.PAGEFLOW_EXTENSION;
52         
53         //
54
// module path
55
//
56
_modulePath = InternalUtils.inferModulePathFromClassName( className );
57     }
58
59     public String JavaDoc getModulePath()
60     {
61         return _modulePath;
62     }
63
64     public void setModulePath( String JavaDoc modulePath )
65     {
66         _modulePath = modulePath;
67     }
68
69     public String JavaDoc getURI()
70     {
71         return _URI;
72     }
73
74     public void setURI( String JavaDoc URI )
75     {
76         _URI = URI;
77     }
78 }
79
Popular Tags