KickJava   Java API By Example, From Geeks To Geeks.

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


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 com.finalist.jag.*;
22
23 /**
24  * This tag is used in conjunction with the {@link VariableTag}, to clear the variable space of a
25  * 'list' variable.
26  *
27  * @author Michael O'Connor - Finalist IT Group
28  */

29 public class ClearVariableTag extends TagSupport {
30
31    private String JavaDoc name = null;
32
33    /**
34     * Getter for name.
35     *
36     * @return the variable name to be cleared.
37     */

38    public String JavaDoc getName() {
39       return name;
40    }
41
42    /**
43     * Setter for name.
44     *
45     * @param name the variable name to be cleared.
46     */

47    public void setName(String JavaDoc name) {
48       this.name = name;
49    }
50
51    /**
52     * Method doStartTag
53     *
54     * @return a {@link TagConstant}.
55     * @throws JagException if hell freezes over.
56     */

57    public int doStartTag() throws JagException {
58       getPageContext().removeAttribute(name);
59       return EVAL_PAGE;
60    }
61 }
62
63 ;
Popular Tags