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


001:        /*
002:         * Copyright 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.builders;
027:
028:        import com.sun.tools.doclets.internal.toolkit.util.*;
029:        import com.sun.tools.doclets.internal.toolkit.*;
030:        import com.sun.javadoc.*;
031:        import java.io.*;
032:        import java.util.*;
033:        import java.lang.reflect.*;
034:
035:        /**
036:         * Builds the summary for a given package.
037:         *
038:         * This code is not part of an API.
039:         * It is implementation that is subject to change.
040:         * Do not use it as an API
041:         * 
042:         * @author Jamie Ho
043:         * @since 1.5
044:         */
045:        public class PackageSummaryBuilder extends AbstractBuilder {
046:
047:            /**
048:             * The root element of the package summary XML is {@value}.
049:             */
050:            public static final String ROOT = "PackageDoc";
051:
052:            /**
053:             * The package being documented.
054:             */
055:            private PackageDoc packageDoc;
056:
057:            /**
058:             * The doclet specific writer that will output the result.
059:             */
060:            private PackageSummaryWriter packageWriter;
061:
062:            private PackageSummaryBuilder(Configuration configuration) {
063:                super (configuration);
064:            }
065:
066:            /**
067:             * Construct a new PackageSummaryBuilder.
068:             * @param configuration the current configuration of the doclet.
069:             * @param pkg the package being documented.
070:             * @param packageWriter the doclet specific writer that will output the 
071:             *        result.
072:             *
073:             * @return an instance of a PackageSummaryBuilder.
074:             */
075:            public static PackageSummaryBuilder getInstance(
076:                    Configuration configuration, PackageDoc pkg,
077:                    PackageSummaryWriter packageWriter) {
078:                PackageSummaryBuilder builder = new PackageSummaryBuilder(
079:                        configuration);
080:                builder.packageDoc = pkg;
081:                builder.packageWriter = packageWriter;
082:                return builder;
083:            }
084:
085:            /**
086:             * {@inheritDoc}
087:             */
088:            public void invokeMethod(String methodName, Class[] paramClasses,
089:                    Object[] params) throws Exception {
090:                if (DEBUG) {
091:                    configuration.root.printError("DEBUG: "
092:                            + this .getClass().getName() + "." + methodName);
093:                }
094:                Method method = this .getClass().getMethod(methodName,
095:                        paramClasses);
096:                method.invoke(this , params);
097:            }
098:
099:            /**
100:             * Build the package summary.
101:             */
102:            public void build() throws IOException {
103:                if (packageWriter == null) {
104:                    //Doclet does not support this output.
105:                    return;
106:                }
107:                build(LayoutParser.getInstance(configuration).parseXML(ROOT));
108:            }
109:
110:            /**
111:             * {@inheritDoc}
112:             */
113:            public String getName() {
114:                return ROOT;
115:            }
116:
117:            /**
118:             * Build the package documentation.
119:             */
120:            public void buildPackageDoc(List elements) throws Exception {
121:                build(elements);
122:                packageWriter.close();
123:                Util.copyDocFiles(configuration, Util.getPackageSourcePath(
124:                        configuration, packageDoc), DirectoryManager
125:                        .getDirectoryPath(packageDoc)
126:                        + File.separator + DocletConstants.DOC_FILES_DIR_NAME,
127:                        true);
128:            }
129:
130:            /**
131:             * Build the header of the summary.
132:             */
133:            public void buildPackageHeader() {
134:                packageWriter.writePackageHeader(Util
135:                        .getPackageName(packageDoc));
136:            }
137:
138:            /**
139:             * Build the description of the summary.
140:             */
141:            public void buildPackageDescription() {
142:                if (configuration.nocomment) {
143:                    return;
144:                }
145:                packageWriter.writePackageDescription();
146:            }
147:
148:            /**
149:             * Build the tags of the summary.
150:             */
151:            public void buildPackageTags() {
152:                if (configuration.nocomment) {
153:                    return;
154:                }
155:                packageWriter.writePackageTags();
156:            }
157:
158:            /**
159:             * Build the package summary.
160:             */
161:            public void buildSummary(List elements) {
162:                build(elements);
163:            }
164:
165:            /**
166:             * Build the overall header.
167:             */
168:            public void buildSummaryHeader() {
169:                packageWriter.writeSummaryHeader();
170:            }
171:
172:            /**
173:             * Build the overall footer.
174:             */
175:            public void buildSummaryFooter() {
176:                packageWriter.writeSummaryFooter();
177:            }
178:
179:            /**
180:             * Build the summary for the classes in this package.
181:             */
182:            public void buildClassSummary() {
183:                ClassDoc[] classes = packageDoc.isIncluded() ? packageDoc
184:                        .ordinaryClasses() : configuration.classDocCatalog
185:                        .ordinaryClasses(Util.getPackageName(packageDoc));
186:                if (classes.length > 0) {
187:                    packageWriter.writeClassesSummary(classes, configuration
188:                            .getText("doclet.Class_Summary"));
189:                }
190:            }
191:
192:            /**
193:             * Build the summary for the interfaces in this package.
194:             */
195:            public void buildInterfaceSummary() {
196:                ClassDoc[] interfaces = packageDoc.isIncluded() ? packageDoc
197:                        .interfaces() : configuration.classDocCatalog
198:                        .interfaces(Util.getPackageName(packageDoc));
199:                if (interfaces.length > 0) {
200:                    packageWriter.writeClassesSummary(interfaces, configuration
201:                            .getText("doclet.Interface_Summary"));
202:                }
203:            }
204:
205:            /**
206:             * Build the summary for the enums in this package.
207:             */
208:            public void buildAnnotationTypeSummary() {
209:                ClassDoc[] annotationTypes = packageDoc.isIncluded() ? packageDoc
210:                        .annotationTypes()
211:                        : configuration.classDocCatalog.annotationTypes(Util
212:                                .getPackageName(packageDoc));
213:                if (annotationTypes.length > 0) {
214:                    packageWriter
215:                            .writeClassesSummary(annotationTypes, configuration
216:                                    .getText("doclet.Annotation_Types_Summary"));
217:                }
218:            }
219:
220:            /**
221:             * Build the summary for the enums in this package.
222:             */
223:            public void buildEnumSummary() {
224:                ClassDoc[] enums = packageDoc.isIncluded() ? packageDoc.enums()
225:                        : configuration.classDocCatalog.enums(Util
226:                                .getPackageName(packageDoc));
227:                if (enums.length > 0) {
228:                    packageWriter.writeClassesSummary(enums, configuration
229:                            .getText("doclet.Enum_Summary"));
230:                }
231:            }
232:
233:            /**
234:             * Build the summary for the exceptions in this package.
235:             */
236:            public void buildExceptionSummary() {
237:                ClassDoc[] exceptions = packageDoc.isIncluded() ? packageDoc
238:                        .exceptions() : configuration.classDocCatalog
239:                        .exceptions(Util.getPackageName(packageDoc));
240:                if (exceptions.length > 0) {
241:                    packageWriter.writeClassesSummary(exceptions, configuration
242:                            .getText("doclet.Exception_Summary"));
243:                }
244:            }
245:
246:            /**
247:             * Build the summary for the errors in this package.
248:             */
249:            public void buildErrorSummary() {
250:                ClassDoc[] errors = packageDoc.isIncluded() ? packageDoc
251:                        .errors() : configuration.classDocCatalog.errors(Util
252:                        .getPackageName(packageDoc));
253:                if (errors.length > 0) {
254:                    packageWriter.writeClassesSummary(errors, configuration
255:                            .getText("doclet.Error_Summary"));
256:                }
257:            }
258:
259:            /**
260:             * Build the footer of the summary.
261:             */
262:            public void buildPackageFooter() {
263:                packageWriter.writePackageFooter();
264:            }
265:        }
w_ww__.___j_a__v__a___2s_.__c__om___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.