01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: * $Header:$
18: */
19: package org.apache.beehive.netui.pageflow.internal;
20:
21: import org.apache.beehive.netui.pageflow.PageFlowConstants;
22: import org.apache.beehive.netui.pageflow.PageFlowController;
23:
24: import java.lang.reflect.Field;
25: import java.util.ArrayList;
26: import javax.servlet.ServletContext;
27:
28: /**
29: * Information that is cached per pageflow class.
30: */
31: public class CachedPageFlowInfo extends CachedSharedFlowRefInfo {
32: /**
33: * A cached copy of the module path for this PageFlowController (the path starting at the webapp root).
34: */
35: private String _modulePath;
36:
37: /**
38: * A cached copy of the webapp-relative URI for this PageFlowController.
39: */
40: private String _URI;
41:
42: public CachedPageFlowInfo(Class pageFlowClass,
43: ServletContext servletContext) {
44: AnnotationReader annReader = AnnotationReader
45: .getAnnotationReader(pageFlowClass, servletContext);
46: initSharedFlowFields(annReader, pageFlowClass);
47:
48: // URI
49: String className = pageFlowClass.getName();
50: _URI = '/' + className.replace('.', '/')
51: + PageFlowConstants.PAGEFLOW_EXTENSION;
52:
53: // module path
54: _modulePath = InternalUtils
55: .inferModulePathFromClassName(className);
56: }
57:
58: public String getModulePath() {
59: return _modulePath;
60: }
61:
62: public void setModulePath(String modulePath) {
63: _modulePath = modulePath;
64: }
65:
66: public String getURI() {
67: return _URI;
68: }
69:
70: public void setURI(String URI) {
71: _URI = URI;
72: }
73: }
|