Source Code Cross Referenced for TagSupport.java in  » EJB-Server-resin-3.1.5 » jsdk » javax » servlet » jsp » tagext » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server resin 3.1.5 » jsdk » javax.servlet.jsp.tagext 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1998-2003 Caucho Technology -- all rights reserved
003:         *
004:         * This file is part of Resin(R) Open Source
005:         *
006:         * Each copy or derived work must preserve the copyright notice and this
007:         * notice unmodified.
008:         *
009:         * Resin Open Source is free software; you can redistribute it and/or modify
010:         * it under the terms of the GNU General Public License as published by
011:         * the Free Software Foundation; either version 2 of the License, or
012:         * (at your option) any later version.
013:         *
014:         * Resin Open Source is distributed in the hope that it will be useful,
015:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
016:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017:         * of NON-INFRINGEMENT.  See the GNU General Public License for more
018:         * details.
019:         *
020:         * You should have received a copy of the GNU General Public License
021:         * along with Resin Open Source; if not, write to the
022:         *   Free SoftwareFoundation, Inc.
023:         *   59 Temple Place, Suite 330
024:         *   Boston, MA 02111-1307  USA
025:         *
026:         * @author Scott Ferguson
027:         */
028:
029:        package javax.servlet.jsp.tagext;
030:
031:        import javax.servlet.jsp.JspException;
032:        import javax.servlet.jsp.PageContext;
033:        import java.io.Serializable;
034:        import java.util.Enumeration;
035:        import java.util.Hashtable;
036:
037:        /**
038:         * Convenient support class for creating tags which don't analyze their
039:         * bodies.  Normally, tags will extend TagSupport instead of implementing
040:         * Tag directly.
041:         */
042:        public class TagSupport implements  IterationTag, Serializable {
043:            /**
044:             * The value of the "id" attribute for the tag, if specified.
045:             */
046:            protected String id;
047:            /**
048:             * The owning PageContext.
049:             */
050:            protected PageContext pageContext;
051:            private Tag parent;
052:            private Hashtable values;
053:
054:            /**
055:             * Tags need to implement a zero-arg constructor.
056:             */
057:            public TagSupport() {
058:            }
059:
060:            /**
061:             * Processed at the beginning of the tag.
062:             *
063:             * <p>The default behavior returns SKIP_BODY to skip the tag's body.
064:             */
065:            public int doStartTag() throws JspException {
066:                return SKIP_BODY;
067:            }
068:
069:            /**
070:             * Processed to check if the tag should loop.  The default behavior
071:             * returns SKIP_BODY so it does not loop.
072:             *
073:             * @return EVAL_BODY_AGAIN to repeat the body or SKIP_BODY to stop.
074:             */
075:            public int doAfterBody() throws JspException {
076:                return SKIP_BODY;
077:            }
078:
079:            /**
080:             * Processed at the end of the tag.  The default behavior continues
081:             * with the rest of the JSP.
082:             *
083:             * @return EVAL_PAGE to continue the page SKIP_PAGE to stop.
084:             */
085:            public int doEndTag() throws JspException {
086:                return EVAL_PAGE;
087:            }
088:
089:            /**
090:             * Sets the id attribute.
091:             */
092:            public void setId(String id) {
093:                this .id = id;
094:            }
095:
096:            /**
097:             * Sets the id attribute.
098:             */
099:            public String getId() {
100:                return id;
101:            }
102:
103:            /**
104:             * Stores the page context for the JSP page.
105:             */
106:            public void setPageContext(PageContext page) {
107:                this .pageContext = page;
108:            }
109:
110:            /**
111:             * If the tag is contained in another tag, this sets the parent.
112:             *
113:             * @param parent the tag to be used as a parent. 
114:             */
115:            public void setParent(Tag parent) {
116:                this .parent = parent;
117:                if (values != null)
118:                    values.clear();
119:            }
120:
121:            /**
122:             * Returns the tag's parent.
123:             */
124:            public Tag getParent() {
125:                return this .parent;
126:            }
127:
128:            /**
129:             * Finds an ancestor of a tag matching the class.  The search is strict,
130:             * i.e. only parents will be searched, not the tag itself.
131:             *
132:             * @param tag child tag to start searching.
133:             * @param cl the class that the tag should implement.
134:             *
135:             * @return the matching tag or null.
136:             */
137:            public static final Tag findAncestorWithClass(Tag tag, Class cl) {
138:                if (tag == null || cl == null)
139:                    return null;
140:
141:                tag = tag.getParent();
142:
143:                for (; tag != null; tag = tag.getParent()) {
144:                    if (cl.isAssignableFrom(tag.getClass()))
145:                        return tag;
146:                }
147:
148:                return tag;
149:            }
150:
151:            /**
152:             * Returns an attribute from the tag.
153:             */
154:            public Object getValue(String name) {
155:                if (values == null)
156:                    return null;
157:                else
158:                    return values.get(name);
159:            }
160:
161:            /**
162:             * Enumerates the tag's attributes.
163:             */
164:            public Enumeration getValues() {
165:                if (values == null)
166:                    values = new Hashtable();
167:
168:                return values.keys();
169:            }
170:
171:            /**
172:             * Removes a value from the tag.
173:             */
174:            public void removeValue(String name) {
175:                if (values == null)
176:                    return;
177:
178:                values.remove(name);
179:            }
180:
181:            /**
182:             * Sets the value for a tag attribute.
183:             *
184:             * @param name the name of the attribute.
185:             * @param value the new value for the attribute.
186:             */
187:            public void setValue(String name, Object value) {
188:                if (values == null)
189:                    values = new Hashtable();
190:
191:                values.put(name, value);
192:            }
193:
194:            /**
195:             * Resets any custom attributes to the default value.
196:             */
197:            public void resetCustomAttributes() {
198:            }
199:
200:            /**
201:             * Cleans the tag after it completes.
202:             */
203:            public void release() {
204:                parent = null;
205:                if (values != null)
206:                    values.clear();
207:            }
208:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.