KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > finalist > jag > taglib > TagSupport


1 /* Copyright (C) 2003 Finalist IT Group
2  *
3  * This file is part of JAG - the Java J2EE Application Generator
4  *
5  * JAG is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * JAG is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  * You should have received a copy of the GNU General Public License
14  * along with JAG; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  */

17
18 package com.finalist.jag.taglib;
19
20
21 import java.util.*;
22
23 import com.finalist.jag.*;
24
25
26 /**
27  * Class TagSupport
28  *
29  *
30  * @author Wendel D. de Witte
31  * @version %I%, %G%
32  */

33 public abstract class TagSupport implements TagConstants {
34
35    /** Field writer */
36    private JagWriter writer = null;
37
38    /** Field pageContext */
39    private PageContext pageContext = null;
40
41
42    /**
43     * Constructor TagSupport
44     *
45     *
46     */

47    public TagSupport() {
48       writer = new JagTextBlockWriter();
49    }
50
51
52    /**
53     * Method setWriter
54     *
55     *
56     * @param writer
57     *
58     */

59    public void setWriter(JagWriter writer) {
60       this.writer = writer;
61    }
62
63
64    /**
65     * Method setPageContext
66     *
67     *
68     * @param pageContext
69     *
70     */

71    public void setPageContext(PageContext pageContext) {
72       this.pageContext = pageContext;
73    }
74
75
76    /**
77     * Method doStartTag
78     *
79     *
80     * @return
81     *
82     * @throws JagException
83     *
84     */

85    public abstract int doStartTag() throws JagException;
86
87
88    /**
89     * Method doEndTag
90     *
91     *
92     * @return
93     *
94     * @throws JagException
95     *
96     */

97    public int doEndTag() throws JagException {
98       return (EVAL_PAGE);
99    }
100
101
102    /**
103     * Method release
104     *
105     *
106     */

107    public void release() {
108    }
109
110
111    /**
112     * Method getWriter
113     *
114     *
115     * @return
116     *
117     */

118    public JagWriter getWriter() {
119       return writer;
120    }
121
122
123    /**
124     * Method getPageContext
125     *
126     *
127     * @return
128     *
129     */

130    public PageContext getPageContext() {
131       return pageContext;
132    }
133 }
Popular Tags