Source Code Cross Referenced for TagContext.java in  » J2EE » Sofia » com » salmonllc » jsp » tags » 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 » J2EE » Sofia » com.salmonllc.jsp.tags 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        //** Copyright Statement ***************************************************
002:        //The Salmon Open Framework for Internet Applications (SOFIA)
003:        // Copyright (C) 1999 - 2003, Salmon LLC
004:        //
005:        // This program is free software; you can redistribute it and/or
006:        // modify it under the terms of the GNU General Public License version 2
007:        // as published by the Free Software Foundation;
008:        //
009:        // This program is distributed in the hope that it will be useful,
010:        // but WITHOUT ANY WARRANTY; without even the implied warranty of
011:        // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
012:        // GNU General Public License for more details.
013:        //
014:        // You should have received a copy of the GNU General Public License
015:        // along with this program; if not, write to the Free Software
016:        // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
017:        //
018:        // For more information please visit http://www.salmonllc.com
019:        //** End Copyright Statement ***************************************************
020:
021:        package com.salmonllc.jsp.tags;
022:
023:        import java.io.IOException;
024:        import java.io.PrintWriter;
025:        import java.io.Serializable;
026:        import java.util.Stack;
027:        import java.util.Vector;
028:
029:        import javax.servlet.jsp.JspWriter;
030:
031:        import com.salmonllc.jsp.JspContainer;
032:        import com.salmonllc.jsp.JspController;
033:
034:        /**
035:         * This object is used internally by the framework to store tag library context information for the dureation of a single page request.It should not be used outside the framework.
036:         */
037:        public class TagContext implements  Serializable {
038:
039:            private JspController _controllerClass;
040:            private boolean _initializing;
041:            private boolean _dreamWeaverMode;
042:            private boolean _refIndexPrinted = false;
043:            private boolean _printVars;
044:            private boolean _generateCode;
045:            private Vector _validatorAttributes;
046:            private String _controller;
047:            public static final String TAG_CONTEXT_REQ_KEY = "$$$PageTag$$$";
048:            private Stack _containerStack = new Stack();
049:            private Stack _tagStack = new Stack();
050:
051:            public TagContext() {
052:                super ();
053:            }
054:
055:            public TagContext(String controller) {
056:                _controller = controller;
057:            }
058:
059:            public void pushContainer(JspContainer cont) {
060:                _containerStack.push(cont);
061:            }
062:
063:            public void popContainer() {
064:                if (!_containerStack.isEmpty())
065:                    _containerStack.pop();
066:            }
067:
068:            public JspContainer getCurrentContainer() {
069:                if (_containerStack.isEmpty())
070:                    return null;
071:                else
072:                    return (JspContainer) _containerStack.peek();
073:            }
074:
075:            /**
076:             * Returns the controllerClass.
077:             * @return JspController
078:             */
079:            public JspController getControllerObject() {
080:                return _controllerClass;
081:            }
082:
083:            /**
084:             * Sets the controllerClass.
085:             * @param controllerClass The controllerClass to set
086:             */
087:            public void setControllerObject(JspController controllerClass) {
088:                _controllerClass = controllerClass;
089:            }
090:
091:            /**
092:             * Returns the initializing.
093:             * @return boolean
094:             */
095:            public boolean isInitializing() {
096:                return _initializing;
097:            }
098:
099:            /**
100:             * Sets the initializing.
101:             * @param initializing The initializing to set
102:             */
103:            public void setInitializing(boolean initializing) {
104:                _initializing = initializing;
105:            }
106:
107:            /**
108:             * Returns the dreamWeaverMode.
109:             * @return boolean
110:             */
111:            public boolean getDreamWeaverMode() {
112:                return _dreamWeaverMode;
113:            }
114:
115:            /**
116:             * Returns the refIndexPrinted.
117:             * @return boolean
118:             */
119:            public boolean getRefIndexPrinted() {
120:                return _refIndexPrinted;
121:            }
122:
123:            /**
124:             * Sets the dreamWeaverMode.
125:             * @param dreamWeaverMode The dreamWeaverMode to set
126:             */
127:            public void setDreamWeaverMode(boolean dreamWeaverMode) {
128:                _dreamWeaverMode = dreamWeaverMode;
129:            }
130:
131:            /**
132:             * Sets the refIndexPrinted.
133:             * @param refIndexPrinted The refIndexPrinted to set
134:             */
135:            public void setRefIndexPrinted(boolean refIndexPrinted) {
136:                _refIndexPrinted = refIndexPrinted;
137:            }
138:
139:            /**
140:             * Returns the generateCode.
141:             * @return boolean
142:             */
143:            public boolean isGenerateCode() {
144:                return _generateCode;
145:            }
146:
147:            /**
148:             * Returns the printVars.
149:             * @return boolean
150:             */
151:            public boolean isPrintingVars() {
152:                return _printVars;
153:            }
154:
155:            /**
156:             * Sets the generateCode.
157:             * @param generateCode The generateCode to set
158:             */
159:            public void setGenerateCode(boolean generateCode) {
160:                _generateCode = generateCode;
161:            }
162:
163:            /**
164:             * Sets the printVars.
165:             * @param printVars The printVars to set
166:             */
167:            public void setPrintingVars(boolean printVars) {
168:                _printVars = printVars;
169:            }
170:
171:            /**
172:             * This adds a tag to the list of validator tags maintained by the page tag
173:             */
174:            public void addValidatorTag(ValidatorTag.Attributes att) {
175:                if (_validatorAttributes == null)
176:                    _validatorAttributes = new Vector();
177:
178:                _validatorAttributes.addElement(att);
179:
180:            }
181:
182:            /**
183:             * Returns all the validator attributes used in this tag
184:             */
185:            public Vector getValidatorAttributes() {
186:                return _validatorAttributes;
187:            }
188:
189:            void printVars(JspWriter p) throws IOException {
190:                _controllerClass.printVars(new PrintWriter(p));
191:            }
192:
193:            void generateCode(JspWriter p) throws IOException {
194:                _controllerClass.generateCode(new PrintWriter(p), _controller);
195:            }
196:
197:            void pushTag(BaseBodyTag tag) {
198:                _tagStack.push(tag);
199:            }
200:
201:            BaseBodyTag popTag() {
202:                return (BaseBodyTag) _tagStack.pop();
203:            }
204:
205:            public BaseBodyTag findAncestorWithClass(Class tagClass) {
206:                if (_tagStack.isEmpty())
207:                    return null;
208:                for (int i = (_tagStack.size() - 1); i >= 0; i--) {
209:                    BaseBodyTag t = (BaseBodyTag) _tagStack.elementAt(i);
210:                    if (tagClass.isInstance(t))
211:                        return t;
212:                }
213:                return null;
214:            }
215:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.