01: /*
02: * Copyright 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: package examples;
17:
18: import javax.servlet.jsp.*;
19: import javax.servlet.jsp.tagext.*;
20:
21: public abstract class ExampleTagBase extends BodyTagSupport {
22:
23: public void setParent(Tag parent) {
24: this .parent = parent;
25: }
26:
27: public void setBodyContent(BodyContent bodyOut) {
28: this .bodyOut = bodyOut;
29: }
30:
31: public void setPageContext(PageContext pageContext) {
32: this .pageContext = pageContext;
33: }
34:
35: public Tag getParent() {
36: return this .parent;
37: }
38:
39: public int doStartTag() throws JspException {
40: return SKIP_BODY;
41: }
42:
43: public int doEndTag() throws JspException {
44: return EVAL_PAGE;
45: }
46:
47: // Default implementations for BodyTag methods as well
48: // just in case a tag decides to implement BodyTag.
49: public void doInitBody() throws JspException {
50: }
51:
52: public int doAfterBody() throws JspException {
53: return SKIP_BODY;
54: }
55:
56: public void release() {
57: bodyOut = null;
58: pageContext = null;
59: parent = null;
60: }
61:
62: protected BodyContent bodyOut;
63: protected PageContext pageContext;
64: protected Tag parent;
65: }
|