Source Code Cross Referenced for TagAttributeInfo.java in  » 6.0-JDK-Core » Servlet-API-by-tomcat » javax » servlet » jsp » tagext » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » Servlet API by tomcat » javax.servlet.jsp.tagext 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 2004 The Apache Software Foundation
003         *
004         * Licensed under the Apache License, Version 2.0 (the "License");
005         * you may not use this file except in compliance with the License.
006         * You may obtain a copy of the License at
007         *
008         *     http://www.apache.org/licenses/LICENSE-2.0
009         *
010         * Unless required by applicable law or agreed to in writing, software
011         * distributed under the License is distributed on an "AS IS" BASIS,
012         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013         * See the License for the specific language governing permissions and
014         * limitations under the License.
015         */
016
017        package javax.servlet.jsp.tagext;
018
019        /**
020         * Information on the attributes of a Tag, available at translation time.
021         * This class is instantiated from the Tag Library Descriptor file (TLD).
022         *
023         * <p>
024         * Only the information needed to generate code is included here.  Other information
025         * like SCHEMA for validation belongs elsewhere.
026         */
027
028        public class TagAttributeInfo {
029            /**
030             * "id" is wired in to be ID.  There is no real benefit in having it be something else
031             * IDREFs are not handled any differently.
032             */
033
034            public static final String ID = "id";
035
036            /**
037             * Constructor for TagAttributeInfo.
038             * This class is to be instantiated only from the
039             * TagLibrary code under request from some JSP code that is parsing a
040             * TLD (Tag Library Descriptor).
041             *
042             * @param name The name of the attribute.
043             * @param required If this attribute is required in tag instances.
044             * @param type The name of the type of the attribute.
045             * @param reqTime Whether this attribute holds a request-time Attribute.
046             */
047
048            public TagAttributeInfo(String name, boolean required, String type,
049                    boolean reqTime) {
050                this .name = name;
051                this .required = required;
052                this .type = type;
053                this .reqTime = reqTime;
054            }
055
056            /**
057             * JSP 2.0 Constructor for TagAttributeInfo.
058             * This class is to be instantiated only from the
059             * TagLibrary code under request from some JSP code that is parsing a
060             * TLD (Tag Library Descriptor).
061             *
062             * @param name The name of the attribute.
063             * @param required If this attribute is required in tag instances.
064             * @param type The name of the type of the attribute.
065             * @param reqTime Whether this attribute holds a request-time Attribute.
066             * @param fragment Whether this attribute is of type JspFragment
067             *
068             * @since 2.0
069             */
070
071            public TagAttributeInfo(String name, boolean required, String type,
072                    boolean reqTime, boolean fragment) {
073                this (name, required, type, reqTime);
074                this .fragment = fragment;
075            }
076
077            /**
078             * The name of this attribute.
079             *
080             * @return the name of the attribute
081             */
082
083            public String getName() {
084                return name;
085            }
086
087            /**
088             * The type (as a String) of this attribute.
089             *
090             * @return the type of the attribute
091             */
092
093            public String getTypeName() {
094                return type;
095            }
096
097            /**
098             * Whether this attribute can hold a request-time value.
099             *
100             * @return if the attribute can hold a request-time value.
101             */
102
103            public boolean canBeRequestTime() {
104                return reqTime;
105            }
106
107            /**
108             * Whether this attribute is required.
109             *
110             * @return if the attribute is required.
111             */
112            public boolean isRequired() {
113                return required;
114            }
115
116            /**
117             * Convenience static method that goes through an array of TagAttributeInfo
118             * objects and looks for "id".
119             *
120             * @param a An array of TagAttributeInfo
121             * @return The TagAttributeInfo reference with name "id"
122             */
123            public static TagAttributeInfo getIdAttribute(TagAttributeInfo a[]) {
124                for (int i = 0; i < a.length; i++) {
125                    if (a[i].getName().equals(ID)) {
126                        return a[i];
127                    }
128                }
129                return null; // no such attribute
130            }
131
132            /**
133             * Whether this attribute is of type JspFragment.
134             *
135             * @return if the attribute is of type JspFragment
136             *
137             * @since 2.0
138             */
139            public boolean isFragment() {
140                return fragment;
141            }
142
143            /**
144             * Returns a String representation of this TagAttributeInfo, suitable
145             * for debugging purposes.
146             *
147             * @return a String representation of this TagAttributeInfo
148             */
149            public String toString() {
150                StringBuffer b = new StringBuffer();
151                b.append("name = " + name + " ");
152                b.append("type = " + type + " ");
153                b.append("reqTime = " + reqTime + " ");
154                b.append("required = " + required + " ");
155                b.append("fragment = " + fragment + " ");
156                return b.toString();
157            }
158
159            /*
160             * private fields
161             */
162            private String name;
163            private String type;
164            private boolean reqTime;
165            private boolean required;
166
167            /*
168             * private fields for JSP 2.0
169             */
170            private boolean fragment;
171        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.