01: /*
02: * Copyright 1999,2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.apache.jasper.runtime;
18:
19: import javax.servlet.jsp.JspContext;
20: import javax.servlet.jsp.PageContext;
21: import javax.servlet.jsp.tagext.JspFragment;
22: import javax.servlet.jsp.tagext.JspTag;
23:
24: /**
25: * Helper class from which all Jsp Fragment helper classes extend.
26: * This class allows for the emulation of numerous fragments within
27: * a single class, which in turn reduces the load on the class loader
28: * since there are potentially many JspFragments in a single page.
29: * <p>
30: * The class also provides various utility methods for JspFragment
31: * implementations.
32: *
33: * @author Mark Roth
34: */
35: public abstract class JspFragmentHelper extends JspFragment {
36:
37: protected int discriminator;
38: protected JspContext jspContext;
39: protected PageContext _jspx_page_context;
40: protected JspTag parentTag;
41:
42: public JspFragmentHelper(int discriminator, JspContext jspContext,
43: JspTag parentTag) {
44: this .discriminator = discriminator;
45: this .jspContext = jspContext;
46: this ._jspx_page_context = null;
47: if (jspContext instanceof PageContext) {
48: _jspx_page_context = (PageContext) jspContext;
49: }
50: this .parentTag = parentTag;
51: }
52:
53: public JspContext getJspContext() {
54: return this .jspContext;
55: }
56:
57: public JspTag getParentTag() {
58: return this.parentTag;
59: }
60:
61: }
|