Source Code Cross Referenced for TagData.java in  » Sevlet-Container » apache-tomcat-6.0.14 » 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 » Sevlet Container » apache tomcat 6.0.14 » javax.servlet.jsp.tagext 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        package javax.servlet.jsp.tagext;
019:
020:        import java.util.Hashtable;
021:
022:        /**
023:         * The (translation-time only) attribute/value information for a tag instance.
024:         *
025:         * <p>
026:         * TagData is only used as an argument to the isValid, validate, and 
027:         * getVariableInfo methods of TagExtraInfo, which are invoked at 
028:         * translation time.
029:         */
030:
031:        public class TagData implements  Cloneable {
032:
033:            /**
034:             * Distinguished value for an attribute to indicate its value
035:             * is a request-time expression (which is not yet available because
036:             * TagData instances are used at translation-time).
037:             */
038:
039:            public static final Object REQUEST_TIME_VALUE = new Object();
040:
041:            /**
042:             * Constructor for TagData.
043:             *
044:             * <p>
045:             * A typical constructor may be
046:             * <pre>
047:             * static final Object[][] att = {{"connection", "conn0"}, {"id", "query0"}};
048:             * static final TagData td = new TagData(att);
049:             * </pre>
050:             *
051:             * All values must be Strings except for those holding the
052:             * distinguished object REQUEST_TIME_VALUE.
053:
054:             * @param atts the static attribute and values.  May be null.
055:             */
056:            public TagData(Object[] atts[]) {
057:                if (atts == null) {
058:                    attributes = new Hashtable<String, Object>();
059:                } else {
060:                    attributes = new Hashtable<String, Object>(atts.length);
061:                }
062:
063:                if (atts != null) {
064:                    for (int i = 0; i < atts.length; i++) {
065:                        attributes.put((String) atts[i][0], atts[i][1]);
066:                    }
067:                }
068:            }
069:
070:            /**
071:             * Constructor for a TagData.
072:             *
073:             * If you already have the attributes in a hashtable, use this
074:             * constructor. 
075:             *
076:             * @param attrs A hashtable to get the values from.
077:             */
078:            public TagData(Hashtable<String, Object> attrs) {
079:                this .attributes = attrs;
080:            }
081:
082:            /**
083:             * The value of the tag's id attribute.
084:             *
085:             * @return the value of the tag's id attribute, or null if no such
086:             *     attribute was specified.
087:             */
088:
089:            public String getId() {
090:                return getAttributeString(TagAttributeInfo.ID);
091:            }
092:
093:            /**
094:             * The value of the attribute.
095:             * If a static value is specified for an attribute that accepts a
096:             * request-time attribute expression then that static value is returned,
097:             * even if the value is provided in the body of a <jsp:attribute> action.
098:             * The distinguished object REQUEST_TIME_VALUE is only returned if
099:             * the value is specified as a request-time attribute expression
100:             * or via the &lt;jsp:attribute&gt; action with a body that contains
101:             * dynamic content (scriptlets, scripting expressions, EL expressions, 
102:             * standard actions, or custom actions).  Returns null if the attribute 
103:             * is not set. 
104:             *
105:             * @param attName the name of the attribute
106:             * @return the attribute's value
107:             */
108:
109:            public Object getAttribute(String attName) {
110:                return attributes.get(attName);
111:            }
112:
113:            /**
114:             * Set the value of an attribute.
115:             *
116:             * @param attName the name of the attribute
117:             * @param value the value.
118:             */
119:            public void setAttribute(String attName, Object value) {
120:                attributes.put(attName, value);
121:            }
122:
123:            /**
124:             * Get the value for a given attribute.
125:             *
126:             * @param attName the name of the attribute
127:             * @return the attribute value string
128:             * @throws ClassCastException if attribute value is not a String
129:             */
130:
131:            public String getAttributeString(String attName) {
132:                Object o = attributes.get(attName);
133:                if (o == null) {
134:                    return null;
135:                } else {
136:                    return (String) o;
137:                }
138:            }
139:
140:            /**
141:             * Enumerates the attributes.
142:             *
143:             *@return An enumeration of the attributes in a TagData
144:             */
145:            public java.util.Enumeration<String> getAttributes() {
146:                return attributes.keys();
147:            };
148:
149:            // private data
150:
151:            private Hashtable<String, Object> attributes; // the tagname/value map
152:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.