KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > cofax > taglibs > ParameterTag


1 /*
2  * ParameterTag is part of the Cofax content management system library.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Please see http://www.cofax.org for contact information and other related informaion.
19  *
20  * $Header: /cvsroot/cofax/cofax/src/org/cofax/taglibs/ParameterTag.java,v 1.3.2.1 2006/12/11 16:27:37 fxrobin Exp $
21  */

22
23 package org.cofax.taglibs;
24
25 import javax.servlet.jsp.*;
26 import javax.servlet.jsp.tagext.*;
27
28 /**
29  * ParameterTag is a child tag to PackageTag and is used to set key name and
30  * value to PackageTag glossary
31  *
32  * @param name
33  * example: name="request:publication"
34  * @param value
35  * example: value="inquirer"
36  */

37 public class ParameterTag extends BodyTagSupport {
38
39     // init & set flag for each params
40
private String JavaDoc name = "";
41
42     private String JavaDoc value = "";
43
44     /**
45      * Set's the Name for the hash glossary.
46      */

47     public void setName(String JavaDoc name) {
48
49         if (name != null && !name.equals("")) {
50             this.name = name;
51         }
52     }
53
54     /**
55      * Get's the Name.
56      */

57     public String JavaDoc getName() {
58         return (name);
59     }
60
61     /**
62      * Set's the Value for the hash glossary.
63      */

64     public void setValue(String JavaDoc value) {
65         if (value != null && !value.equals("")) {
66             this.value = value;
67         }
68     }
69
70     /**
71      * Get's the Value.
72      */

73     public String JavaDoc getValue() {
74         return (value);
75     }
76
77     /**
78      * Set's the Name/Value to the packageTag glossary.
79      */

80     public int doEndTag() throws JspException {
81         PackageTag myPackageTag = (PackageTag) findAncestorWithClass(this, PackageTag.class);
82         myPackageTag.setGlossaryValue(this.name, this.value);
83
84         return (SKIP_BODY);
85     }
86
87 } // end ParameterTag
88

89
Popular Tags