Source Code Cross Referenced for SimpleTaglet.java in  » 6.0-JDK-Modules-com.sun » tools » com » sun » tools » doclets » internal » toolkit » taglets » 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 » 6.0 JDK Modules com.sun » tools » com.sun.tools.doclets.internal.toolkit.taglets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001-2003 Sun Microsystems, Inc.  All Rights Reserved.
003:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004:         *
005:         * This code is free software; you can redistribute it and/or modify it
006:         * under the terms of the GNU General Public License version 2 only, as
007:         * published by the Free Software Foundation.  Sun designates this
008:         * particular file as subject to the "Classpath" exception as provided
009:         * by Sun in the LICENSE file that accompanied this code.
010:         *
011:         * This code is distributed in the hope that it will be useful, but WITHOUT
012:         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013:         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014:         * version 2 for more details (a copy is included in the LICENSE file that
015:         * accompanied this code).
016:         *
017:         * You should have received a copy of the GNU General Public License version
018:         * 2 along with this work; if not, write to the Free Software Foundation,
019:         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020:         *
021:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022:         * CA 95054 USA or visit www.sun.com if you need additional information or
023:         * have any questions.
024:         */
025:
026:        package com.sun.tools.doclets.internal.toolkit.taglets;
027:
028:        import com.sun.javadoc.*;
029:
030:        /**
031:         * A simple single argument custom tag.
032:         *
033:         * This code is not part of an API.
034:         * It is implementation that is subject to change.
035:         * Do not use it as an API
036:         * 
037:         * @author Jamie Ho
038:         */
039:
040:        public class SimpleTaglet extends BaseTaglet {
041:
042:            /**
043:             * The marker in the location string for excluded tags.
044:             */
045:            public static final String EXCLUDED = "x";
046:
047:            /**
048:             * The marker in the location string for packages.
049:             */
050:            public static final String PACKAGE = "p";
051:
052:            /**
053:             * The marker in the location string for types.
054:             */
055:            public static final String TYPE = "t";
056:
057:            /**
058:             * The marker in the location string for constructors.
059:             */
060:            public static final String CONSTRUCTOR = "c";
061:
062:            /**
063:             * The marker in the location string for fields.
064:             */
065:            public static final String FIELD = "f";
066:
067:            /**
068:             * The marker in the location string for methods.
069:             */
070:            public static final String METHOD = "m";
071:
072:            /**
073:             * The marker in the location string for overview.
074:             */
075:            public static final String OVERVIEW = "o";
076:
077:            /**
078:             * Use in location string when the tag is to
079:             * appear in all locations.
080:             */
081:            public static final String ALL = "a";
082:
083:            /**
084:             * The name of this tag.
085:             */
086:            protected String tagName;
087:
088:            /**
089:             * The header to output.
090:             */
091:            protected String header;
092:
093:            /**
094:             * The possible locations that this tag can appear in.
095:             */
096:            protected String locations;
097:
098:            /**
099:             * Construct a <code>SimpleTaglet</code>.
100:             * @param tagName the name of this tag
101:             * @param header the header to output.
102:             * @param locations the possible locations that this tag
103:             * can appear in.  The <code>String</code> can contain 'p'
104:             * for package, 't' for type, 'm' for method, 'c' for constructor
105:             * and 'f' for field.
106:             */
107:            public SimpleTaglet(String tagName, String header, String locations) {
108:                this .tagName = tagName;
109:                this .header = header;
110:                locations = locations.toLowerCase();
111:                if (locations.indexOf(ALL) != -1
112:                        && locations.indexOf(EXCLUDED) == -1) {
113:                    this .locations = PACKAGE + TYPE + FIELD + METHOD
114:                            + CONSTRUCTOR + OVERVIEW;
115:                } else {
116:                    this .locations = locations;
117:                }
118:            }
119:
120:            /**
121:             * Return the name of this <code>Taglet</code>.
122:             */
123:            public String getName() {
124:                return tagName;
125:            }
126:
127:            /**
128:             * Return true if this <code>SimpleTaglet</code>
129:             * is used in constructor documentation.
130:             * @return true if this <code>SimpleTaglet</code>
131:             * is used in constructor documentation and false
132:             * otherwise.
133:             */
134:            public boolean inConstructor() {
135:                return locations.indexOf(CONSTRUCTOR) != -1
136:                        && locations.indexOf(EXCLUDED) == -1;
137:            }
138:
139:            /**
140:             * Return true if this <code>SimpleTaglet</code>
141:             * is used in field documentation.
142:             * @return true if this <code>SimpleTaglet</code>
143:             * is used in field documentation and false
144:             * otherwise.
145:             */
146:            public boolean inField() {
147:                return locations.indexOf(FIELD) != -1
148:                        && locations.indexOf(EXCLUDED) == -1;
149:            }
150:
151:            /**
152:             * Return true if this <code>SimpleTaglet</code>
153:             * is used in method documentation.
154:             * @return true if this <code>SimpleTaglet</code>
155:             * is used in method documentation and false
156:             * otherwise.
157:             */
158:            public boolean inMethod() {
159:                return locations.indexOf(METHOD) != -1
160:                        && locations.indexOf(EXCLUDED) == -1;
161:            }
162:
163:            /**
164:             * Return true if this <code>SimpleTaglet</code>
165:             * is used in overview documentation.
166:             * @return true if this <code>SimpleTaglet</code>
167:             * is used in overview documentation and false
168:             * otherwise.
169:             */
170:            public boolean inOverview() {
171:                return locations.indexOf(OVERVIEW) != -1
172:                        && locations.indexOf(EXCLUDED) == -1;
173:            }
174:
175:            /**
176:             * Return true if this <code>SimpleTaglet</code>
177:             * is used in package documentation.
178:             * @return true if this <code>SimpleTaglet</code>
179:             * is used in package documentation and false
180:             * otherwise.
181:             */
182:            public boolean inPackage() {
183:                return locations.indexOf(PACKAGE) != -1
184:                        && locations.indexOf(EXCLUDED) == -1;
185:            }
186:
187:            /**
188:             * Return true if this <code>SimpleTaglet</code>
189:             * is used in type documentation (classes or interfaces).
190:             * @return true if this <code>SimpleTaglet</code>
191:             * is used in type documentation and false
192:             * otherwise.
193:             */
194:            public boolean inType() {
195:                return locations.indexOf(TYPE) != -1
196:                        && locations.indexOf(EXCLUDED) == -1;
197:            }
198:
199:            /**
200:             * Return true if this <code>Taglet</code>
201:             * is an inline tag.
202:             * @return true if this <code>Taglet</code>
203:             * is an inline tag and false otherwise.
204:             */
205:            public boolean isInlineTag() {
206:                return false;
207:            }
208:
209:            /**
210:             * {@inheritDoc}
211:             */
212:            public TagletOutput getTagletOutput(Tag tag, TagletWriter writer) {
213:                return header == null || tag == null ? null : writer
214:                        .simpleTagOutput(tag, header);
215:            }
216:
217:            /**
218:             * {@inheritDoc}
219:             */
220:            public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) {
221:                if (header == null || holder.tags(getName()).length == 0) {
222:                    return null;
223:                }
224:                return writer.simpleTagOutput(holder.tags(getName()), header);
225:            }
226:        }
w__w_w_.___j__a___v___a__2__s___.__c_o___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.