KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ofbiz > webapp > taglib > AbstractParameterTag


1 /*
2  * $Id: AbstractParameterTag.java 5462 2005-08-05 18:35:48Z jonesde $
3  *
4  * Copyright (c) 2002-2003 The Open For Business Project - www.ofbiz.org
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
21  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  */

25 package org.ofbiz.webapp.taglib;
26
27 import java.util.HashMap JavaDoc;
28 import java.util.Map JavaDoc;
29 import javax.servlet.jsp.JspTagException JavaDoc;
30 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
31
32 /**
33  * AbstractParameterTag - Tag which support child parameter tags.
34  *
35  * @author <a HREF="mailto:jaz@ofbiz.org">Andy Zeneski</a>
36  * @version 1.0
37  * @created March 27, 2002
38  */

39 public abstract class AbstractParameterTag extends TagSupport JavaDoc {
40
41     private Map JavaDoc inParameters = null;
42     private Map JavaDoc outParameters = null;
43
44     public void addInParameter(Object JavaDoc name, Object JavaDoc value) {
45         if (this.inParameters == null)
46             this.inParameters = new HashMap JavaDoc();
47         inParameters.put(name, value);
48     }
49
50     public Map JavaDoc getInParameters() {
51         if (this.inParameters == null)
52             return new HashMap JavaDoc();
53         else
54             return this.inParameters;
55     }
56
57     public void addOutParameter(Object JavaDoc name, Object JavaDoc alias) {
58         if (this.outParameters == null)
59             this.outParameters = new HashMap JavaDoc();
60         outParameters.put(name, alias);
61     }
62
63     public Map JavaDoc getOutParameters() {
64         if (this.outParameters == null)
65             return new HashMap JavaDoc();
66         else
67             return this.outParameters;
68     }
69
70     public int doStartTag() throws JspTagException JavaDoc {
71         inParameters = new HashMap JavaDoc();
72         return EVAL_BODY_INCLUDE;
73     }
74
75     public abstract int doEndTag() throws JspTagException JavaDoc;
76
77 }
78
Popular Tags