KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > web > tag > container > ContainerBeanTei


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * -----------------------------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * -----------------------------------------------------------------------------
30  * $Log: ContainerBeanTei.java,v $
31  * Revision 1.2 2005/04/09 17:19:59 colinmacleod
32  * Changed copyright text to GPL v2 explicitly.
33  *
34  * Revision 1.1.1.1 2005/03/10 17:51:35 colinmacleod
35  * Restructured ivata op around Hibernate/PicoContainer.
36  * Renamed ivata groupware.
37  *
38  * Revision 1.2 2004/11/03 16:08:49 colinmacleod
39  * Fixed handling of 'automatic' string beans.
40  *
41  * Revision 1.1 2004/09/30 15:16:02 colinmacleod
42  * Split off addressbook elements into security subproject.
43  *
44  * Revision 1.2 2004/07/14 22:44:49 colinmacleod
45  * Type now defaults to string.
46  *
47  * Revision 1.1 2004/07/13 19:41:15 colinmacleod
48  * Moved project to POJOs from EJBs.
49  * Applied PicoContainer to services layer (replacing session EJBs).
50  * Applied Hibernate to persistence layer (replacing entity EJBs).
51  * -----------------------------------------------------------------------------
52  */

53 package com.ivata.groupware.web.tag.container;
54
55 import javax.servlet.jsp.tagext.TagData JavaDoc;
56 import javax.servlet.jsp.tagext.TagExtraInfo JavaDoc;
57 import javax.servlet.jsp.tagext.VariableInfo JavaDoc;
58
59 /**
60  * <p>
61  * Provides info for creating bean scripting value from id.
62  * </p>
63  *
64  * @author Colin MacLeod
65  * <a HREF='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
66  * @since June 12, 2004
67  * @version $Revision: 1.2 $
68  */

69 public class ContainerBeanTei extends TagExtraInfo JavaDoc {
70     public final VariableInfo JavaDoc[] getVariableInfo(final TagData JavaDoc data) {
71         if (data.getAttribute("id") == null) {
72             return new VariableInfo JavaDoc[] {};
73         }
74         String JavaDoc type = (String JavaDoc) data.getAttribute("type");
75         Object JavaDoc name = data.getAttribute("name");
76         Object JavaDoc value = data.getAttribute("value");
77         if (type == null) {
78             // if there is no name specified, assume that the tag contents are
79
// used
80
if ((name == null) || (value != null)) {
81                 type = "java.lang.String";
82             } else {
83                 type = "java.lang.Object";
84             }
85         }
86         return new VariableInfo JavaDoc[] {
87             new VariableInfo JavaDoc(data.getAttributeString("id"),
88                 type,
89                 true,
90                 VariableInfo.AT_END )
91         };
92
93     }
94 }
95
Popular Tags