Mon, 21 Jan 2013 00:45:35 -0500
8006124: javadoc/doclet should be updated to support profiles
Reviewed-by: jjg
1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java Wed Jan 16 12:00:21 2013 -0800 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java Mon Jan 21 00:45:35 2013 -0500 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -150,7 +150,20 @@ 1.11 String tableSummary, Content body) { 1.12 if (packages.length > 0) { 1.13 Arrays.sort(packages); 1.14 - addAllClassesLink(body); 1.15 + HtmlTree div = new HtmlTree(HtmlTag.DIV); 1.16 + div.addStyle(HtmlStyle.indexHeader); 1.17 + addAllClassesLink(div); 1.18 + if (configuration.showProfiles) { 1.19 + addAllProfilesLink(div); 1.20 + } 1.21 + body.addContent(div); 1.22 + if (configuration.showProfiles) { 1.23 + String profileSummary = configuration.getText("doclet.Profiles"); 1.24 + String profilesTableSummary = configuration.getText("doclet.Member_Table_Summary", 1.25 + configuration.getText("doclet.Profile_Summary"), 1.26 + configuration.getText("doclet.profiles")); 1.27 + addProfilesList(profileSummary, profilesTableSummary, body); 1.28 + } 1.29 addPackagesList(packages, text, tableSummary, body); 1.30 } 1.31 } 1.32 @@ -182,10 +195,29 @@ 1.33 } 1.34 1.35 /** 1.36 - * Do nothing. This will be overridden in PackageIndexFrameWriter. 1.37 + * Do nothing. This will be overridden. 1.38 * 1.39 - * @param body the document tree to which the all classes link will be added 1.40 + * @param div the document tree to which the all classes link will be added 1.41 */ 1.42 - protected void addAllClassesLink(Content body) { 1.43 + protected void addAllClassesLink(Content div) { 1.44 + } 1.45 + 1.46 + /** 1.47 + * Do nothing. This will be overridden. 1.48 + * 1.49 + * @param div the document tree to which the all profiles link will be added 1.50 + */ 1.51 + protected void addAllProfilesLink(Content div) { 1.52 + } 1.53 + 1.54 + /** 1.55 + * Do nothing. This will be overridden. 1.56 + * 1.57 + * @param profileSummary the profile summary heading 1.58 + * @param profilesTableSummary the profiles table summary information 1.59 + * @param body the content tree to which the profiles list will be added 1.60 + */ 1.61 + protected void addProfilesList(String profileSummary, String profilesTableSummary, 1.62 + Content body) { 1.63 } 1.64 }
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AbstractProfileIndexWriter.java Mon Jan 21 00:45:35 2013 -0500 2.3 @@ -0,0 +1,276 @@ 2.4 +/* 2.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 2.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.7 + * 2.8 + * This code is free software; you can redistribute it and/or modify it 2.9 + * under the terms of the GNU General Public License version 2 only, as 2.10 + * published by the Free Software Foundation. Oracle designates this 2.11 + * particular file as subject to the "Classpath" exception as provided 2.12 + * by Oracle in the LICENSE file that accompanied this code. 2.13 + * 2.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 2.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2.17 + * version 2 for more details (a copy is included in the LICENSE file that 2.18 + * accompanied this code). 2.19 + * 2.20 + * You should have received a copy of the GNU General Public License version 2.21 + * 2 along with this work; if not, write to the Free Software Foundation, 2.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2.23 + * 2.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2.25 + * or visit www.oracle.com if you need additional information or have any 2.26 + * questions. 2.27 + */ 2.28 + 2.29 +package com.sun.tools.doclets.formats.html; 2.30 + 2.31 +import java.io.*; 2.32 + 2.33 +import com.sun.tools.javac.sym.Profiles; 2.34 +import com.sun.tools.doclets.formats.html.markup.*; 2.35 +import com.sun.tools.doclets.internal.toolkit.*; 2.36 +import com.sun.tools.doclets.internal.toolkit.util.DocPath; 2.37 + 2.38 +/** 2.39 + * Abstract class to generate the profile overview files in 2.40 + * Frame and Non-Frame format. This will be sub-classed to 2.41 + * generate profile-overview-frame.html as well as profile-overview-summary.html. 2.42 + * 2.43 + * <p><b>This is NOT part of any supported API. 2.44 + * If you write code that depends on this, you do so at your own risk. 2.45 + * This code and its internal interfaces are subject to change or 2.46 + * deletion without notice.</b> 2.47 + * 2.48 + * @author Bhavesh Patel 2.49 + */ 2.50 +public abstract class AbstractProfileIndexWriter extends HtmlDocletWriter { 2.51 + 2.52 + /** 2.53 + * Profiles to be documented. 2.54 + */ 2.55 + protected Profiles profiles; 2.56 + 2.57 + /** 2.58 + * Constructor. Also initializes the profiles variable. 2.59 + * 2.60 + * @param configuration The current configuration 2.61 + * @param filename Name of the profile index file to be generated. 2.62 + */ 2.63 + public AbstractProfileIndexWriter(ConfigurationImpl configuration, 2.64 + DocPath filename) throws IOException { 2.65 + super(configuration, filename); 2.66 + profiles = configuration.profiles; 2.67 + } 2.68 + 2.69 + /** 2.70 + * Adds the navigation bar header to the documentation tree. 2.71 + * 2.72 + * @param body the document tree to which the navigation bar header will be added 2.73 + */ 2.74 + protected abstract void addNavigationBarHeader(Content body); 2.75 + 2.76 + /** 2.77 + * Adds the navigation bar footer to the documentation tree. 2.78 + * 2.79 + * @param body the document tree to which the navigation bar footer will be added 2.80 + */ 2.81 + protected abstract void addNavigationBarFooter(Content body); 2.82 + 2.83 + /** 2.84 + * Adds the overview header to the documentation tree. 2.85 + * 2.86 + * @param body the document tree to which the overview header will be added 2.87 + */ 2.88 + protected abstract void addOverviewHeader(Content body); 2.89 + 2.90 + /** 2.91 + * Adds the profiles list to the documentation tree. 2.92 + * 2.93 + * @param profiles profiles object 2.94 + * @param text caption for the table 2.95 + * @param tableSummary summary for the table 2.96 + * @param body the document tree to which the profiles list will be added 2.97 + */ 2.98 + protected abstract void addProfilesList(Profiles profiles, String text, 2.99 + String tableSummary, Content body); 2.100 + 2.101 + /** 2.102 + * Adds the profile packages list to the documentation tree. 2.103 + * 2.104 + * @param profiles profiles object 2.105 + * @param text caption for the table 2.106 + * @param tableSummary summary for the table 2.107 + * @param body the document tree to which the profiles list will be added 2.108 + * @param profileName the name for the profile being documented 2.109 + */ 2.110 + protected abstract void addProfilePackagesList(Profiles profiles, String text, 2.111 + String tableSummary, Content body, String profileName); 2.112 + 2.113 + /** 2.114 + * Generate and prints the contents in the profile index file. Call appropriate 2.115 + * methods from the sub-class in order to generate Frame or Non 2.116 + * Frame format. 2.117 + * 2.118 + * @param title the title of the window. 2.119 + * @param includeScript boolean set true if windowtitle script is to be included 2.120 + */ 2.121 + protected void buildProfileIndexFile(String title, boolean includeScript) throws IOException { 2.122 + String windowOverview = configuration.getText(title); 2.123 + Content body = getBody(includeScript, getWindowTitle(windowOverview)); 2.124 + addNavigationBarHeader(body); 2.125 + addOverviewHeader(body); 2.126 + addIndex(body); 2.127 + addOverview(body); 2.128 + addNavigationBarFooter(body); 2.129 + printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title, 2.130 + configuration.doctitle), includeScript, body); 2.131 + } 2.132 + 2.133 + /** 2.134 + * Generate and prints the contents in the profile packages index file. Call appropriate 2.135 + * methods from the sub-class in order to generate Frame or Non 2.136 + * Frame format. 2.137 + * 2.138 + * @param title the title of the window. 2.139 + * @param includeScript boolean set true if windowtitle script is to be included 2.140 + * @param profileName the name of the profile being documented 2.141 + */ 2.142 + protected void buildProfilePackagesIndexFile(String title, 2.143 + boolean includeScript, String profileName) throws IOException { 2.144 + String windowOverview = configuration.getText(title); 2.145 + Content body = getBody(includeScript, getWindowTitle(windowOverview)); 2.146 + addNavigationBarHeader(body); 2.147 + addOverviewHeader(body); 2.148 + addProfilePackagesIndex(body, profileName); 2.149 + addOverview(body); 2.150 + addNavigationBarFooter(body); 2.151 + printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title, 2.152 + configuration.doctitle), includeScript, body); 2.153 + } 2.154 + 2.155 + /** 2.156 + * Default to no overview, override to add overview. 2.157 + * 2.158 + * @param body the document tree to which the overview will be added 2.159 + */ 2.160 + protected void addOverview(Content body) throws IOException { 2.161 + } 2.162 + 2.163 + /** 2.164 + * Adds the frame or non-frame profile index to the documentation tree. 2.165 + * 2.166 + * @param body the document tree to which the index will be added 2.167 + */ 2.168 + protected void addIndex(Content body) { 2.169 + addIndexContents(profiles, "doclet.Profile_Summary", 2.170 + configuration.getText("doclet.Member_Table_Summary", 2.171 + configuration.getText("doclet.Profile_Summary"), 2.172 + configuration.getText("doclet.profiles")), body); 2.173 + } 2.174 + 2.175 + /** 2.176 + * Adds the frame or non-frame profile packages index to the documentation tree. 2.177 + * 2.178 + * @param body the document tree to which the index will be added 2.179 + * @param profileName the name of the profile being documented 2.180 + */ 2.181 + protected void addProfilePackagesIndex(Content body, String profileName) { 2.182 + addProfilePackagesIndexContents(profiles, "doclet.Profile_Summary", 2.183 + configuration.getText("doclet.Member_Table_Summary", 2.184 + configuration.getText("doclet.Profile_Summary"), 2.185 + configuration.getText("doclet.profiles")), body, profileName); 2.186 + } 2.187 + 2.188 + /** 2.189 + * Adds profile index contents. Call appropriate methods from 2.190 + * the sub-classes. Adds it to the body HtmlTree 2.191 + * 2.192 + * @param profiles profiles to be documented 2.193 + * @param text string which will be used as the heading 2.194 + * @param tableSummary summary for the table 2.195 + * @param body the document tree to which the index contents will be added 2.196 + */ 2.197 + protected void addIndexContents(Profiles profiles, String text, 2.198 + String tableSummary, Content body) { 2.199 + if (profiles.getProfileCount() > 0) { 2.200 + HtmlTree div = new HtmlTree(HtmlTag.DIV); 2.201 + div.addStyle(HtmlStyle.indexHeader); 2.202 + addAllClassesLink(div); 2.203 + addAllPackagesLink(div); 2.204 + body.addContent(div); 2.205 + addProfilesList(profiles, text, tableSummary, body); 2.206 + } 2.207 + } 2.208 + 2.209 + /** 2.210 + * Adds profile packages index contents. Call appropriate methods from 2.211 + * the sub-classes. Adds it to the body HtmlTree 2.212 + * 2.213 + * @param profiles profiles to be documented 2.214 + * @param text string which will be used as the heading 2.215 + * @param tableSummary summary for the table 2.216 + * @param body the document tree to which the index contents will be added 2.217 + * @param profileName the name of the profile being documented 2.218 + */ 2.219 + protected void addProfilePackagesIndexContents(Profiles profiles, String text, 2.220 + String tableSummary, Content body, String profileName) { 2.221 + HtmlTree div = new HtmlTree(HtmlTag.DIV); 2.222 + div.addStyle(HtmlStyle.indexHeader); 2.223 + addAllClassesLink(div); 2.224 + addAllPackagesLink(div); 2.225 + addAllProfilesLink(div); 2.226 + body.addContent(div); 2.227 + addProfilePackagesList(profiles, text, tableSummary, body, profileName); 2.228 + } 2.229 + 2.230 + /** 2.231 + * Adds the doctitle to the documentation tree, if it is specified on the command line. 2.232 + * 2.233 + * @param body the document tree to which the title will be added 2.234 + */ 2.235 + protected void addConfigurationTitle(Content body) { 2.236 + if (configuration.doctitle.length() > 0) { 2.237 + Content title = new RawHtml(configuration.doctitle); 2.238 + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, 2.239 + HtmlStyle.title, title); 2.240 + Content div = HtmlTree.DIV(HtmlStyle.header, heading); 2.241 + body.addContent(div); 2.242 + } 2.243 + } 2.244 + 2.245 + /** 2.246 + * Returns highlighted "Overview", in the navigation bar as this is the 2.247 + * overview page. 2.248 + * 2.249 + * @return a Content object to be added to the documentation tree 2.250 + */ 2.251 + protected Content getNavLinkContents() { 2.252 + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, overviewLabel); 2.253 + return li; 2.254 + } 2.255 + 2.256 + /** 2.257 + * Do nothing. This will be overridden in ProfileIndexFrameWriter. 2.258 + * 2.259 + * @param div the document tree to which the all classes link will be added 2.260 + */ 2.261 + protected void addAllClassesLink(Content div) { 2.262 + } 2.263 + 2.264 + /** 2.265 + * Do nothing. This will be overridden in ProfileIndexFrameWriter. 2.266 + * 2.267 + * @param div the document tree to which the all packages link will be added 2.268 + */ 2.269 + protected void addAllPackagesLink(Content div) { 2.270 + } 2.271 + 2.272 + /** 2.273 + * Do nothing. This will be overridden in ProfilePackageIndexFrameWriter. 2.274 + * 2.275 + * @param div the document tree to which the all profiles link will be added 2.276 + */ 2.277 + protected void addAllProfilesLink(Content div) { 2.278 + } 2.279 +}
3.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Wed Jan 16 12:00:21 2013 -0800 3.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java Mon Jan 21 00:45:35 2013 -0500 3.3 @@ -1,5 +1,5 @@ 3.4 /* 3.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 3.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 3.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3.8 * 3.9 * This code is free software; you can redistribute it and/or modify it 3.10 @@ -25,10 +25,10 @@ 3.11 3.12 package com.sun.tools.doclets.formats.html; 3.13 3.14 -import java.io.IOException; 3.15 import java.util.*; 3.16 3.17 import com.sun.javadoc.*; 3.18 +import com.sun.tools.javac.jvm.Profile; 3.19 import com.sun.tools.doclets.formats.html.markup.*; 3.20 import com.sun.tools.doclets.internal.toolkit.*; 3.21 import com.sun.tools.doclets.internal.toolkit.builders.*; 3.22 @@ -165,6 +165,20 @@ 3.23 bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); 3.24 HtmlTree div = new HtmlTree(HtmlTag.DIV); 3.25 div.addStyle(HtmlStyle.header); 3.26 + if (configuration.showProfiles) { 3.27 + String sep = ""; 3.28 + int profile = configuration.profiles.getProfile(getTypeNameForProfile(classDoc)); 3.29 + if (profile > 0) { 3.30 + Content profNameContent = new StringContent(); 3.31 + for (int i = profile; i < configuration.profiles.getProfileCount(); i++) { 3.32 + profNameContent.addContent(sep); 3.33 + profNameContent.addContent(Profile.lookup(i).name); 3.34 + sep = ", "; 3.35 + } 3.36 + Content profileNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, profNameContent); 3.37 + div.addContent(profileNameDiv); 3.38 + } 3.39 + } 3.40 if (pkgname.length() > 0) { 3.41 Content pkgNameContent = new StringContent(pkgname); 3.42 Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent);
4.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java Wed Jan 16 12:00:21 2013 -0800 4.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java Mon Jan 21 00:45:35 2013 -0500 4.3 @@ -1,5 +1,5 @@ 4.4 /* 4.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 4.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 4.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.8 * 4.9 * This code is free software; you can redistribute it and/or modify it 4.10 @@ -65,7 +65,7 @@ 4.11 public FrameOutputWriter(ConfigurationImpl configuration, 4.12 DocPath filename) throws IOException { 4.13 super(configuration, filename); 4.14 - noOfPackages = configuration.packages.length; 4.15 + noOfPackages = configuration.packages.length; 4.16 } 4.17 4.18 /** 4.19 @@ -135,7 +135,13 @@ 4.20 protected Content getFrameDetails() { 4.21 HtmlTree frameset = HtmlTree.FRAMESET("20%,80%", null, "Documentation frame", 4.22 "top.loadFrames()"); 4.23 - if (noOfPackages <= 1) { 4.24 + if (configuration.showProfiles) { 4.25 + HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames", 4.26 + "top.loadFrames()"); 4.27 + addAllProfilesFrameTag(leftFrameset); 4.28 + addAllClassesFrameTag(leftFrameset); 4.29 + frameset.addContent(leftFrameset); 4.30 + } else if (noOfPackages <= 1) { 4.31 addAllClassesFrameTag(frameset); 4.32 } else if (noOfPackages > 1) { 4.33 HtmlTree leftFrameset = HtmlTree.FRAMESET(null, "30%,70%", "Left frames", 4.34 @@ -150,6 +156,17 @@ 4.35 } 4.36 4.37 /** 4.38 + * Add the FRAME tag for the frame that lists all profiles. 4.39 + * 4.40 + * @param contentTree the content tree to which the information will be added 4.41 + */ 4.42 + private void addAllProfilesFrameTag(Content contentTree) { 4.43 + HtmlTree frame = HtmlTree.FRAME(DocPaths.PROFILE_OVERVIEW_FRAME.getPath(), 4.44 + "profileListFrame", configuration.getText("doclet.All_Profiles")); 4.45 + contentTree.addContent(frame); 4.46 + } 4.47 + 4.48 + /** 4.49 * Add the FRAME tag for the frame that lists all packages. 4.50 * 4.51 * @param contentTree the content tree to which the information will be added
5.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java Wed Jan 16 12:00:21 2013 -0800 5.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java Mon Jan 21 00:45:35 2013 -0500 5.3 @@ -1,5 +1,5 @@ 5.4 /* 5.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 5.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 5.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5.8 * 5.9 * This code is free software; you can redistribute it and/or modify it 5.10 @@ -28,6 +28,8 @@ 5.11 import java.util.*; 5.12 5.13 import com.sun.javadoc.*; 5.14 +import com.sun.tools.javac.sym.Profiles; 5.15 +import com.sun.tools.javac.jvm.Profile; 5.16 import com.sun.tools.doclets.internal.toolkit.*; 5.17 import com.sun.tools.doclets.internal.toolkit.builders.*; 5.18 import com.sun.tools.doclets.internal.toolkit.util.*; 5.19 @@ -202,6 +204,44 @@ 5.20 /** 5.21 * {@inheritDoc} 5.22 */ 5.23 + protected void generateProfileFiles() throws Exception { 5.24 + if (configuration.showProfiles) { 5.25 + ProfileIndexFrameWriter.generate(configuration); 5.26 + Profile prevProfile = null, nextProfile; 5.27 + for (int i = 1; i < configuration.profiles.getProfileCount(); i++) { 5.28 + ProfilePackageIndexFrameWriter.generate(configuration, Profile.lookup(i).name); 5.29 + PackageDoc[] packages = configuration.profilePackages.get( 5.30 + Profile.lookup(i).name); 5.31 + PackageDoc prev = null, next; 5.32 + for (int j = 0; j < packages.length; j++) { 5.33 + // if -nodeprecated option is set and the package is marked as 5.34 + // deprecated, do not generate the profilename-package-summary.html 5.35 + // and profilename-package-frame.html pages for that package. 5.36 + if (!(configuration.nodeprecated && Util.isDeprecated(packages[j]))) { 5.37 + ProfilePackageFrameWriter.generate(configuration, packages[j], i); 5.38 + next = (j + 1 < packages.length 5.39 + && packages[j + 1].name().length() > 0) ? packages[j + 1] : null; 5.40 + AbstractBuilder profilePackageSummaryBuilder = 5.41 + configuration.getBuilderFactory().getProfilePackageSummaryBuilder( 5.42 + packages[j], prev, next, Profile.lookup(i)); 5.43 + profilePackageSummaryBuilder.build(); 5.44 + prev = packages[j]; 5.45 + } 5.46 + } 5.47 + nextProfile = (i + 1 < configuration.profiles.getProfileCount()) ? 5.48 + Profile.lookup(i + 1) : null; 5.49 + AbstractBuilder profileSummaryBuilder = 5.50 + configuration.getBuilderFactory().getProfileSummaryBuilder( 5.51 + Profile.lookup(i), prevProfile, nextProfile); 5.52 + profileSummaryBuilder.build(); 5.53 + prevProfile = Profile.lookup(i); 5.54 + } 5.55 + } 5.56 + } 5.57 + 5.58 + /** 5.59 + * {@inheritDoc} 5.60 + */ 5.61 protected void generatePackageFiles(ClassTree classtree) throws Exception { 5.62 PackageDoc[] packages = configuration.packages; 5.63 if (packages.length > 1) {
6.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Wed Jan 16 12:00:21 2013 -0800 6.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java Mon Jan 21 00:45:35 2013 -0500 6.3 @@ -1,5 +1,5 @@ 6.4 /* 6.5 - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 6.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 6.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6.8 * 6.9 * This code is free software; you can redistribute it and/or modify it 6.10 @@ -301,6 +301,107 @@ 6.11 } 6.12 6.13 /** 6.14 + * Get Profile Package link, with target frame. 6.15 + * 6.16 + * @param pd the packageDoc object 6.17 + * @param target name of the target frame 6.18 + * @param label tag for the link 6.19 + * @param profileName the name of the profile being documented 6.20 + * @return a content for the target profile packages link 6.21 + */ 6.22 + public Content getTargetProfilePackageLink(PackageDoc pd, String target, 6.23 + Content label, String profileName) { 6.24 + return getHyperLink(pathString(pd, DocPaths.profilePackageSummary(profileName)), 6.25 + label, "", target); 6.26 + } 6.27 + 6.28 + /** 6.29 + * Get Profile link, with target frame. 6.30 + * 6.31 + * @param target name of the target frame 6.32 + * @param label tag for the link 6.33 + * @param profileName the name of the profile being documented 6.34 + * @return a content for the target profile link 6.35 + */ 6.36 + public Content getTargetProfileLink(String target, Content label, 6.37 + String profileName) { 6.38 + return getHyperLink(pathToRoot.resolve( 6.39 + DocPaths.profileSummary(profileName)), label, "", target); 6.40 + } 6.41 + 6.42 + /** 6.43 + * Get the type name for profile search. 6.44 + * 6.45 + * @param cd the classDoc object for which the type name conversion is needed 6.46 + * @return a type name string for the type 6.47 + */ 6.48 + public String getTypeNameForProfile(ClassDoc cd) { 6.49 + StringBuilder typeName = 6.50 + new StringBuilder((cd.containingPackage()).name().replace(".", "/")); 6.51 + typeName.append("/") 6.52 + .append(cd.name().replace(".", "$")); 6.53 + return typeName.toString(); 6.54 + } 6.55 + 6.56 + /** 6.57 + * Check if a type belongs to a profile. 6.58 + * 6.59 + * @param cd the classDoc object that needs to be checked 6.60 + * @param profileValue the profile in which the type needs to be checked 6.61 + * @return true if the type is in the profile 6.62 + */ 6.63 + public boolean isTypeInProfile(ClassDoc cd, int profileValue) { 6.64 + return (configuration.profiles.getProfile(getTypeNameForProfile(cd)) <= profileValue); 6.65 + } 6.66 + 6.67 + public void addClassesSummary(ClassDoc[] classes, String label, 6.68 + String tableSummary, String[] tableHeader, Content summaryContentTree, 6.69 + int profileValue) { 6.70 + if(classes.length > 0) { 6.71 + Arrays.sort(classes); 6.72 + Content caption = getTableCaption(label); 6.73 + Content table = HtmlTree.TABLE(HtmlStyle.packageSummary, 0, 3, 0, 6.74 + tableSummary, caption); 6.75 + table.addContent(getSummaryTableHeader(tableHeader, "col")); 6.76 + Content tbody = new HtmlTree(HtmlTag.TBODY); 6.77 + for (int i = 0; i < classes.length; i++) { 6.78 + if (!isTypeInProfile(classes[i], profileValue)) { 6.79 + continue; 6.80 + } 6.81 + if (!Util.isCoreClass(classes[i]) || 6.82 + !configuration.isGeneratedDoc(classes[i])) { 6.83 + continue; 6.84 + } 6.85 + Content classContent = new RawHtml(getLink(new LinkInfoImpl( 6.86 + configuration, LinkInfoImpl.CONTEXT_PACKAGE, classes[i], 6.87 + false))); 6.88 + Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent); 6.89 + HtmlTree tr = HtmlTree.TR(tdClass); 6.90 + if (i%2 == 0) 6.91 + tr.addStyle(HtmlStyle.altColor); 6.92 + else 6.93 + tr.addStyle(HtmlStyle.rowColor); 6.94 + HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD); 6.95 + tdClassDescription.addStyle(HtmlStyle.colLast); 6.96 + if (Util.isDeprecated(classes[i])) { 6.97 + tdClassDescription.addContent(deprecatedLabel); 6.98 + if (classes[i].tags("deprecated").length > 0) { 6.99 + addSummaryDeprecatedComment(classes[i], 6.100 + classes[i].tags("deprecated")[0], tdClassDescription); 6.101 + } 6.102 + } 6.103 + else 6.104 + addSummaryComment(classes[i], tdClassDescription); 6.105 + tr.addContent(tdClassDescription); 6.106 + tbody.addContent(tr); 6.107 + } 6.108 + table.addContent(tbody); 6.109 + Content li = HtmlTree.LI(HtmlStyle.blockList, table); 6.110 + summaryContentTree.addContent(li); 6.111 + } 6.112 + } 6.113 + 6.114 + /** 6.115 * Generates the HTML document tree and prints it out. 6.116 * 6.117 * @param metakeywords Array of String keywords for META tag. Each element
7.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java Wed Jan 16 12:00:21 2013 -0800 7.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java Mon Jan 21 00:45:35 2013 -0500 7.3 @@ -1,5 +1,5 @@ 7.4 /* 7.5 - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 7.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 7.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 7.8 * 7.9 * This code is free software; you can redistribute it and/or modify it 7.10 @@ -145,13 +145,26 @@ 7.11 * Adds "All Classes" link for the top of the left-hand frame page to the 7.12 * documentation tree. 7.13 * 7.14 - * @param body the Content object to which the all classes link should be added 7.15 + * @param div the Content object to which the all classes link should be added 7.16 */ 7.17 - protected void addAllClassesLink(Content body) { 7.18 + protected void addAllClassesLink(Content div) { 7.19 Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME, 7.20 allclassesLabel, "", "packageFrame"); 7.21 - Content div = HtmlTree.DIV(HtmlStyle.indexHeader, linkContent); 7.22 - body.addContent(div); 7.23 + Content span = HtmlTree.SPAN(linkContent); 7.24 + div.addContent(span); 7.25 + } 7.26 + 7.27 + /** 7.28 + * Adds "All Profiles" link for the top of the left-hand frame page to the 7.29 + * documentation tree. 7.30 + * 7.31 + * @param div the Content object to which the all profiles link should be added 7.32 + */ 7.33 + protected void addAllProfilesLink(Content div) { 7.34 + Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME, 7.35 + allprofilesLabel, "", "profileListFrame"); 7.36 + Content span = HtmlTree.SPAN(linkContent); 7.37 + div.addContent(span); 7.38 } 7.39 7.40 /**
8.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Wed Jan 16 12:00:21 2013 -0800 8.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java Mon Jan 21 00:45:35 2013 -0500 8.3 @@ -1,5 +1,5 @@ 8.4 /* 8.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 8.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 8.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 8.8 * 8.9 * This code is free software; you can redistribute it and/or modify it 8.10 @@ -29,6 +29,7 @@ 8.11 import java.util.*; 8.12 8.13 import com.sun.javadoc.*; 8.14 +import com.sun.tools.javac.jvm.Profile; 8.15 import com.sun.tools.doclets.formats.html.markup.*; 8.16 import com.sun.tools.doclets.internal.toolkit.*; 8.17 import com.sun.tools.doclets.internal.toolkit.util.*; 8.18 @@ -122,6 +123,21 @@ 8.19 /** 8.20 * {@inheritDoc} 8.21 */ 8.22 + protected void addProfilesList(String profileSummary, String profilesTableSummary, 8.23 + Content body) { 8.24 + Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, profilesTableSummary, 8.25 + getTableCaption(profileSummary)); 8.26 + table.addContent(getSummaryTableHeader(profileTableHeader, "col")); 8.27 + Content tbody = new HtmlTree(HtmlTag.TBODY); 8.28 + addProfilesList(tbody); 8.29 + table.addContent(tbody); 8.30 + Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table); 8.31 + body.addContent(div); 8.32 + } 8.33 + 8.34 + /** 8.35 + * {@inheritDoc} 8.36 + */ 8.37 protected void addPackagesList(PackageDoc[] packages, String text, 8.38 String tableSummary, Content body) { 8.39 Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, tableSummary, 8.40 @@ -135,6 +151,31 @@ 8.41 } 8.42 8.43 /** 8.44 + * Adds list of profiles in the index table. Generate link to each profile. 8.45 + * 8.46 + * @param tbody the documentation tree to which the list will be added 8.47 + */ 8.48 + protected void addProfilesList(Content tbody) { 8.49 + for (int i = 1; i < configuration.profiles.getProfileCount(); i++) { 8.50 + String profileName = Profile.lookup(i).name; 8.51 + Content profileLinkContent = getTargetProfileLink("classFrame", 8.52 + new StringContent(profileName), profileName); 8.53 + Content tdProfile = HtmlTree.TD(HtmlStyle.colFirst, profileLinkContent); 8.54 + HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); 8.55 + tdSummary.addStyle(HtmlStyle.colLast); 8.56 + tdSummary.addContent(getSpace()); 8.57 + HtmlTree tr = HtmlTree.TR(tdProfile); 8.58 + tr.addContent(tdSummary); 8.59 + if (i % 2 == 0) { 8.60 + tr.addStyle(HtmlStyle.altColor); 8.61 + } else { 8.62 + tr.addStyle(HtmlStyle.rowColor); 8.63 + } 8.64 + tbody.addContent(tr); 8.65 + } 8.66 + } 8.67 + 8.68 + /** 8.69 * Adds list of packages in the index table. Generate link to each package. 8.70 * 8.71 * @param packages Packages to which link is to be generated
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfileIndexFrameWriter.java Mon Jan 21 00:45:35 2013 -0500 9.3 @@ -0,0 +1,173 @@ 9.4 +/* 9.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 9.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 9.7 + * 9.8 + * This code is free software; you can redistribute it and/or modify it 9.9 + * under the terms of the GNU General Public License version 2 only, as 9.10 + * published by the Free Software Foundation. Oracle designates this 9.11 + * particular file as subject to the "Classpath" exception as provided 9.12 + * by Oracle in the LICENSE file that accompanied this code. 9.13 + * 9.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 9.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 9.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 9.17 + * version 2 for more details (a copy is included in the LICENSE file that 9.18 + * accompanied this code). 9.19 + * 9.20 + * You should have received a copy of the GNU General Public License version 9.21 + * 2 along with this work; if not, write to the Free Software Foundation, 9.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 9.23 + * 9.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 9.25 + * or visit www.oracle.com if you need additional information or have any 9.26 + * questions. 9.27 + */ 9.28 + 9.29 +package com.sun.tools.doclets.formats.html; 9.30 + 9.31 +import java.io.*; 9.32 + 9.33 +import com.sun.tools.javac.sym.Profiles; 9.34 +import com.sun.tools.doclets.formats.html.markup.*; 9.35 +import com.sun.tools.doclets.internal.toolkit.*; 9.36 +import com.sun.tools.doclets.internal.toolkit.util.*; 9.37 +import com.sun.tools.javac.jvm.Profile; 9.38 + 9.39 +/** 9.40 + * Generate the profile index for the left-hand frame in the generated output. 9.41 + * A click on the profile name in this frame will update the page in the top 9.42 + * left hand frame with the listing of packages of the clicked profile. 9.43 + * 9.44 + * <p><b>This is NOT part of any supported API. 9.45 + * If you write code that depends on this, you do so at your own risk. 9.46 + * This code and its internal interfaces are subject to change or 9.47 + * deletion without notice.</b> 9.48 + * 9.49 + * @author Bhavesh Patel 9.50 + */ 9.51 +public class ProfileIndexFrameWriter extends AbstractProfileIndexWriter { 9.52 + 9.53 + /** 9.54 + * Construct the ProfileIndexFrameWriter object. 9.55 + * 9.56 + * @param configuration the configuration object 9.57 + * @param filename Name of the profile index file to be generated. 9.58 + */ 9.59 + public ProfileIndexFrameWriter(ConfigurationImpl configuration, 9.60 + DocPath filename) throws IOException { 9.61 + super(configuration, filename); 9.62 + } 9.63 + 9.64 + /** 9.65 + * Generate the profile index file named "profile-overview-frame.html". 9.66 + * @throws DocletAbortException 9.67 + * @param configuration the configuration object 9.68 + */ 9.69 + public static void generate(ConfigurationImpl configuration) { 9.70 + ProfileIndexFrameWriter profilegen; 9.71 + DocPath filename = DocPaths.PROFILE_OVERVIEW_FRAME; 9.72 + try { 9.73 + profilegen = new ProfileIndexFrameWriter(configuration, filename); 9.74 + profilegen.buildProfileIndexFile("doclet.Window_Overview", false); 9.75 + profilegen.close(); 9.76 + } catch (IOException exc) { 9.77 + configuration.standardmessage.error( 9.78 + "doclet.exception_encountered", 9.79 + exc.toString(), filename); 9.80 + throw new DocletAbortException(); 9.81 + } 9.82 + } 9.83 + 9.84 + /** 9.85 + * {@inheritDoc} 9.86 + */ 9.87 + protected void addProfilesList(Profiles profiles, String text, 9.88 + String tableSummary, Content body) { 9.89 + Content heading = HtmlTree.HEADING(HtmlConstants.PROFILE_HEADING, true, 9.90 + profilesLabel); 9.91 + Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading); 9.92 + HtmlTree ul = new HtmlTree(HtmlTag.UL); 9.93 + ul.addAttr(HtmlAttr.TITLE, profilesLabel.toString()); 9.94 + for (int i = 1; i < profiles.getProfileCount(); i++) { 9.95 + ul.addContent(getProfile(i)); 9.96 + } 9.97 + div.addContent(ul); 9.98 + body.addContent(div); 9.99 + } 9.100 + 9.101 + /** 9.102 + * Gets each profile name as a separate link. 9.103 + * 9.104 + * @param profile the profile being documented 9.105 + * @return content for the profile link 9.106 + */ 9.107 + protected Content getProfile(int profile) { 9.108 + Content profileLinkContent; 9.109 + Content profileLabel; 9.110 + String profileName = (Profile.lookup(profile)).name; 9.111 + profileLabel = new StringContent(profileName); 9.112 + profileLinkContent = getHyperLink(DocPaths.profileFrame(profileName), profileLabel, "", 9.113 + "profileListFrame"); 9.114 + Content li = HtmlTree.LI(profileLinkContent); 9.115 + return li; 9.116 + } 9.117 + 9.118 + /** 9.119 + * {@inheritDoc} 9.120 + */ 9.121 + protected void addNavigationBarHeader(Content body) { 9.122 + Content headerContent; 9.123 + if (configuration.packagesheader.length() > 0) { 9.124 + headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader)); 9.125 + } else { 9.126 + headerContent = new RawHtml(replaceDocRootDir(configuration.header)); 9.127 + } 9.128 + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, 9.129 + HtmlStyle.bar, headerContent); 9.130 + body.addContent(heading); 9.131 + } 9.132 + 9.133 + /** 9.134 + * Do nothing as there is no overview information in this page. 9.135 + */ 9.136 + protected void addOverviewHeader(Content body) { 9.137 + } 9.138 + 9.139 + /** 9.140 + * Adds "All Classes" link for the top of the left-hand frame page to the 9.141 + * documentation tree. 9.142 + * 9.143 + * @param div the Content object to which the all classes link should be added 9.144 + */ 9.145 + protected void addAllClassesLink(Content div) { 9.146 + Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME, 9.147 + allclassesLabel, "", "packageFrame"); 9.148 + Content span = HtmlTree.SPAN(linkContent); 9.149 + div.addContent(span); 9.150 + } 9.151 + 9.152 + /** 9.153 + * Adds "All Packages" link for the top of the left-hand frame page to the 9.154 + * documentation tree. 9.155 + * 9.156 + * @param div the Content object to which the all packages link should be added 9.157 + */ 9.158 + protected void addAllPackagesLink(Content div) { 9.159 + Content linkContent = getHyperLink(DocPaths.OVERVIEW_FRAME, 9.160 + allpackagesLabel, "", "profileListFrame"); 9.161 + Content span = HtmlTree.SPAN(linkContent); 9.162 + div.addContent(span); 9.163 + } 9.164 + 9.165 + /** 9.166 + * {@inheritDoc} 9.167 + */ 9.168 + protected void addNavigationBarFooter(Content body) { 9.169 + Content p = HtmlTree.P(getSpace()); 9.170 + body.addContent(p); 9.171 + } 9.172 + 9.173 + protected void addProfilePackagesList(Profiles profiles, String text, 9.174 + String tableSummary, Content body, String profileName) { 9.175 + } 9.176 +}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 10.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java Mon Jan 21 00:45:35 2013 -0500 10.3 @@ -0,0 +1,186 @@ 10.4 +/* 10.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 10.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 10.7 + * 10.8 + * This code is free software; you can redistribute it and/or modify it 10.9 + * under the terms of the GNU General Public License version 2 only, as 10.10 + * published by the Free Software Foundation. Oracle designates this 10.11 + * particular file as subject to the "Classpath" exception as provided 10.12 + * by Oracle in the LICENSE file that accompanied this code. 10.13 + * 10.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 10.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 10.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 10.17 + * version 2 for more details (a copy is included in the LICENSE file that 10.18 + * accompanied this code). 10.19 + * 10.20 + * You should have received a copy of the GNU General Public License version 10.21 + * 2 along with this work; if not, write to the Free Software Foundation, 10.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 10.23 + * 10.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 10.25 + * or visit www.oracle.com if you need additional information or have any 10.26 + * questions. 10.27 + */ 10.28 + 10.29 +package com.sun.tools.doclets.formats.html; 10.30 + 10.31 +import java.io.*; 10.32 +import java.util.*; 10.33 + 10.34 +import com.sun.javadoc.*; 10.35 +import com.sun.tools.javac.jvm.Profile; 10.36 +import com.sun.tools.doclets.formats.html.markup.*; 10.37 +import com.sun.tools.doclets.internal.toolkit.*; 10.38 +import com.sun.tools.doclets.internal.toolkit.util.*; 10.39 + 10.40 +/** 10.41 + * Class to generate file for each package contents of a profile in the left-hand bottom 10.42 + * frame. This will list all the Class Kinds in the package for a profile. A click on any 10.43 + * class-kind will update the right-hand frame with the clicked class-kind page. 10.44 + * 10.45 + * <p><b>This is NOT part of any supported API. 10.46 + * If you write code that depends on this, you do so at your own risk. 10.47 + * This code and its internal interfaces are subject to change or 10.48 + * deletion without notice.</b> 10.49 + * 10.50 + * @author Bhavesh Patel 10.51 + */ 10.52 +public class ProfilePackageFrameWriter extends HtmlDocletWriter { 10.53 + 10.54 + /** 10.55 + * The package being documented. 10.56 + */ 10.57 + private PackageDoc packageDoc; 10.58 + 10.59 + /** 10.60 + * Constructor to construct ProfilePackageFrameWriter object and to generate 10.61 + * "profilename-package-frame.html" file in the respective package directory. 10.62 + * For example for profile compact1 and package "java.lang" this will generate file 10.63 + * "compact1-package-frame.html" file in the "java/lang" directory. It will also 10.64 + * create "java/lang" directory in the current or the destination directory 10.65 + * if it doesn't exist. 10.66 + * 10.67 + * @param configuration the configuration of the doclet. 10.68 + * @param packageDoc PackageDoc under consideration. 10.69 + * @param profileName the name of the profile being documented 10.70 + */ 10.71 + public ProfilePackageFrameWriter(ConfigurationImpl configuration, 10.72 + PackageDoc packageDoc, String profileName) 10.73 + throws IOException { 10.74 + super(configuration, DocPath.forPackage(packageDoc).resolve( 10.75 + DocPaths.profilePackageFrame(profileName))); 10.76 + this.packageDoc = packageDoc; 10.77 + } 10.78 + 10.79 + /** 10.80 + * Generate a profile package summary page for the left-hand bottom frame. Construct 10.81 + * the ProfilePackageFrameWriter object and then uses it generate the file. 10.82 + * 10.83 + * @param configuration the current configuration of the doclet. 10.84 + * @param packageDoc The package for which "profilename-package-frame.html" is to be generated. 10.85 + * @param profileValue the value of the profile being documented 10.86 + */ 10.87 + public static void generate(ConfigurationImpl configuration, 10.88 + PackageDoc packageDoc, int profileValue) { 10.89 + ProfilePackageFrameWriter profpackgen; 10.90 + try { 10.91 + String profileName = Profile.lookup(profileValue).name; 10.92 + profpackgen = new ProfilePackageFrameWriter(configuration, packageDoc, 10.93 + profileName); 10.94 + StringBuilder winTitle = new StringBuilder(profileName); 10.95 + String sep = " - "; 10.96 + winTitle.append(sep); 10.97 + String pkgName = Util.getPackageName(packageDoc); 10.98 + winTitle.append(pkgName); 10.99 + Content body = profpackgen.getBody(false, 10.100 + profpackgen.getWindowTitle(winTitle.toString())); 10.101 + Content profName = new StringContent(profileName); 10.102 + Content sepContent = new StringContent(sep); 10.103 + Content pkgNameContent = new RawHtml(pkgName); 10.104 + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, 10.105 + profpackgen.getTargetProfileLink("classFrame", profName, profileName)); 10.106 + heading.addContent(sepContent); 10.107 + heading.addContent(profpackgen.getTargetProfilePackageLink(packageDoc, 10.108 + "classFrame", pkgNameContent, profileName)); 10.109 + body.addContent(heading); 10.110 + HtmlTree div = new HtmlTree(HtmlTag.DIV); 10.111 + div.addStyle(HtmlStyle.indexContainer); 10.112 + profpackgen.addClassListing(div, profileValue); 10.113 + body.addContent(div); 10.114 + profpackgen.printHtmlDocument( 10.115 + configuration.metakeywords.getMetaKeywords(packageDoc), false, body); 10.116 + profpackgen.close(); 10.117 + } catch (IOException exc) { 10.118 + configuration.standardmessage.error( 10.119 + "doclet.exception_encountered", 10.120 + exc.toString(), DocPaths.PACKAGE_FRAME.getPath()); 10.121 + throw new DocletAbortException(); 10.122 + } 10.123 + } 10.124 + 10.125 + /** 10.126 + * Add class listing for all the classes in this package. Divide class 10.127 + * listing as per the class kind and generate separate listing for 10.128 + * Classes, Interfaces, Exceptions and Errors. 10.129 + * 10.130 + * @param contentTree the content tree to which the listing will be added 10.131 + * @param profileValue the value of the profile being documented 10.132 + */ 10.133 + protected void addClassListing(Content contentTree, int profileValue) { 10.134 + if (packageDoc.isIncluded()) { 10.135 + addClassKindListing(packageDoc.interfaces(), 10.136 + getResource("doclet.Interfaces"), contentTree, profileValue); 10.137 + addClassKindListing(packageDoc.ordinaryClasses(), 10.138 + getResource("doclet.Classes"), contentTree, profileValue); 10.139 + addClassKindListing(packageDoc.enums(), 10.140 + getResource("doclet.Enums"), contentTree, profileValue); 10.141 + addClassKindListing(packageDoc.exceptions(), 10.142 + getResource("doclet.Exceptions"), contentTree, profileValue); 10.143 + addClassKindListing(packageDoc.errors(), 10.144 + getResource("doclet.Errors"), contentTree, profileValue); 10.145 + addClassKindListing(packageDoc.annotationTypes(), 10.146 + getResource("doclet.AnnotationTypes"), contentTree, profileValue); 10.147 + } 10.148 + } 10.149 + 10.150 + /** 10.151 + * Add specific class kind listing. Also add label to the listing. 10.152 + * 10.153 + * @param arr Array of specific class kinds, namely Class or Interface or Exception or Error 10.154 + * @param labelContent content tree of the label to be added 10.155 + * @param contentTree the content tree to which the class kind listing will be added 10.156 + * @param profileValue the value of the profile being documented 10.157 + */ 10.158 + protected void addClassKindListing(ClassDoc[] arr, Content labelContent, 10.159 + Content contentTree, int profileValue) { 10.160 + if(arr.length > 0) { 10.161 + Arrays.sort(arr); 10.162 + boolean printedHeader = false; 10.163 + HtmlTree ul = new HtmlTree(HtmlTag.UL); 10.164 + ul.addAttr(HtmlAttr.TITLE, labelContent.toString()); 10.165 + for (int i = 0; i < arr.length; i++) { 10.166 + if (!isTypeInProfile(arr[i], profileValue)) { 10.167 + continue; 10.168 + } 10.169 + if (!Util.isCoreClass(arr[i]) || ! 10.170 + configuration.isGeneratedDoc(arr[i])) { 10.171 + continue; 10.172 + } 10.173 + if (!printedHeader) { 10.174 + Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, 10.175 + true, labelContent); 10.176 + contentTree.addContent(heading); 10.177 + printedHeader = true; 10.178 + } 10.179 + Content link = new RawHtml (getLink(new LinkInfoImpl(configuration, 10.180 + LinkInfoImpl.PACKAGE_FRAME, arr[i], 10.181 + (arr[i].isInterface() ? italicsText(arr[i].name()) : 10.182 + arr[i].name()),"classFrame"))); 10.183 + Content li = HtmlTree.LI(link); 10.184 + ul.addContent(li); 10.185 + } 10.186 + contentTree.addContent(ul); 10.187 + } 10.188 + } 10.189 +}
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 11.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java Mon Jan 21 00:45:35 2013 -0500 11.3 @@ -0,0 +1,200 @@ 11.4 +/* 11.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 11.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 11.7 + * 11.8 + * This code is free software; you can redistribute it and/or modify it 11.9 + * under the terms of the GNU General Public License version 2 only, as 11.10 + * published by the Free Software Foundation. Oracle designates this 11.11 + * particular file as subject to the "Classpath" exception as provided 11.12 + * by Oracle in the LICENSE file that accompanied this code. 11.13 + * 11.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 11.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11.17 + * version 2 for more details (a copy is included in the LICENSE file that 11.18 + * accompanied this code). 11.19 + * 11.20 + * You should have received a copy of the GNU General Public License version 11.21 + * 2 along with this work; if not, write to the Free Software Foundation, 11.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 11.23 + * 11.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 11.25 + * or visit www.oracle.com if you need additional information or have any 11.26 + * questions. 11.27 + */ 11.28 + 11.29 +package com.sun.tools.doclets.formats.html; 11.30 + 11.31 +import java.io.*; 11.32 + 11.33 +import com.sun.javadoc.*; 11.34 +import com.sun.tools.javac.sym.Profiles; 11.35 +import com.sun.tools.doclets.formats.html.markup.*; 11.36 +import com.sun.tools.doclets.internal.toolkit.*; 11.37 +import com.sun.tools.doclets.internal.toolkit.util.*; 11.38 + 11.39 +/** 11.40 + * Generate the profile package index for the left-hand frame in the generated output. 11.41 + * A click on the package name in this frame will update the page in the bottom 11.42 + * left hand frame with the listing of contents of the clicked profile package. 11.43 + * 11.44 + * <p><b>This is NOT part of any supported API. 11.45 + * If you write code that depends on this, you do so at your own risk. 11.46 + * This code and its internal interfaces are subject to change or 11.47 + * deletion without notice.</b> 11.48 + * 11.49 + * @author Bhavesh Patel 11.50 + */ 11.51 +public class ProfilePackageIndexFrameWriter extends AbstractProfileIndexWriter { 11.52 + 11.53 + /** 11.54 + * Construct the ProfilePackageIndexFrameWriter object. 11.55 + * 11.56 + * @param configuration the configuration object 11.57 + * @param filename Name of the package index file to be generated. 11.58 + */ 11.59 + public ProfilePackageIndexFrameWriter(ConfigurationImpl configuration, 11.60 + DocPath filename) throws IOException { 11.61 + super(configuration, filename); 11.62 + } 11.63 + 11.64 + /** 11.65 + * Generate the profile package index file. 11.66 + * @throws DocletAbortException 11.67 + * @param configuration the configuration object 11.68 + * @param profileName the name of the profile being documented 11.69 + */ 11.70 + public static void generate(ConfigurationImpl configuration, String profileName) { 11.71 + ProfilePackageIndexFrameWriter profpackgen; 11.72 + DocPath filename = DocPaths.profileFrame(profileName); 11.73 + try { 11.74 + profpackgen = new ProfilePackageIndexFrameWriter(configuration, filename); 11.75 + profpackgen.buildProfilePackagesIndexFile("doclet.Window_Overview", false, profileName); 11.76 + profpackgen.close(); 11.77 + } catch (IOException exc) { 11.78 + configuration.standardmessage.error( 11.79 + "doclet.exception_encountered", 11.80 + exc.toString(), filename); 11.81 + throw new DocletAbortException(); 11.82 + } 11.83 + } 11.84 + 11.85 + /** 11.86 + * {@inheritDoc} 11.87 + */ 11.88 + protected void addProfilePackagesList(Profiles profiles, String text, 11.89 + String tableSummary, Content body, String profileName) { 11.90 + Content profNameContent = new StringContent(profileName); 11.91 + Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, 11.92 + getTargetProfileLink("classFrame", profNameContent, profileName)); 11.93 + heading.addContent(getSpace()); 11.94 + heading.addContent(packagesLabel); 11.95 + Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading); 11.96 + HtmlTree ul = new HtmlTree(HtmlTag.UL); 11.97 + ul.addAttr(HtmlAttr.TITLE, packagesLabel.toString()); 11.98 + PackageDoc[] packages = configuration.profilePackages.get(profileName); 11.99 + for (int i = 0; i < packages.length; i++) { 11.100 + if ((!(configuration.nodeprecated && Util.isDeprecated(packages[i])))) { 11.101 + ul.addContent(getPackage(packages[i], profileName)); 11.102 + } 11.103 + } 11.104 + div.addContent(ul); 11.105 + body.addContent(div); 11.106 + } 11.107 + 11.108 + /** 11.109 + * Gets each package name as a separate link. 11.110 + * 11.111 + * @param pd PackageDoc 11.112 + * @param profileName the name of the profile being documented 11.113 + * @return content for the package link 11.114 + */ 11.115 + protected Content getPackage(PackageDoc pd, String profileName) { 11.116 + Content packageLinkContent; 11.117 + Content pkgLabel; 11.118 + if (pd.name().length() > 0) { 11.119 + pkgLabel = getPackageLabel(pd.name()); 11.120 + packageLinkContent = getHyperLink(pathString(pd, 11.121 + DocPaths.profilePackageFrame(profileName)), pkgLabel, "", 11.122 + "packageFrame"); 11.123 + } else { 11.124 + pkgLabel = new RawHtml("<unnamed package>"); 11.125 + packageLinkContent = getHyperLink(DocPaths.PACKAGE_FRAME, 11.126 + pkgLabel, "", "packageFrame"); 11.127 + } 11.128 + Content li = HtmlTree.LI(packageLinkContent); 11.129 + return li; 11.130 + } 11.131 + 11.132 + /** 11.133 + * {@inheritDoc} 11.134 + */ 11.135 + protected void addNavigationBarHeader(Content body) { 11.136 + Content headerContent; 11.137 + if (configuration.packagesheader.length() > 0) { 11.138 + headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader)); 11.139 + } else { 11.140 + headerContent = new RawHtml(replaceDocRootDir(configuration.header)); 11.141 + } 11.142 + Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, 11.143 + HtmlStyle.bar, headerContent); 11.144 + body.addContent(heading); 11.145 + } 11.146 + 11.147 + /** 11.148 + * Do nothing as there is no overview information in this page. 11.149 + */ 11.150 + protected void addOverviewHeader(Content body) { 11.151 + } 11.152 + 11.153 + protected void addProfilesList(Profiles profiles, String text, 11.154 + String tableSummary, Content body) { 11.155 + } 11.156 + 11.157 + /** 11.158 + * Adds "All Classes" link for the top of the left-hand frame page to the 11.159 + * documentation tree. 11.160 + * 11.161 + * @param div the Content object to which the all classes link should be added 11.162 + */ 11.163 + protected void addAllClassesLink(Content div) { 11.164 + Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME, 11.165 + allclassesLabel, "", "packageFrame"); 11.166 + Content span = HtmlTree.SPAN(linkContent); 11.167 + div.addContent(span); 11.168 + } 11.169 + 11.170 + /** 11.171 + * Adds "All Packages" link for the top of the left-hand frame page to the 11.172 + * documentation tree. 11.173 + * 11.174 + * @param div the Content object to which the all packages link should be added 11.175 + */ 11.176 + protected void addAllPackagesLink(Content div) { 11.177 + Content linkContent = getHyperLink(DocPaths.OVERVIEW_FRAME, 11.178 + allpackagesLabel, "", "profileListFrame"); 11.179 + Content span = HtmlTree.SPAN(linkContent); 11.180 + div.addContent(span); 11.181 + } 11.182 + 11.183 + /** 11.184 + * Adds "All Profiles" link for the top of the left-hand frame page to the 11.185 + * documentation tree. 11.186 + * 11.187 + * @param div the Content object to which the all profiles link should be added 11.188 + */ 11.189 + protected void addAllProfilesLink(Content div) { 11.190 + Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME, 11.191 + allprofilesLabel, "", "profileListFrame"); 11.192 + Content span = HtmlTree.SPAN(linkContent); 11.193 + div.addContent(span); 11.194 + } 11.195 + 11.196 + /** 11.197 + * {@inheritDoc} 11.198 + */ 11.199 + protected void addNavigationBarFooter(Content body) { 11.200 + Content p = HtmlTree.P(getSpace()); 11.201 + body.addContent(p); 11.202 + } 11.203 +}
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 12.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java Mon Jan 21 00:45:35 2013 -0500 12.3 @@ -0,0 +1,296 @@ 12.4 +/* 12.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 12.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 12.7 + * 12.8 + * This code is free software; you can redistribute it and/or modify it 12.9 + * under the terms of the GNU General Public License version 2 only, as 12.10 + * published by the Free Software Foundation. Oracle designates this 12.11 + * particular file as subject to the "Classpath" exception as provided 12.12 + * by Oracle in the LICENSE file that accompanied this code. 12.13 + * 12.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 12.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12.17 + * version 2 for more details (a copy is included in the LICENSE file that 12.18 + * accompanied this code). 12.19 + * 12.20 + * You should have received a copy of the GNU General Public License version 12.21 + * 2 along with this work; if not, write to the Free Software Foundation, 12.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 12.23 + * 12.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 12.25 + * or visit www.oracle.com if you need additional information or have any 12.26 + * questions. 12.27 + */ 12.28 + 12.29 +package com.sun.tools.doclets.formats.html; 12.30 + 12.31 +import java.io.*; 12.32 +import java.util.*; 12.33 + 12.34 +import com.sun.javadoc.*; 12.35 +import com.sun.tools.javac.jvm.Profile; 12.36 +import com.sun.tools.doclets.formats.html.markup.*; 12.37 +import com.sun.tools.doclets.internal.toolkit.*; 12.38 +import com.sun.tools.doclets.internal.toolkit.util.*; 12.39 + 12.40 +/** 12.41 + * Class to generate file for each profile package contents in the right-hand 12.42 + * frame. This will list all the Class Kinds in the package. A click on any 12.43 + * class-kind will update the frame with the clicked class-kind page. 12.44 + * 12.45 + * <p><b>This is NOT part of any supported API. 12.46 + * If you write code that depends on this, you do so at your own risk. 12.47 + * This code and its internal interfaces are subject to change or 12.48 + * deletion without notice.</b> 12.49 + * 12.50 + * @author Bhavesh Patel 12.51 + */ 12.52 +public class ProfilePackageWriterImpl extends HtmlDocletWriter 12.53 + implements ProfilePackageSummaryWriter { 12.54 + 12.55 + /** 12.56 + * The prev package name in the alpha-order list. 12.57 + */ 12.58 + protected PackageDoc prev; 12.59 + 12.60 + /** 12.61 + * The next package name in the alpha-order list. 12.62 + */ 12.63 + protected PackageDoc next; 12.64 + 12.65 + /** 12.66 + * The profile package being documented. 12.67 + */ 12.68 + protected PackageDoc packageDoc; 12.69 + 12.70 + /** 12.71 + * The name of the profile being documented. 12.72 + */ 12.73 + protected String profileName; 12.74 + 12.75 + /** 12.76 + * The value of the profile being documented. 12.77 + */ 12.78 + protected int profileValue; 12.79 + 12.80 + /** 12.81 + * Constructor to construct ProfilePackageWriter object and to generate 12.82 + * "profilename-package-summary.html" file in the respective package directory. 12.83 + * For example for profile compact1 and package "java.lang" this will generate file 12.84 + * "compact1-package-summary.html" file in the "java/lang" directory. It will also 12.85 + * create "java/lang" directory in the current or the destination directory 12.86 + * if it doesn't exist. 12.87 + * 12.88 + * @param configuration the configuration of the doclet. 12.89 + * @param packageDoc PackageDoc under consideration. 12.90 + * @param prev Previous package in the sorted array. 12.91 + * @param next Next package in the sorted array. 12.92 + * @param profile The profile being documented. 12.93 + */ 12.94 + public ProfilePackageWriterImpl(ConfigurationImpl configuration, 12.95 + PackageDoc packageDoc, PackageDoc prev, PackageDoc next, 12.96 + Profile profile) throws IOException { 12.97 + super(configuration, DocPath.forPackage(packageDoc).resolve( 12.98 + DocPaths.profilePackageSummary(profile.name))); 12.99 + this.prev = prev; 12.100 + this.next = next; 12.101 + this.packageDoc = packageDoc; 12.102 + this.profileName = profile.name; 12.103 + this.profileValue = profile.value; 12.104 + } 12.105 + 12.106 + /** 12.107 + * {@inheritDoc} 12.108 + */ 12.109 + public Content getPackageHeader(String heading) { 12.110 + String pkgName = packageDoc.name(); 12.111 + Content bodyTree = getBody(true, getWindowTitle(pkgName)); 12.112 + addTop(bodyTree); 12.113 + addNavLinks(true, bodyTree); 12.114 + HtmlTree div = new HtmlTree(HtmlTag.DIV); 12.115 + div.addStyle(HtmlStyle.header); 12.116 + Content profileContent = new StringContent(profileName); 12.117 + Content profileNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, profileContent); 12.118 + div.addContent(profileNameDiv); 12.119 + Content annotationContent = new HtmlTree(HtmlTag.P); 12.120 + addAnnotationInfo(packageDoc, annotationContent); 12.121 + div.addContent(annotationContent); 12.122 + Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, 12.123 + HtmlStyle.title, packageLabel); 12.124 + tHeading.addContent(getSpace()); 12.125 + Content packageHead = new RawHtml(heading); 12.126 + tHeading.addContent(packageHead); 12.127 + div.addContent(tHeading); 12.128 + addDeprecationInfo(div); 12.129 + if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) { 12.130 + HtmlTree docSummaryDiv = new HtmlTree(HtmlTag.DIV); 12.131 + docSummaryDiv.addStyle(HtmlStyle.docSummary); 12.132 + addSummaryComment(packageDoc, docSummaryDiv); 12.133 + div.addContent(docSummaryDiv); 12.134 + Content space = getSpace(); 12.135 + Content descLink = getHyperLink(DocLink.fragment("package_description"), 12.136 + descriptionLabel, "", ""); 12.137 + Content descPara = new HtmlTree(HtmlTag.P, seeLabel, space, descLink); 12.138 + div.addContent(descPara); 12.139 + } 12.140 + bodyTree.addContent(div); 12.141 + return bodyTree; 12.142 + } 12.143 + 12.144 + /** 12.145 + * {@inheritDoc} 12.146 + */ 12.147 + public Content getContentHeader() { 12.148 + HtmlTree div = new HtmlTree(HtmlTag.DIV); 12.149 + div.addStyle(HtmlStyle.contentContainer); 12.150 + return div; 12.151 + } 12.152 + 12.153 + /** 12.154 + * Add the package deprecation information to the documentation tree. 12.155 + * 12.156 + * @param div the content tree to which the deprecation information will be added 12.157 + */ 12.158 + public void addDeprecationInfo(Content div) { 12.159 + Tag[] deprs = packageDoc.tags("deprecated"); 12.160 + if (Util.isDeprecated(packageDoc)) { 12.161 + HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); 12.162 + deprDiv.addStyle(HtmlStyle.deprecatedContent); 12.163 + Content deprPhrase = HtmlTree.SPAN(HtmlStyle.strong, deprecatedPhrase); 12.164 + deprDiv.addContent(deprPhrase); 12.165 + if (deprs.length > 0) { 12.166 + Tag[] commentTags = deprs[0].inlineTags(); 12.167 + if (commentTags.length > 0) { 12.168 + addInlineDeprecatedComment(packageDoc, deprs[0], deprDiv); 12.169 + } 12.170 + } 12.171 + div.addContent(deprDiv); 12.172 + } 12.173 + } 12.174 + 12.175 + /** 12.176 + * {@inheritDoc} 12.177 + */ 12.178 + public void addClassesSummary(ClassDoc[] classes, String label, 12.179 + String tableSummary, String[] tableHeader, Content packageSummaryContentTree) { 12.180 + addClassesSummary(classes, label, tableSummary, tableHeader, 12.181 + packageSummaryContentTree, profileValue); 12.182 + } 12.183 + 12.184 + /** 12.185 + * {@inheritDoc} 12.186 + */ 12.187 + public Content getSummaryHeader() { 12.188 + HtmlTree ul = new HtmlTree(HtmlTag.UL); 12.189 + ul.addStyle(HtmlStyle.blockList); 12.190 + return ul; 12.191 + } 12.192 + 12.193 + /** 12.194 + * {@inheritDoc} 12.195 + */ 12.196 + public void addPackageDescription(Content packageContentTree) { 12.197 + if (packageDoc.inlineTags().length > 0) { 12.198 + packageContentTree.addContent(getMarkerAnchor("package_description")); 12.199 + Content h2Content = new StringContent( 12.200 + configuration.getText("doclet.Package_Description", 12.201 + packageDoc.name())); 12.202 + packageContentTree.addContent(HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, 12.203 + true, h2Content)); 12.204 + addInlineComment(packageDoc, packageContentTree); 12.205 + } 12.206 + } 12.207 + 12.208 + /** 12.209 + * {@inheritDoc} 12.210 + */ 12.211 + public void addPackageTags(Content packageContentTree) { 12.212 + addTagsInfo(packageDoc, packageContentTree); 12.213 + } 12.214 + 12.215 + /** 12.216 + * {@inheritDoc} 12.217 + */ 12.218 + public void addPackageFooter(Content contentTree) { 12.219 + addNavLinks(false, contentTree); 12.220 + addBottom(contentTree); 12.221 + } 12.222 + 12.223 + /** 12.224 + * {@inheritDoc} 12.225 + */ 12.226 + public void printDocument(Content contentTree) throws IOException { 12.227 + printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageDoc), 12.228 + true, contentTree); 12.229 + } 12.230 + 12.231 + /** 12.232 + * Get "Use" link for this package in the navigation bar. 12.233 + * 12.234 + * @return a content tree for the class use link 12.235 + */ 12.236 + protected Content getNavLinkClassUse() { 12.237 + Content useLink = getHyperLink(DocPaths.PACKAGE_USE, 12.238 + useLabel, "", ""); 12.239 + Content li = HtmlTree.LI(useLink); 12.240 + return li; 12.241 + } 12.242 + 12.243 + /** 12.244 + * Get "PREV PACKAGE" link in the navigation bar. 12.245 + * 12.246 + * @return a content tree for the previous link 12.247 + */ 12.248 + public Content getNavLinkPrevious() { 12.249 + Content li; 12.250 + if (prev == null) { 12.251 + li = HtmlTree.LI(prevpackageLabel); 12.252 + } else { 12.253 + DocPath path = DocPath.relativePath(packageDoc, prev); 12.254 + li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.profilePackageSummary(profileName)), 12.255 + prevpackageLabel, "", "")); 12.256 + } 12.257 + return li; 12.258 + } 12.259 + 12.260 + /** 12.261 + * Get "NEXT PACKAGE" link in the navigation bar. 12.262 + * 12.263 + * @return a content tree for the next link 12.264 + */ 12.265 + public Content getNavLinkNext() { 12.266 + Content li; 12.267 + if (next == null) { 12.268 + li = HtmlTree.LI(nextpackageLabel); 12.269 + } else { 12.270 + DocPath path = DocPath.relativePath(packageDoc, next); 12.271 + li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.profilePackageSummary(profileName)), 12.272 + nextpackageLabel, "", "")); 12.273 + } 12.274 + return li; 12.275 + } 12.276 + 12.277 + /** 12.278 + * Get "Tree" link in the navigation bar. This will be link to the package 12.279 + * tree file. 12.280 + * 12.281 + * @return a content tree for the tree link 12.282 + */ 12.283 + protected Content getNavLinkTree() { 12.284 + Content useLink = getHyperLink(DocPaths.PACKAGE_TREE, 12.285 + treeLabel, "", ""); 12.286 + Content li = HtmlTree.LI(useLink); 12.287 + return li; 12.288 + } 12.289 + 12.290 + /** 12.291 + * Highlight "Package" in the navigation bar, as this is the package page. 12.292 + * 12.293 + * @return a content tree for the package link 12.294 + */ 12.295 + protected Content getNavLinkPackage() { 12.296 + Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, packageLabel); 12.297 + return li; 12.298 + } 12.299 +}
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 13.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java Mon Jan 21 00:45:35 2013 -0500 13.3 @@ -0,0 +1,208 @@ 13.4 +/* 13.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 13.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 13.7 + * 13.8 + * This code is free software; you can redistribute it and/or modify it 13.9 + * under the terms of the GNU General Public License version 2 only, as 13.10 + * published by the Free Software Foundation. Oracle designates this 13.11 + * particular file as subject to the "Classpath" exception as provided 13.12 + * by Oracle in the LICENSE file that accompanied this code. 13.13 + * 13.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 13.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13.17 + * version 2 for more details (a copy is included in the LICENSE file that 13.18 + * accompanied this code). 13.19 + * 13.20 + * You should have received a copy of the GNU General Public License version 13.21 + * 2 along with this work; if not, write to the Free Software Foundation, 13.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 13.23 + * 13.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 13.25 + * or visit www.oracle.com if you need additional information or have any 13.26 + * questions. 13.27 + */ 13.28 + 13.29 +package com.sun.tools.doclets.formats.html; 13.30 + 13.31 +import java.io.*; 13.32 +import java.util.*; 13.33 + 13.34 +import com.sun.javadoc.*; 13.35 +import com.sun.tools.javac.jvm.Profile; 13.36 +import com.sun.tools.doclets.formats.html.markup.*; 13.37 +import com.sun.tools.doclets.internal.toolkit.*; 13.38 +import com.sun.tools.doclets.internal.toolkit.util.*; 13.39 + 13.40 +/** 13.41 + * Class to generate file for each profile contents in the right-hand 13.42 + * frame. This will list all the packages and Class Kinds in the profile. A click on any 13.43 + * class-kind will update the frame with the clicked class-kind page. A click on any 13.44 + * package will update the frame with the clicked profile package page. 13.45 + * 13.46 + * <p><b>This is NOT part of any supported API. 13.47 + * If you write code that depends on this, you do so at your own risk. 13.48 + * This code and its internal interfaces are subject to change or 13.49 + * deletion without notice.</b> 13.50 + * 13.51 + * @author Bhavesh Patel 13.52 + */ 13.53 +public class ProfileWriterImpl extends HtmlDocletWriter 13.54 + implements ProfileSummaryWriter { 13.55 + 13.56 + /** 13.57 + * The prev profile name in the alpha-order list. 13.58 + */ 13.59 + protected Profile prevProfile; 13.60 + 13.61 + /** 13.62 + * The next profile name in the alpha-order list. 13.63 + */ 13.64 + protected Profile nextProfile; 13.65 + 13.66 + /** 13.67 + * The profile being documented. 13.68 + */ 13.69 + protected Profile profile; 13.70 + 13.71 + /** 13.72 + * Constructor to construct ProfileWriter object and to generate 13.73 + * "profileName-summary.html" file. 13.74 + * 13.75 + * @param configuration the configuration of the doclet. 13.76 + * @param profile Profile under consideration. 13.77 + * @param prevProfile Previous profile in the sorted array. 13.78 + * @param nextProfile Next profile in the sorted array. 13.79 + */ 13.80 + public ProfileWriterImpl(ConfigurationImpl configuration, 13.81 + Profile profile, Profile prevProfile, Profile nextProfile) 13.82 + throws IOException { 13.83 + super(configuration, DocPaths.profileSummary(profile.name)); 13.84 + this.prevProfile = prevProfile; 13.85 + this.nextProfile = nextProfile; 13.86 + this.profile = profile; 13.87 + } 13.88 + 13.89 + /** 13.90 + * {@inheritDoc} 13.91 + */ 13.92 + public Content getProfileHeader(String heading) { 13.93 + String profileName = profile.name; 13.94 + Content bodyTree = getBody(true, getWindowTitle(profileName)); 13.95 + addTop(bodyTree); 13.96 + addNavLinks(true, bodyTree); 13.97 + HtmlTree div = new HtmlTree(HtmlTag.DIV); 13.98 + div.addStyle(HtmlStyle.header); 13.99 + Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, 13.100 + HtmlStyle.title, profileLabel); 13.101 + tHeading.addContent(getSpace()); 13.102 + Content profileHead = new RawHtml(heading); 13.103 + tHeading.addContent(profileHead); 13.104 + div.addContent(tHeading); 13.105 + bodyTree.addContent(div); 13.106 + return bodyTree; 13.107 + } 13.108 + 13.109 + /** 13.110 + * {@inheritDoc} 13.111 + */ 13.112 + public Content getContentHeader() { 13.113 + HtmlTree div = new HtmlTree(HtmlTag.DIV); 13.114 + div.addStyle(HtmlStyle.contentContainer); 13.115 + return div; 13.116 + } 13.117 + 13.118 + /** 13.119 + * {@inheritDoc} 13.120 + */ 13.121 + public Content getSummaryHeader() { 13.122 + HtmlTree li = new HtmlTree(HtmlTag.LI); 13.123 + li.addStyle(HtmlStyle.blockList); 13.124 + return li; 13.125 + } 13.126 + 13.127 + /** 13.128 + * {@inheritDoc} 13.129 + */ 13.130 + public Content getSummaryTree(Content summaryContentTree) { 13.131 + HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree); 13.132 + HtmlTree div = HtmlTree.DIV(HtmlStyle.summary, ul); 13.133 + return div; 13.134 + } 13.135 + 13.136 + /** 13.137 + * {@inheritDoc} 13.138 + */ 13.139 + public Content getPackageSummaryHeader(PackageDoc pkg) { 13.140 + Content pkgName = getTargetProfilePackageLink(pkg, 13.141 + "classFrame", new StringContent(pkg.name()), profile.name); 13.142 + Content heading = HtmlTree.HEADING(HtmlTag.H3, pkgName); 13.143 + HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, heading); 13.144 + return li; 13.145 + } 13.146 + 13.147 + /** 13.148 + * {@inheritDoc} 13.149 + */ 13.150 + public Content getPackageSummaryTree(Content packageSummaryContentTree) { 13.151 + HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, packageSummaryContentTree); 13.152 + return ul; 13.153 + } 13.154 + 13.155 + /** 13.156 + * {@inheritDoc} 13.157 + */ 13.158 + public void addClassesSummary(ClassDoc[] classes, String label, 13.159 + String tableSummary, String[] tableHeader, Content packageSummaryContentTree) { 13.160 + addClassesSummary(classes, label, tableSummary, tableHeader, 13.161 + packageSummaryContentTree, profile.value); 13.162 + } 13.163 + 13.164 + /** 13.165 + * {@inheritDoc} 13.166 + */ 13.167 + public void addProfileFooter(Content contentTree) { 13.168 + addNavLinks(false, contentTree); 13.169 + addBottom(contentTree); 13.170 + } 13.171 + 13.172 + /** 13.173 + * {@inheritDoc} 13.174 + */ 13.175 + public void printDocument(Content contentTree) throws IOException { 13.176 + printHtmlDocument(configuration.metakeywords.getMetaKeywords(profile), 13.177 + true, contentTree); 13.178 + } 13.179 + 13.180 + /** 13.181 + * Get "PREV PROFILE" link in the navigation bar. 13.182 + * 13.183 + * @return a content tree for the previous link 13.184 + */ 13.185 + public Content getNavLinkPrevious() { 13.186 + Content li; 13.187 + if (prevProfile == null) { 13.188 + li = HtmlTree.LI(prevprofileLabel); 13.189 + } else { 13.190 + li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.profileSummary( 13.191 + prevProfile.name)), prevprofileLabel, "", "")); 13.192 + } 13.193 + return li; 13.194 + } 13.195 + 13.196 + /** 13.197 + * Get "NEXT PROFILE" link in the navigation bar. 13.198 + * 13.199 + * @return a content tree for the next link 13.200 + */ 13.201 + public Content getNavLinkNext() { 13.202 + Content li; 13.203 + if (nextProfile == null) { 13.204 + li = HtmlTree.LI(nextprofileLabel); 13.205 + } else { 13.206 + li = HtmlTree.LI(getHyperLink(pathToRoot.resolve(DocPaths.profileSummary( 13.207 + nextProfile.name)), nextprofileLabel, "", "")); 13.208 + } 13.209 + return li; 13.210 + } 13.211 +}
14.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java Wed Jan 16 12:00:21 2013 -0800 14.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java Mon Jan 21 00:45:35 2013 -0500 14.3 @@ -1,5 +1,5 @@ 14.4 /* 14.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 14.6 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 14.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 14.8 * 14.9 * This code is free software; you can redistribute it and/or modify it 14.10 @@ -28,6 +28,7 @@ 14.11 import java.io.IOException; 14.12 14.13 import com.sun.javadoc.*; 14.14 +import com.sun.tools.javac.jvm.Profile; 14.15 import com.sun.tools.doclets.internal.toolkit.*; 14.16 import com.sun.tools.doclets.internal.toolkit.util.*; 14.17 14.18 @@ -69,6 +70,24 @@ 14.19 /** 14.20 * {@inheritDoc} 14.21 */ 14.22 + public ProfileSummaryWriter getProfileSummaryWriter(Profile profile, 14.23 + Profile prevProfile, Profile nextProfile) throws Exception { 14.24 + return new ProfileWriterImpl(configuration, profile, 14.25 + prevProfile, nextProfile); 14.26 + } 14.27 + 14.28 + /** 14.29 + * {@inheritDoc} 14.30 + */ 14.31 + public ProfilePackageSummaryWriter getProfilePackageSummaryWriter(PackageDoc packageDoc, 14.32 + PackageDoc prevPkg, PackageDoc nextPkg, Profile profile) throws Exception { 14.33 + return new ProfilePackageWriterImpl(configuration, packageDoc, 14.34 + prevPkg, nextPkg, profile); 14.35 + } 14.36 + 14.37 + /** 14.38 + * {@inheritDoc} 14.39 + */ 14.40 public ClassWriter getClassWriter(ClassDoc classDoc, ClassDoc prevClass, 14.41 ClassDoc nextClass, ClassTree classTree) throws IOException { 14.42 return new ClassWriterImpl(configuration, classDoc,
15.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java Wed Jan 16 12:00:21 2013 -0800 15.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java Mon Jan 21 00:45:35 2013 -0500 15.3 @@ -1,5 +1,5 @@ 15.4 /* 15.5 - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. 15.6 + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 15.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 15.8 * 15.9 * This code is free software; you can redistribute it and/or modify it 15.10 @@ -168,6 +168,11 @@ 15.11 public static final HtmlTag PACKAGE_HEADING = HtmlTag.H2; 15.12 15.13 /** 15.14 + * Html tag for the profile name heading. 15.15 + */ 15.16 + public static final HtmlTag PROFILE_HEADING = HtmlTag.H2; 15.17 + 15.18 + /** 15.19 * Html tag for the member summary heading. 15.20 */ 15.21 public static final HtmlTag SUMMARY_HEADING = HtmlTag.H3;
16.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Wed Jan 16 12:00:21 2013 -0800 16.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Mon Jan 21 00:45:35 2013 -0500 16.3 @@ -1,5 +1,5 @@ 16.4 /* 16.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 16.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 16.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 16.8 * 16.9 * This code is free software; you can redistribute it and/or modify it 16.10 @@ -63,6 +63,11 @@ 16.11 protected boolean memberDetailsListPrinted; 16.12 16.13 /** 16.14 + * Header for table displaying profiles and description.. 16.15 + */ 16.16 + protected final String[] profileTableHeader; 16.17 + 16.18 + /** 16.19 * Header for tables displaying packages and description.. 16.20 */ 16.21 protected final String[] packageTableHeader; 16.22 @@ -83,6 +88,8 @@ 16.23 16.24 public final Content packageLabel; 16.25 16.26 + public final Content profileLabel; 16.27 + 16.28 public final Content useLabel; 16.29 16.30 public final Content prevLabel; 16.31 @@ -111,6 +118,10 @@ 16.32 16.33 public final Content allclassesLabel; 16.34 16.35 + public final Content allpackagesLabel; 16.36 + 16.37 + public final Content allprofilesLabel; 16.38 + 16.39 public final Content indexLabel; 16.40 16.41 public final Content helpLabel; 16.42 @@ -123,8 +134,14 @@ 16.43 16.44 public final Content nextpackageLabel; 16.45 16.46 + public final Content prevprofileLabel; 16.47 + 16.48 + public final Content nextprofileLabel; 16.49 + 16.50 public final Content packagesLabel; 16.51 16.52 + public final Content profilesLabel; 16.53 + 16.54 public final Content methodDetailsLabel; 16.55 16.56 public final Content annotationTypeDetailsLabel; 16.57 @@ -162,6 +179,10 @@ 16.58 writer = DocFile.createFileForOutput(configuration, path).openWriter(); 16.59 this.configuration = configuration; 16.60 this.memberDetailsListPrinted = false; 16.61 + profileTableHeader = new String[] { 16.62 + configuration.getText("doclet.Profile"), 16.63 + configuration.getText("doclet.Description") 16.64 + }; 16.65 packageTableHeader = new String[] { 16.66 configuration.getText("doclet.Package"), 16.67 configuration.getText("doclet.Description") 16.68 @@ -175,6 +196,7 @@ 16.69 defaultPackageLabel = new RawHtml( 16.70 DocletConstants.DEFAULT_PACKAGE_NAME); 16.71 packageLabel = getResource("doclet.Package"); 16.72 + profileLabel = getResource("doclet.Profile"); 16.73 useLabel = getResource("doclet.navClassUse"); 16.74 prevLabel = getResource("doclet.Prev"); 16.75 nextLabel = getResource("doclet.Next"); 16.76 @@ -189,13 +211,18 @@ 16.77 deprecatedLabel = getResource("doclet.navDeprecated"); 16.78 deprecatedPhrase = getResource("doclet.Deprecated"); 16.79 allclassesLabel = getResource("doclet.All_Classes"); 16.80 + allpackagesLabel = getResource("doclet.All_Packages"); 16.81 + allprofilesLabel = getResource("doclet.All_Profiles"); 16.82 indexLabel = getResource("doclet.Index"); 16.83 helpLabel = getResource("doclet.Help"); 16.84 seeLabel = getResource("doclet.See"); 16.85 descriptionLabel = getResource("doclet.Description"); 16.86 prevpackageLabel = getResource("doclet.Prev_Package"); 16.87 nextpackageLabel = getResource("doclet.Next_Package"); 16.88 + prevprofileLabel = getResource("doclet.Prev_Profile"); 16.89 + nextprofileLabel = getResource("doclet.Next_Profile"); 16.90 packagesLabel = getResource("doclet.Packages"); 16.91 + profilesLabel = getResource("doclet.Profiles"); 16.92 methodDetailsLabel = getResource("doclet.Method_Detail"); 16.93 annotationTypeDetailsLabel = getResource("doclet.Annotation_Type_Member_Detail"); 16.94 fieldDetailsLabel = getResource("doclet.Field_Detail");
17.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties Wed Jan 16 12:00:21 2013 -0800 17.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties Mon Jan 21 00:45:35 2013 -0500 17.3 @@ -4,7 +4,9 @@ 17.4 doclet.Window_Overview=Overview List 17.5 doclet.Window_Overview_Summary=Overview 17.6 doclet.Package=Package 17.7 +doclet.Profile=Profile 17.8 doclet.All_Packages=All Packages 17.9 +doclet.All_Profiles=All Profiles 17.10 doclet.Tree=Tree 17.11 doclet.Class_Hierarchy=Class Hierarchy 17.12 doclet.Window_Class_Hierarchy=Class Hierarchy 17.13 @@ -17,6 +19,8 @@ 17.14 doclet.Next_Class=Next Class 17.15 doclet.Prev_Package=Prev Package 17.16 doclet.Next_Package=Next Package 17.17 +doclet.Prev_Profile=Prev Profile 17.18 +doclet.Next_Profile=Next Profile 17.19 doclet.Prev_Letter=Prev Letter 17.20 doclet.Next_Letter=Next Letter 17.21 doclet.Href_Class_Title=class in {0}
18.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java Wed Jan 16 12:00:21 2013 -0800 18.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java Mon Jan 21 00:45:35 2013 -0500 18.3 @@ -1,5 +1,5 @@ 18.4 /* 18.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 18.6 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 18.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 18.8 * 18.9 * This code is free software; you can redistribute it and/or modify it 18.10 @@ -28,8 +28,6 @@ 18.11 import com.sun.javadoc.*; 18.12 import com.sun.tools.doclets.internal.toolkit.builders.*; 18.13 import com.sun.tools.doclets.internal.toolkit.util.*; 18.14 -import java.io.File; 18.15 -import java.util.StringTokenizer; 18.16 18.17 /** 18.18 * An abstract implementation of a Doclet. 18.19 @@ -128,6 +126,7 @@ 18.20 18.21 PackageListWriter.generate(configuration); 18.22 generatePackageFiles(classtree); 18.23 + generateProfileFiles(); 18.24 18.25 generateOtherFiles(root, classtree); 18.26 configuration.tagletManager.printReport(); 18.27 @@ -148,6 +147,12 @@ 18.28 } 18.29 18.30 /** 18.31 + * Generate the profile documentation. 18.32 + * 18.33 + */ 18.34 + protected abstract void generateProfileFiles() throws Exception; 18.35 + 18.36 + /** 18.37 * Generate the package documentation. 18.38 * 18.39 * @param classtree the data structure representing the class tree.
19.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Wed Jan 16 12:00:21 2013 -0800 19.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java Mon Jan 21 00:45:35 2013 -0500 19.3 @@ -1,5 +1,5 @@ 19.4 /* 19.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 19.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 19.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 19.8 * 19.9 * This code is free software; you can redistribute it and/or modify it 19.10 @@ -29,6 +29,8 @@ 19.11 import java.util.*; 19.12 19.13 import com.sun.javadoc.*; 19.14 +import com.sun.tools.javac.sym.Profiles; 19.15 +import com.sun.tools.javac.jvm.Profile; 19.16 import com.sun.tools.doclets.internal.toolkit.builders.BuilderFactory; 19.17 import com.sun.tools.doclets.internal.toolkit.taglets.*; 19.18 import com.sun.tools.doclets.internal.toolkit.util.*; 19.19 @@ -188,6 +190,17 @@ 19.20 public String sourcepath = ""; 19.21 19.22 /** 19.23 + * Argument for command line option "-Xprofilespath". 19.24 + */ 19.25 + public String profilespath = ""; 19.26 + 19.27 + /** 19.28 + * Generate profiles documentation if profilespath is set and valid profiles 19.29 + * are present. 19.30 + */ 19.31 + public boolean showProfiles = false; 19.32 + 19.33 + /** 19.34 * Don't generate deprecated API information at all, if -nodeprecated 19.35 * option is used. <code>nodepracted</code> is set to true if 19.36 * -nodeprecated option is used. Default is generate deprected API 19.37 @@ -247,6 +260,16 @@ 19.38 public abstract MessageRetriever getDocletSpecificMsg(); 19.39 19.40 /** 19.41 + * A profiles object used to access profiles across various pages. 19.42 + */ 19.43 + public Profiles profiles; 19.44 + 19.45 + /** 19.46 + * An map of the profiles to packages. 19.47 + */ 19.48 + public Map<String,PackageDoc[]> profilePackages; 19.49 + 19.50 + /** 19.51 * An array of the packages specified on the command-line merged 19.52 * with the array of packages that contain the classes specified on the 19.53 * command-line. The array is sorted. 19.54 @@ -315,7 +338,8 @@ 19.55 option.equals("-sourcepath") || 19.56 option.equals("-tag") || 19.57 option.equals("-taglet") || 19.58 - option.equals("-tagletpath")) { 19.59 + option.equals("-tagletpath") || 19.60 + option.equals("-xprofilespath")) { 19.61 return 2; 19.62 } else if (option.equals("-group") || 19.63 option.equals("-linkoffline")) { 19.64 @@ -334,6 +358,38 @@ 19.65 public abstract boolean validOptions(String options[][], 19.66 DocErrorReporter reporter); 19.67 19.68 + private void initProfiles() throws IOException { 19.69 + profiles = Profiles.read(new File(profilespath)); 19.70 + // Generate profiles documentation only is profilespath is set and if 19.71 + // profiles is not null and profiles count is 1 or more. 19.72 + showProfiles = (!profilespath.isEmpty() && profiles != null && 19.73 + profiles.getProfileCount() > 0); 19.74 + } 19.75 + 19.76 + private void initProfilePackages() throws IOException { 19.77 + profilePackages = new HashMap<String,PackageDoc[]>(); 19.78 + ArrayList<PackageDoc> results; 19.79 + Map<String,PackageDoc> packageIndex = new HashMap<String,PackageDoc>(); 19.80 + for (int i = 0; i < packages.length; i++) { 19.81 + PackageDoc pkg = packages[i]; 19.82 + packageIndex.put(pkg.name(), pkg); 19.83 + } 19.84 + for (int i = 1; i < profiles.getProfileCount(); i++) { 19.85 + Set<String> profPkgs = profiles.getPackages(i); 19.86 + results = new ArrayList<PackageDoc>(); 19.87 + for (String packageName : profPkgs) { 19.88 + packageName = packageName.replace("/", "."); 19.89 + PackageDoc profPkg = packageIndex.get(packageName); 19.90 + if (profPkg != null) { 19.91 + results.add(profPkg); 19.92 + } 19.93 + } 19.94 + Collections.sort(results); 19.95 + PackageDoc[] profilePkgs = results.toArray(new PackageDoc[]{}); 19.96 + profilePackages.put(Profile.lookup(i).name, profilePkgs); 19.97 + } 19.98 + } 19.99 + 19.100 private void initPackageArray() { 19.101 Set<PackageDoc> set = new HashSet<PackageDoc>(Arrays.asList(root.specifiedPackages())); 19.102 ClassDoc[] classes = root.specifiedClasses(); 19.103 @@ -404,6 +460,8 @@ 19.104 customTagStrs.add(os); 19.105 } else if (opt.equals("-tagletpath")) { 19.106 tagletpath = os[1]; 19.107 + } else if (opt.equals("-xprofilespath")) { 19.108 + profilespath = os[1]; 19.109 } else if (opt.equals("-keywords")) { 19.110 keywords = true; 19.111 } else if (opt.equals("-serialwarn")) { 19.112 @@ -439,6 +497,14 @@ 19.113 public void setOptions() { 19.114 initPackageArray(); 19.115 setOptions(root.options()); 19.116 + if (!profilespath.isEmpty()) { 19.117 + try { 19.118 + initProfiles(); 19.119 + initProfilePackages(); 19.120 + } catch (Exception e) { 19.121 + throw new DocletAbortException(); 19.122 + } 19.123 + } 19.124 setSpecificDocletOptions(root.options()); 19.125 } 19.126
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 20.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/ProfilePackageSummaryWriter.java Mon Jan 21 00:45:35 2013 -0500 20.3 @@ -0,0 +1,116 @@ 20.4 +/* 20.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 20.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 20.7 + * 20.8 + * This code is free software; you can redistribute it and/or modify it 20.9 + * under the terms of the GNU General Public License version 2 only, as 20.10 + * published by the Free Software Foundation. Oracle designates this 20.11 + * particular file as subject to the "Classpath" exception as provided 20.12 + * by Oracle in the LICENSE file that accompanied this code. 20.13 + * 20.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 20.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 20.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 20.17 + * version 2 for more details (a copy is included in the LICENSE file that 20.18 + * accompanied this code). 20.19 + * 20.20 + * You should have received a copy of the GNU General Public License version 20.21 + * 2 along with this work; if not, write to the Free Software Foundation, 20.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20.23 + * 20.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20.25 + * or visit www.oracle.com if you need additional information or have any 20.26 + * questions. 20.27 + */ 20.28 + 20.29 +package com.sun.tools.doclets.internal.toolkit; 20.30 + 20.31 +import java.io.*; 20.32 + 20.33 +import com.sun.javadoc.*; 20.34 + 20.35 +/** 20.36 + * The interface for writing profile package summary output. 20.37 + * 20.38 + * <p><b>This is NOT part of any supported API. 20.39 + * If you write code that depends on this, you do so at your own risk. 20.40 + * This code and its internal interfaces are subject to change or 20.41 + * deletion without notice.</b> 20.42 + * 20.43 + * @author Bhavesh Patel 20.44 + */ 20.45 + 20.46 +public interface ProfilePackageSummaryWriter { 20.47 + 20.48 + /** 20.49 + * Get the header for the summary. 20.50 + * 20.51 + * @param heading Package name. 20.52 + * @return the header to be added to the content tree 20.53 + */ 20.54 + public abstract Content getPackageHeader(String heading); 20.55 + 20.56 + /** 20.57 + * Get the header for the content. 20.58 + * 20.59 + * @return a content tree for the content header 20.60 + */ 20.61 + public abstract Content getContentHeader(); 20.62 + 20.63 + /** 20.64 + * Get the header for the package summary. 20.65 + * 20.66 + * @return a content tree with the package summary header 20.67 + */ 20.68 + public abstract Content getSummaryHeader(); 20.69 + 20.70 + /** 20.71 + * Adds the table of classes to the documentation tree. 20.72 + * 20.73 + * @param classes the array of classes to document. 20.74 + * @param label the label for this table. 20.75 + * @param tableSummary the summary string for the table 20.76 + * @param tableHeader array of table headers 20.77 + * @param summaryContentTree the content tree to which the summaries will be added 20.78 + */ 20.79 + public abstract void addClassesSummary(ClassDoc[] classes, String label, 20.80 + String tableSummary, String[] tableHeader, Content summaryContentTree); 20.81 + 20.82 + /** 20.83 + * Adds the package description from the "packages.html" file to the documentation 20.84 + * tree. 20.85 + * 20.86 + * @param packageContentTree the content tree to which the package description 20.87 + * will be added 20.88 + */ 20.89 + public abstract void addPackageDescription(Content packageContentTree); 20.90 + 20.91 + /** 20.92 + * Adds the tag information from the "packages.html" file to the documentation 20.93 + * tree. 20.94 + * 20.95 + * @param packageContentTree the content tree to which the package tags will 20.96 + * be added 20.97 + */ 20.98 + public abstract void addPackageTags(Content packageContentTree); 20.99 + 20.100 + /** 20.101 + * Adds the footer to the documentation tree. 20.102 + * 20.103 + * @param contentTree the tree to which the footer will be added 20.104 + */ 20.105 + public abstract void addPackageFooter(Content contentTree); 20.106 + 20.107 + /** 20.108 + * Print the package summary document. 20.109 + * 20.110 + * @param contentTree the content tree that will be printed 20.111 + */ 20.112 + public abstract void printDocument(Content contentTree) throws IOException; 20.113 + 20.114 + /** 20.115 + * Close the writer. 20.116 + */ 20.117 + public abstract void close() throws IOException; 20.118 + 20.119 +}
21.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 21.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/ProfileSummaryWriter.java Mon Jan 21 00:45:35 2013 -0500 21.3 @@ -0,0 +1,120 @@ 21.4 +/* 21.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 21.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 21.7 + * 21.8 + * This code is free software; you can redistribute it and/or modify it 21.9 + * under the terms of the GNU General Public License version 2 only, as 21.10 + * published by the Free Software Foundation. Oracle designates this 21.11 + * particular file as subject to the "Classpath" exception as provided 21.12 + * by Oracle in the LICENSE file that accompanied this code. 21.13 + * 21.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 21.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 21.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 21.17 + * version 2 for more details (a copy is included in the LICENSE file that 21.18 + * accompanied this code). 21.19 + * 21.20 + * You should have received a copy of the GNU General Public License version 21.21 + * 2 along with this work; if not, write to the Free Software Foundation, 21.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 21.23 + * 21.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 21.25 + * or visit www.oracle.com if you need additional information or have any 21.26 + * questions. 21.27 + */ 21.28 + 21.29 +package com.sun.tools.doclets.internal.toolkit; 21.30 + 21.31 +import java.io.*; 21.32 + 21.33 +import com.sun.javadoc.*; 21.34 + 21.35 +/** 21.36 + * The interface for writing profile summary output. 21.37 + * 21.38 + * <p><b>This is NOT part of any supported API. 21.39 + * If you write code that depends on this, you do so at your own risk. 21.40 + * This code and its internal interfaces are subject to change or 21.41 + * deletion without notice.</b> 21.42 + * 21.43 + * @author Bhavesh Patel 21.44 + */ 21.45 + 21.46 +public interface ProfileSummaryWriter { 21.47 + 21.48 + /** 21.49 + * Get the header for the summary. 21.50 + * 21.51 + * @param heading profile name. 21.52 + * @return the header to be added to the content tree 21.53 + */ 21.54 + public abstract Content getProfileHeader(String heading); 21.55 + 21.56 + /** 21.57 + * Get the header for the profile content. 21.58 + * 21.59 + * @return a content tree for the profile content header 21.60 + */ 21.61 + public abstract Content getContentHeader(); 21.62 + 21.63 + /** 21.64 + * Get the header for the summary header. 21.65 + * 21.66 + * @return a content tree with the summary header 21.67 + */ 21.68 + public abstract Content getSummaryHeader(); 21.69 + 21.70 + /** 21.71 + * Get the header for the summary tree. 21.72 + * 21.73 + * @param summaryContentTree the content tree. 21.74 + * @return a content tree with the summary tree 21.75 + */ 21.76 + public abstract Content getSummaryTree(Content summaryContentTree); 21.77 + 21.78 + /** 21.79 + * Get the header for the package summary header. 21.80 + * 21.81 + * @return a content tree with the package summary header 21.82 + */ 21.83 + public abstract Content getPackageSummaryHeader(PackageDoc pkg); 21.84 + 21.85 + /** 21.86 + * Get the header for the package summary tree. 21.87 + * 21.88 + * @return a content tree with the package summary 21.89 + */ 21.90 + public abstract Content getPackageSummaryTree(Content packageSummaryContentTree); 21.91 + 21.92 + /** 21.93 + * Adds the table of classes to the documentation tree. 21.94 + * 21.95 + * @param classes the array of classes to document. 21.96 + * @param label the label for this table. 21.97 + * @param tableSummary the summary string for the table 21.98 + * @param tableHeader array of table headers 21.99 + * @param packageSummaryContentTree the content tree to which the summaries will be added 21.100 + */ 21.101 + public abstract void addClassesSummary(ClassDoc[] classes, String label, 21.102 + String tableSummary, String[] tableHeader, Content packageSummaryContentTree); 21.103 + 21.104 + /** 21.105 + * Adds the footer to the documentation tree. 21.106 + * 21.107 + * @param contentTree the tree to which the footer will be added 21.108 + */ 21.109 + public abstract void addProfileFooter(Content contentTree); 21.110 + 21.111 + /** 21.112 + * Print the profile summary document. 21.113 + * 21.114 + * @param contentTree the content tree that will be printed 21.115 + */ 21.116 + public abstract void printDocument(Content contentTree) throws IOException; 21.117 + 21.118 + /** 21.119 + * Close the writer. 21.120 + */ 21.121 + public abstract void close() throws IOException; 21.122 + 21.123 +}
22.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java Wed Jan 16 12:00:21 2013 -0800 22.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java Mon Jan 21 00:45:35 2013 -0500 22.3 @@ -1,5 +1,5 @@ 22.4 /* 22.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 22.6 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 22.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 22.8 * 22.9 * This code is free software; you can redistribute it and/or modify it 22.10 @@ -26,6 +26,7 @@ 22.11 package com.sun.tools.doclets.internal.toolkit; 22.12 22.13 import com.sun.javadoc.*; 22.14 +import com.sun.tools.javac.jvm.Profile; 22.15 import com.sun.tools.doclets.internal.toolkit.util.*; 22.16 22.17 /** 22.18 @@ -65,6 +66,33 @@ 22.19 throws Exception; 22.20 22.21 /** 22.22 + * Return the writer for the profile summary. 22.23 + * 22.24 + * @param profile the profile being documented. 22.25 + * @param prevProfile the previous profile that was documented. 22.26 + * @param nextProfile the next profile being documented. 22.27 + * @return the writer for the profile summary. Return null if this 22.28 + * writer is not supported by the doclet. 22.29 + */ 22.30 + public abstract ProfileSummaryWriter getProfileSummaryWriter(Profile 22.31 + profile, Profile prevProfile, Profile nextProfile) 22.32 + throws Exception; 22.33 + 22.34 + /** 22.35 + * Return the writer for the profile package summary. 22.36 + * 22.37 + * @param packageDoc the profile package being documented. 22.38 + * @param prevPkg the previous profile package that was documented. 22.39 + * @param nextPkg the next profile package being documented. 22.40 + * @param profile the profile being documented. 22.41 + * @return the writer for the profile package summary. Return null if this 22.42 + * writer is not supported by the doclet. 22.43 + */ 22.44 + public abstract ProfilePackageSummaryWriter getProfilePackageSummaryWriter( 22.45 + PackageDoc packageDoc, PackageDoc prevPkg, PackageDoc nextPkg, 22.46 + Profile profile) throws Exception; 22.47 + 22.48 + /** 22.49 * Return the writer for a class. 22.50 * 22.51 * @param classDoc the class being documented.
23.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java Wed Jan 16 12:00:21 2013 -0800 23.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java Mon Jan 21 00:45:35 2013 -0500 23.3 @@ -1,5 +1,5 @@ 23.4 /* 23.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 23.6 + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 23.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 23.8 * 23.9 * This code is free software; you can redistribute it and/or modify it 23.10 @@ -29,6 +29,7 @@ 23.11 import java.util.Set; 23.12 23.13 import com.sun.javadoc.*; 23.14 +import com.sun.tools.javac.jvm.Profile; 23.15 import com.sun.tools.doclets.internal.toolkit.*; 23.16 import com.sun.tools.doclets.internal.toolkit.util.*; 23.17 23.18 @@ -96,6 +97,36 @@ 23.19 } 23.20 23.21 /** 23.22 + * Return the builder that builds the profile summary. 23.23 + * 23.24 + * @param profile the profile being documented. 23.25 + * @param prevProfile the previous profile being documented. 23.26 + * @param nextProfile the next profile being documented. 23.27 + * @return the builder that builds the profile summary. 23.28 + */ 23.29 + public AbstractBuilder getProfileSummaryBuilder(Profile profile, Profile prevProfile, 23.30 + Profile nextProfile) throws Exception { 23.31 + return ProfileSummaryBuilder.getInstance(context, profile, 23.32 + writerFactory.getProfileSummaryWriter(profile, prevProfile, nextProfile)); 23.33 + } 23.34 + 23.35 + /** 23.36 + * Return the builder that builds the profile package summary. 23.37 + * 23.38 + * @param pkg the profile package being documented. 23.39 + * @param prevPkg the previous profile package being documented. 23.40 + * @param nextPkg the next profile package being documented. 23.41 + * @param profile the profile being documented. 23.42 + * @return the builder that builds the profile package summary. 23.43 + */ 23.44 + public AbstractBuilder getProfilePackageSummaryBuilder(PackageDoc pkg, PackageDoc prevPkg, 23.45 + PackageDoc nextPkg, Profile profile) throws Exception { 23.46 + return ProfilePackageSummaryBuilder.getInstance(context, pkg, 23.47 + writerFactory.getProfilePackageSummaryWriter(pkg, prevPkg, nextPkg, 23.48 + profile), profile); 23.49 + } 23.50 + 23.51 + /** 23.52 * Return the builder for the class. 23.53 * 23.54 * @param classDoc the class being documented.
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 24.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfilePackageSummaryBuilder.java Mon Jan 21 00:45:35 2013 -0500 24.3 @@ -0,0 +1,374 @@ 24.4 +/* 24.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 24.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 24.7 + * 24.8 + * This code is free software; you can redistribute it and/or modify it 24.9 + * under the terms of the GNU General Public License version 2 only, as 24.10 + * published by the Free Software Foundation. Oracle designates this 24.11 + * particular file as subject to the "Classpath" exception as provided 24.12 + * by Oracle in the LICENSE file that accompanied this code. 24.13 + * 24.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 24.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 24.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 24.17 + * version 2 for more details (a copy is included in the LICENSE file that 24.18 + * accompanied this code). 24.19 + * 24.20 + * You should have received a copy of the GNU General Public License version 24.21 + * 2 along with this work; if not, write to the Free Software Foundation, 24.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 24.23 + * 24.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 24.25 + * or visit www.oracle.com if you need additional information or have any 24.26 + * questions. 24.27 + */ 24.28 + 24.29 +package com.sun.tools.doclets.internal.toolkit.builders; 24.30 + 24.31 +import java.io.*; 24.32 + 24.33 +import com.sun.javadoc.*; 24.34 +import com.sun.tools.javac.jvm.Profile; 24.35 +import com.sun.tools.doclets.internal.toolkit.*; 24.36 +import com.sun.tools.doclets.internal.toolkit.util.*; 24.37 + 24.38 +/** 24.39 + * Builds the summary for a given profile package. 24.40 + * 24.41 + * <p><b>This is NOT part of any supported API. 24.42 + * If you write code that depends on this, you do so at your own risk. 24.43 + * This code and its internal interfaces are subject to change or 24.44 + * deletion without notice.</b> 24.45 + * 24.46 + * @author Bhavesh Patel 24.47 + */ 24.48 +public class ProfilePackageSummaryBuilder extends AbstractBuilder { 24.49 + /** 24.50 + * The root element of the profile package summary XML is {@value}. 24.51 + */ 24.52 + public static final String ROOT = "PackageDoc"; 24.53 + 24.54 + /** 24.55 + * The profile package being documented. 24.56 + */ 24.57 + private final PackageDoc packageDoc; 24.58 + 24.59 + /** 24.60 + * The name of the profile being documented. 24.61 + */ 24.62 + private final String profileName; 24.63 + 24.64 + /** 24.65 + * The value of the profile being documented. 24.66 + */ 24.67 + private final int profileValue; 24.68 + 24.69 + /** 24.70 + * The doclet specific writer that will output the result. 24.71 + */ 24.72 + private final ProfilePackageSummaryWriter profilePackageWriter; 24.73 + 24.74 + /** 24.75 + * The content that will be added to the profile package summary documentation tree. 24.76 + */ 24.77 + private Content contentTree; 24.78 + 24.79 + /** 24.80 + * Construct a new ProfilePackageSummaryBuilder. 24.81 + * 24.82 + * @param context the build context. 24.83 + * @param pkg the profile package being documented. 24.84 + * @param profilePackageWriter the doclet specific writer that will output the 24.85 + * result. 24.86 + * @param profile the profile being documented. 24.87 + */ 24.88 + private ProfilePackageSummaryBuilder(Context context, 24.89 + PackageDoc pkg, ProfilePackageSummaryWriter profilePackageWriter, 24.90 + Profile profile) { 24.91 + super(context); 24.92 + this.packageDoc = pkg; 24.93 + this.profilePackageWriter = profilePackageWriter; 24.94 + this.profileName = profile.name; 24.95 + this.profileValue = profile.value; 24.96 + } 24.97 + 24.98 + /** 24.99 + * Construct a new ProfilePackageSummaryBuilder. 24.100 + * 24.101 + * @param context the build context. 24.102 + * @param pkg the profile package being documented. 24.103 + * @param profilePackageWriter the doclet specific writer that will output the 24.104 + * result. 24.105 + * @param profile the profile being documented. 24.106 + * 24.107 + * @return an instance of a ProfilePackageSummaryBuilder. 24.108 + */ 24.109 + public static ProfilePackageSummaryBuilder getInstance(Context context, 24.110 + PackageDoc pkg, ProfilePackageSummaryWriter profilePackageWriter, 24.111 + Profile profile) { 24.112 + return new ProfilePackageSummaryBuilder(context, pkg, profilePackageWriter, 24.113 + profile); 24.114 + } 24.115 + 24.116 + /** 24.117 + * Build the profile package summary. 24.118 + */ 24.119 + public void build() throws IOException { 24.120 + if (profilePackageWriter == null) { 24.121 + //Doclet does not support this output. 24.122 + return; 24.123 + } 24.124 + build(layoutParser.parseXML(ROOT), contentTree); 24.125 + } 24.126 + 24.127 + /** 24.128 + * {@inheritDoc} 24.129 + */ 24.130 + public String getName() { 24.131 + return ROOT; 24.132 + } 24.133 + 24.134 + /** 24.135 + * Build the profile package documentation. 24.136 + * 24.137 + * @param node the XML element that specifies which components to document 24.138 + * @param contentTree the content tree to which the documentation will be added 24.139 + */ 24.140 + public void buildPackageDoc(XMLNode node, Content contentTree) throws Exception { 24.141 + contentTree = profilePackageWriter.getPackageHeader( 24.142 + Util.getPackageName(packageDoc)); 24.143 + buildChildren(node, contentTree); 24.144 + profilePackageWriter.addPackageFooter(contentTree); 24.145 + profilePackageWriter.printDocument(contentTree); 24.146 + profilePackageWriter.close(); 24.147 + Util.copyDocFiles(configuration, packageDoc); 24.148 + } 24.149 + 24.150 + /** 24.151 + * Build the content for the profile package doc. 24.152 + * 24.153 + * @param node the XML element that specifies which components to document 24.154 + * @param contentTree the content tree to which the package contents 24.155 + * will be added 24.156 + */ 24.157 + public void buildContent(XMLNode node, Content contentTree) { 24.158 + Content packageContentTree = profilePackageWriter.getContentHeader(); 24.159 + buildChildren(node, packageContentTree); 24.160 + contentTree.addContent(packageContentTree); 24.161 + } 24.162 + 24.163 + /** 24.164 + * Build the profile package summary. 24.165 + * 24.166 + * @param node the XML element that specifies which components to document 24.167 + * @param packageContentTree the package content tree to which the summaries will 24.168 + * be added 24.169 + */ 24.170 + public void buildSummary(XMLNode node, Content packageContentTree) { 24.171 + Content summaryContentTree = profilePackageWriter.getSummaryHeader(); 24.172 + buildChildren(node, summaryContentTree); 24.173 + packageContentTree.addContent(summaryContentTree); 24.174 + } 24.175 + 24.176 + /** 24.177 + * Build the summary for the interfaces in this package. 24.178 + * 24.179 + * @param node the XML element that specifies which components to document 24.180 + * @param summaryContentTree the summary tree to which the interface summary 24.181 + * will be added 24.182 + */ 24.183 + public void buildInterfaceSummary(XMLNode node, Content summaryContentTree) { 24.184 + String interfaceTableSummary = 24.185 + configuration.getText("doclet.Member_Table_Summary", 24.186 + configuration.getText("doclet.Interface_Summary"), 24.187 + configuration.getText("doclet.interfaces")); 24.188 + String[] interfaceTableHeader = new String[] { 24.189 + configuration.getText("doclet.Interface"), 24.190 + configuration.getText("doclet.Description") 24.191 + }; 24.192 + ClassDoc[] interfaces = 24.193 + packageDoc.isIncluded() 24.194 + ? packageDoc.interfaces() 24.195 + : configuration.classDocCatalog.interfaces( 24.196 + Util.getPackageName(packageDoc)); 24.197 + if (interfaces.length > 0) { 24.198 + profilePackageWriter.addClassesSummary( 24.199 + interfaces, 24.200 + configuration.getText("doclet.Interface_Summary"), 24.201 + interfaceTableSummary, interfaceTableHeader, summaryContentTree); 24.202 + } 24.203 + } 24.204 + 24.205 + /** 24.206 + * Build the summary for the classes in this package. 24.207 + * 24.208 + * @param node the XML element that specifies which components to document 24.209 + * @param summaryContentTree the summary tree to which the class summary will 24.210 + * be added 24.211 + */ 24.212 + public void buildClassSummary(XMLNode node, Content summaryContentTree) { 24.213 + String classTableSummary = 24.214 + configuration.getText("doclet.Member_Table_Summary", 24.215 + configuration.getText("doclet.Class_Summary"), 24.216 + configuration.getText("doclet.classes")); 24.217 + String[] classTableHeader = new String[] { 24.218 + configuration.getText("doclet.Class"), 24.219 + configuration.getText("doclet.Description") 24.220 + }; 24.221 + ClassDoc[] classes = 24.222 + packageDoc.isIncluded() 24.223 + ? packageDoc.ordinaryClasses() 24.224 + : configuration.classDocCatalog.ordinaryClasses( 24.225 + Util.getPackageName(packageDoc)); 24.226 + if (classes.length > 0) { 24.227 + profilePackageWriter.addClassesSummary( 24.228 + classes, 24.229 + configuration.getText("doclet.Class_Summary"), 24.230 + classTableSummary, classTableHeader, summaryContentTree); 24.231 + } 24.232 + } 24.233 + 24.234 + /** 24.235 + * Build the summary for the enums in this package. 24.236 + * 24.237 + * @param node the XML element that specifies which components to document 24.238 + * @param summaryContentTree the summary tree to which the enum summary will 24.239 + * be added 24.240 + */ 24.241 + public void buildEnumSummary(XMLNode node, Content summaryContentTree) { 24.242 + String enumTableSummary = 24.243 + configuration.getText("doclet.Member_Table_Summary", 24.244 + configuration.getText("doclet.Enum_Summary"), 24.245 + configuration.getText("doclet.enums")); 24.246 + String[] enumTableHeader = new String[] { 24.247 + configuration.getText("doclet.Enum"), 24.248 + configuration.getText("doclet.Description") 24.249 + }; 24.250 + ClassDoc[] enums = 24.251 + packageDoc.isIncluded() 24.252 + ? packageDoc.enums() 24.253 + : configuration.classDocCatalog.enums( 24.254 + Util.getPackageName(packageDoc)); 24.255 + if (enums.length > 0) { 24.256 + profilePackageWriter.addClassesSummary( 24.257 + enums, 24.258 + configuration.getText("doclet.Enum_Summary"), 24.259 + enumTableSummary, enumTableHeader, summaryContentTree); 24.260 + } 24.261 + } 24.262 + 24.263 + /** 24.264 + * Build the summary for the exceptions in this package. 24.265 + * 24.266 + * @param node the XML element that specifies which components to document 24.267 + * @param summaryContentTree the summary tree to which the exception summary will 24.268 + * be added 24.269 + */ 24.270 + public void buildExceptionSummary(XMLNode node, Content summaryContentTree) { 24.271 + String exceptionTableSummary = 24.272 + configuration.getText("doclet.Member_Table_Summary", 24.273 + configuration.getText("doclet.Exception_Summary"), 24.274 + configuration.getText("doclet.exceptions")); 24.275 + String[] exceptionTableHeader = new String[] { 24.276 + configuration.getText("doclet.Exception"), 24.277 + configuration.getText("doclet.Description") 24.278 + }; 24.279 + ClassDoc[] exceptions = 24.280 + packageDoc.isIncluded() 24.281 + ? packageDoc.exceptions() 24.282 + : configuration.classDocCatalog.exceptions( 24.283 + Util.getPackageName(packageDoc)); 24.284 + if (exceptions.length > 0) { 24.285 + profilePackageWriter.addClassesSummary( 24.286 + exceptions, 24.287 + configuration.getText("doclet.Exception_Summary"), 24.288 + exceptionTableSummary, exceptionTableHeader, summaryContentTree); 24.289 + } 24.290 + } 24.291 + 24.292 + /** 24.293 + * Build the summary for the errors in this package. 24.294 + * 24.295 + * @param node the XML element that specifies which components to document 24.296 + * @param summaryContentTree the summary tree to which the error summary will 24.297 + * be added 24.298 + */ 24.299 + public void buildErrorSummary(XMLNode node, Content summaryContentTree) { 24.300 + String errorTableSummary = 24.301 + configuration.getText("doclet.Member_Table_Summary", 24.302 + configuration.getText("doclet.Error_Summary"), 24.303 + configuration.getText("doclet.errors")); 24.304 + String[] errorTableHeader = new String[] { 24.305 + configuration.getText("doclet.Error"), 24.306 + configuration.getText("doclet.Description") 24.307 + }; 24.308 + ClassDoc[] errors = 24.309 + packageDoc.isIncluded() 24.310 + ? packageDoc.errors() 24.311 + : configuration.classDocCatalog.errors( 24.312 + Util.getPackageName(packageDoc)); 24.313 + if (errors.length > 0) { 24.314 + profilePackageWriter.addClassesSummary( 24.315 + errors, 24.316 + configuration.getText("doclet.Error_Summary"), 24.317 + errorTableSummary, errorTableHeader, summaryContentTree); 24.318 + } 24.319 + } 24.320 + 24.321 + /** 24.322 + * Build the summary for the annotation type in this package. 24.323 + * 24.324 + * @param node the XML element that specifies which components to document 24.325 + * @param summaryContentTree the summary tree to which the annotation type 24.326 + * summary will be added 24.327 + */ 24.328 + public void buildAnnotationTypeSummary(XMLNode node, Content summaryContentTree) { 24.329 + String annotationtypeTableSummary = 24.330 + configuration.getText("doclet.Member_Table_Summary", 24.331 + configuration.getText("doclet.Annotation_Types_Summary"), 24.332 + configuration.getText("doclet.annotationtypes")); 24.333 + String[] annotationtypeTableHeader = new String[] { 24.334 + configuration.getText("doclet.AnnotationType"), 24.335 + configuration.getText("doclet.Description") 24.336 + }; 24.337 + ClassDoc[] annotationTypes = 24.338 + packageDoc.isIncluded() 24.339 + ? packageDoc.annotationTypes() 24.340 + : configuration.classDocCatalog.annotationTypes( 24.341 + Util.getPackageName(packageDoc)); 24.342 + if (annotationTypes.length > 0) { 24.343 + profilePackageWriter.addClassesSummary( 24.344 + annotationTypes, 24.345 + configuration.getText("doclet.Annotation_Types_Summary"), 24.346 + annotationtypeTableSummary, annotationtypeTableHeader, 24.347 + summaryContentTree); 24.348 + } 24.349 + } 24.350 + 24.351 + /** 24.352 + * Build the description of the summary. 24.353 + * 24.354 + * @param node the XML element that specifies which components to document 24.355 + * @param packageContentTree the tree to which the package description will 24.356 + * be added 24.357 + */ 24.358 + public void buildPackageDescription(XMLNode node, Content packageContentTree) { 24.359 + if (configuration.nocomment) { 24.360 + return; 24.361 + } 24.362 + profilePackageWriter.addPackageDescription(packageContentTree); 24.363 + } 24.364 + 24.365 + /** 24.366 + * Build the tags of the summary. 24.367 + * 24.368 + * @param node the XML element that specifies which components to document 24.369 + * @param packageContentTree the tree to which the package tags will be added 24.370 + */ 24.371 + public void buildPackageTags(XMLNode node, Content packageContentTree) { 24.372 + if (configuration.nocomment) { 24.373 + return; 24.374 + } 24.375 + profilePackageWriter.addPackageTags(packageContentTree); 24.376 + } 24.377 +}
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 25.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java Mon Jan 21 00:45:35 2013 -0500 25.3 @@ -0,0 +1,328 @@ 25.4 +/* 25.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 25.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 25.7 + * 25.8 + * This code is free software; you can redistribute it and/or modify it 25.9 + * under the terms of the GNU General Public License version 2 only, as 25.10 + * published by the Free Software Foundation. Oracle designates this 25.11 + * particular file as subject to the "Classpath" exception as provided 25.12 + * by Oracle in the LICENSE file that accompanied this code. 25.13 + * 25.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 25.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 25.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25.17 + * version 2 for more details (a copy is included in the LICENSE file that 25.18 + * accompanied this code). 25.19 + * 25.20 + * You should have received a copy of the GNU General Public License version 25.21 + * 2 along with this work; if not, write to the Free Software Foundation, 25.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 25.23 + * 25.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 25.25 + * or visit www.oracle.com if you need additional information or have any 25.26 + * questions. 25.27 + */ 25.28 + 25.29 +package com.sun.tools.doclets.internal.toolkit.builders; 25.30 + 25.31 +import java.io.*; 25.32 + 25.33 +import com.sun.javadoc.*; 25.34 +import com.sun.tools.javac.jvm.Profile; 25.35 +import com.sun.tools.doclets.internal.toolkit.*; 25.36 +import com.sun.tools.doclets.internal.toolkit.util.*; 25.37 + 25.38 +/** 25.39 + * Builds the summary for a given profile. 25.40 + * 25.41 + * <p><b>This is NOT part of any supported API. 25.42 + * If you write code that depends on this, you do so at your own risk. 25.43 + * This code and its internal interfaces are subject to change or 25.44 + * deletion without notice.</b> 25.45 + * 25.46 + * @author Bhavesh Patel 25.47 + */ 25.48 +public class ProfileSummaryBuilder extends AbstractBuilder { 25.49 + /** 25.50 + * The root element of the profile summary XML is {@value}. 25.51 + */ 25.52 + public static final String ROOT = "ProfileDoc"; 25.53 + 25.54 + /** 25.55 + * The profile being documented. 25.56 + */ 25.57 + private final Profile profile; 25.58 + 25.59 + /** 25.60 + * The doclet specific writer that will output the result. 25.61 + */ 25.62 + private final ProfileSummaryWriter profileWriter; 25.63 + 25.64 + /** 25.65 + * The content that will be added to the profile summary documentation tree. 25.66 + */ 25.67 + private Content contentTree; 25.68 + 25.69 + /** 25.70 + * The profile package being documented. 25.71 + */ 25.72 + private PackageDoc pkg; 25.73 + 25.74 + /** 25.75 + * Construct a new ProfileSummaryBuilder. 25.76 + * 25.77 + * @param context the build context. 25.78 + * @param profile the profile being documented. 25.79 + * @param profileWriter the doclet specific writer that will output the 25.80 + * result. 25.81 + */ 25.82 + private ProfileSummaryBuilder(Context context, 25.83 + Profile profile, ProfileSummaryWriter profileWriter) { 25.84 + super(context); 25.85 + this.profile = profile; 25.86 + this.profileWriter = profileWriter; 25.87 + } 25.88 + 25.89 + /** 25.90 + * Construct a new ProfileSummaryBuilder. 25.91 + * 25.92 + * @param context the build context. 25.93 + * @param profile the profile being documented. 25.94 + * @param profileWriter the doclet specific writer that will output the 25.95 + * result. 25.96 + * 25.97 + * @return an instance of a ProfileSummaryBuilder. 25.98 + */ 25.99 + public static ProfileSummaryBuilder getInstance(Context context, 25.100 + Profile profile, ProfileSummaryWriter profileWriter) { 25.101 + return new ProfileSummaryBuilder(context, profile, profileWriter); 25.102 + } 25.103 + 25.104 + /** 25.105 + * Build the profile summary. 25.106 + */ 25.107 + public void build() throws IOException { 25.108 + if (profileWriter == null) { 25.109 + //Doclet does not support this output. 25.110 + return; 25.111 + } 25.112 + build(layoutParser.parseXML(ROOT), contentTree); 25.113 + } 25.114 + 25.115 + /** 25.116 + * {@inheritDoc} 25.117 + */ 25.118 + public String getName() { 25.119 + return ROOT; 25.120 + } 25.121 + 25.122 + /** 25.123 + * Build the profile documentation. 25.124 + * 25.125 + * @param node the XML element that specifies which components to document 25.126 + * @param contentTree the content tree to which the documentation will be added 25.127 + */ 25.128 + public void buildProfileDoc(XMLNode node, Content contentTree) throws Exception { 25.129 + contentTree = profileWriter.getProfileHeader(profile.name); 25.130 + buildChildren(node, contentTree); 25.131 + profileWriter.addProfileFooter(contentTree); 25.132 + profileWriter.printDocument(contentTree); 25.133 + profileWriter.close(); 25.134 + Util.copyDocFiles(configuration, DocPaths.profileSummary(profile.name)); 25.135 + } 25.136 + 25.137 + /** 25.138 + * Build the content for the profile doc. 25.139 + * 25.140 + * @param node the XML element that specifies which components to document 25.141 + * @param contentTree the content tree to which the profile contents 25.142 + * will be added 25.143 + */ 25.144 + public void buildContent(XMLNode node, Content contentTree) { 25.145 + Content profileContentTree = profileWriter.getContentHeader(); 25.146 + buildChildren(node, profileContentTree); 25.147 + contentTree.addContent(profileContentTree); 25.148 + } 25.149 + 25.150 + /** 25.151 + * Build the profile summary. 25.152 + * 25.153 + * @param node the XML element that specifies which components to document 25.154 + * @param profileContentTree the profile content tree to which the summaries will 25.155 + * be added 25.156 + */ 25.157 + public void buildSummary(XMLNode node, Content profileContentTree) { 25.158 + Content summaryContentTree = profileWriter.getSummaryHeader(); 25.159 + buildChildren(node, summaryContentTree); 25.160 + profileContentTree.addContent(profileWriter.getSummaryTree(summaryContentTree)); 25.161 + } 25.162 + 25.163 + /** 25.164 + * Build the profile package summary. 25.165 + * 25.166 + * @param node the XML element that specifies which components to document 25.167 + * @param summaryContentTree the content tree to which the summaries will 25.168 + * be added 25.169 + */ 25.170 + public void buildPackageSummary(XMLNode node, Content summaryContentTree) { 25.171 + PackageDoc[] packages = configuration.profilePackages.get(profile.name); 25.172 + for (int i = 0; i < packages.length; i++) { 25.173 + this.pkg = packages[i]; 25.174 + Content packageSummaryContentTree = profileWriter.getPackageSummaryHeader(this.pkg); 25.175 + buildChildren(node, packageSummaryContentTree); 25.176 + summaryContentTree.addContent(profileWriter.getPackageSummaryTree( 25.177 + packageSummaryContentTree)); 25.178 + } 25.179 + } 25.180 + 25.181 + /** 25.182 + * Build the summary for the interfaces in the package. 25.183 + * 25.184 + * @param node the XML element that specifies which components to document 25.185 + * @param packageSummaryContentTree the tree to which the interface summary 25.186 + * will be added 25.187 + */ 25.188 + public void buildInterfaceSummary(XMLNode node, Content packageSummaryContentTree) { 25.189 + String interfaceTableSummary = 25.190 + configuration.getText("doclet.Member_Table_Summary", 25.191 + configuration.getText("doclet.Interface_Summary"), 25.192 + configuration.getText("doclet.interfaces")); 25.193 + String[] interfaceTableHeader = new String[] { 25.194 + configuration.getText("doclet.Interface"), 25.195 + configuration.getText("doclet.Description") 25.196 + }; 25.197 + ClassDoc[] interfaces = pkg.interfaces(); 25.198 + if (interfaces.length > 0) { 25.199 + profileWriter.addClassesSummary( 25.200 + interfaces, 25.201 + configuration.getText("doclet.Interface_Summary"), 25.202 + interfaceTableSummary, interfaceTableHeader, packageSummaryContentTree); 25.203 + } 25.204 + } 25.205 + 25.206 + /** 25.207 + * Build the summary for the classes in the package. 25.208 + * 25.209 + * @param node the XML element that specifies which components to document 25.210 + * @param packageSummaryContentTree the tree to which the class summary will 25.211 + * be added 25.212 + */ 25.213 + public void buildClassSummary(XMLNode node, Content packageSummaryContentTree) { 25.214 + String classTableSummary = 25.215 + configuration.getText("doclet.Member_Table_Summary", 25.216 + configuration.getText("doclet.Class_Summary"), 25.217 + configuration.getText("doclet.classes")); 25.218 + String[] classTableHeader = new String[] { 25.219 + configuration.getText("doclet.Class"), 25.220 + configuration.getText("doclet.Description") 25.221 + }; 25.222 + ClassDoc[] classes = pkg.ordinaryClasses(); 25.223 + if (classes.length > 0) { 25.224 + profileWriter.addClassesSummary( 25.225 + classes, 25.226 + configuration.getText("doclet.Class_Summary"), 25.227 + classTableSummary, classTableHeader, packageSummaryContentTree); 25.228 + } 25.229 + } 25.230 + 25.231 + /** 25.232 + * Build the summary for the enums in the package. 25.233 + * 25.234 + * @param node the XML element that specifies which components to document 25.235 + * @param packageSummaryContentTree the tree to which the enum summary will 25.236 + * be added 25.237 + */ 25.238 + public void buildEnumSummary(XMLNode node, Content packageSummaryContentTree) { 25.239 + String enumTableSummary = 25.240 + configuration.getText("doclet.Member_Table_Summary", 25.241 + configuration.getText("doclet.Enum_Summary"), 25.242 + configuration.getText("doclet.enums")); 25.243 + String[] enumTableHeader = new String[] { 25.244 + configuration.getText("doclet.Enum"), 25.245 + configuration.getText("doclet.Description") 25.246 + }; 25.247 + ClassDoc[] enums = pkg.enums(); 25.248 + if (enums.length > 0) { 25.249 + profileWriter.addClassesSummary( 25.250 + enums, 25.251 + configuration.getText("doclet.Enum_Summary"), 25.252 + enumTableSummary, enumTableHeader, packageSummaryContentTree); 25.253 + } 25.254 + } 25.255 + 25.256 + /** 25.257 + * Build the summary for the exceptions in the package. 25.258 + * 25.259 + * @param node the XML element that specifies which components to document 25.260 + * @param packageSummaryContentTree the tree to which the exception summary will 25.261 + * be added 25.262 + */ 25.263 + public void buildExceptionSummary(XMLNode node, Content packageSummaryContentTree) { 25.264 + String exceptionTableSummary = 25.265 + configuration.getText("doclet.Member_Table_Summary", 25.266 + configuration.getText("doclet.Exception_Summary"), 25.267 + configuration.getText("doclet.exceptions")); 25.268 + String[] exceptionTableHeader = new String[] { 25.269 + configuration.getText("doclet.Exception"), 25.270 + configuration.getText("doclet.Description") 25.271 + }; 25.272 + ClassDoc[] exceptions = pkg.exceptions(); 25.273 + if (exceptions.length > 0) { 25.274 + profileWriter.addClassesSummary( 25.275 + exceptions, 25.276 + configuration.getText("doclet.Exception_Summary"), 25.277 + exceptionTableSummary, exceptionTableHeader, packageSummaryContentTree); 25.278 + } 25.279 + } 25.280 + 25.281 + /** 25.282 + * Build the summary for the errors in the package. 25.283 + * 25.284 + * @param node the XML element that specifies which components to document 25.285 + * @param packageSummaryContentTree the tree to which the error summary will 25.286 + * be added 25.287 + */ 25.288 + public void buildErrorSummary(XMLNode node, Content packageSummaryContentTree) { 25.289 + String errorTableSummary = 25.290 + configuration.getText("doclet.Member_Table_Summary", 25.291 + configuration.getText("doclet.Error_Summary"), 25.292 + configuration.getText("doclet.errors")); 25.293 + String[] errorTableHeader = new String[] { 25.294 + configuration.getText("doclet.Error"), 25.295 + configuration.getText("doclet.Description") 25.296 + }; 25.297 + ClassDoc[] errors = pkg.errors(); 25.298 + if (errors.length > 0) { 25.299 + profileWriter.addClassesSummary( 25.300 + errors, 25.301 + configuration.getText("doclet.Error_Summary"), 25.302 + errorTableSummary, errorTableHeader, packageSummaryContentTree); 25.303 + } 25.304 + } 25.305 + 25.306 + /** 25.307 + * Build the summary for the annotation type in the package. 25.308 + * 25.309 + * @param node the XML element that specifies which components to document 25.310 + * @param packageSummaryContentTree the tree to which the annotation type 25.311 + * summary will be added 25.312 + */ 25.313 + public void buildAnnotationTypeSummary(XMLNode node, Content packageSummaryContentTree) { 25.314 + String annotationtypeTableSummary = 25.315 + configuration.getText("doclet.Member_Table_Summary", 25.316 + configuration.getText("doclet.Annotation_Types_Summary"), 25.317 + configuration.getText("doclet.annotationtypes")); 25.318 + String[] annotationtypeTableHeader = new String[] { 25.319 + configuration.getText("doclet.AnnotationType"), 25.320 + configuration.getText("doclet.Description") 25.321 + }; 25.322 + ClassDoc[] annotationTypes = pkg.annotationTypes(); 25.323 + if (annotationTypes.length > 0) { 25.324 + profileWriter.addClassesSummary( 25.325 + annotationTypes, 25.326 + configuration.getText("doclet.Annotation_Types_Summary"), 25.327 + annotationtypeTableSummary, annotationtypeTableHeader, 25.328 + packageSummaryContentTree); 25.329 + } 25.330 + } 25.331 +}
26.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Wed Jan 16 12:00:21 2013 -0800 26.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml Mon Jan 21 00:45:35 2013 -0500 26.3 @@ -28,6 +28,21 @@ 26.4 26.5 <Doclet> 26.6 26.7 + <ProfileDoc> 26.8 + <Content> 26.9 + <Summary> 26.10 + <PackageSummary> 26.11 + <InterfaceSummary/> 26.12 + <ClassSummary/> 26.13 + <EnumSummary/> 26.14 + <ExceptionSummary/> 26.15 + <ErrorSummary/> 26.16 + <AnnotationTypeSummary/> 26.17 + </PackageSummary> 26.18 + </Summary> 26.19 + </Content> 26.20 + </ProfileDoc> 26.21 + 26.22 <PackageDoc> 26.23 <Content> 26.24 <Summary>
27.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Wed Jan 16 12:00:21 2013 -0800 27.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Mon Jan 21 00:45:35 2013 -0500 27.3 @@ -29,6 +29,7 @@ 27.4 doclet.Building_Index_For_All_Classes=Building index for all classes... 27.5 doclet.sourcetab_warning=The argument for -sourcetab must be an integer greater than 0. 27.6 doclet.Packages=Packages 27.7 +doclet.Profiles=Profiles 27.8 doclet.Other_Packages=Other Packages 27.9 doclet.Notice_taglet_registered=Registered Taglet {0} ... 27.10 doclet.Notice_taglet_unseen=Note: Custom tags that were not seen: {0} 27.11 @@ -59,6 +60,7 @@ 27.12 doclet.malformed_html_link_tag=<a> tag is malformed:\n"{0}" 27.13 doclet.tag_misuse=Tag {0} cannot be used in {1} documentation. It can only be used in the following types of documentation: {2}. 27.14 doclet.Package_Summary=Package Summary 27.15 +doclet.Profile_Summary=Profile Summary 27.16 doclet.Interface_Summary=Interface Summary 27.17 doclet.Annotation_Types_Summary=Annotation Types Summary 27.18 doclet.Enum_Summary=Enum Summary 27.19 @@ -80,6 +82,7 @@ 27.20 doclet.Classes=Classes 27.21 doclet.Packages=Packages 27.22 doclet.packages=packages 27.23 +doclet.profiles=profiles 27.24 doclet.All_Classes=All Classes 27.25 doclet.All_Superinterfaces=All Superinterfaces: 27.26 doclet.All_Implemented_Interfaces=All Implemented Interfaces:
28.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Wed Jan 16 12:00:21 2013 -0800 28.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css Mon Jan 21 00:45:35 2013 -0500 28.3 @@ -191,6 +191,9 @@ 28.4 margin:10px; 28.5 position:relative; 28.6 } 28.7 +.indexHeader span{ 28.8 + margin-right:15px; 28.9 +} 28.10 .indexHeader h1 { 28.11 font-size:1.3em; 28.12 }
29.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocPaths.java Wed Jan 16 12:00:21 2013 -0800 29.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocPaths.java Mon Jan 21 00:45:35 2013 -0500 29.3 @@ -1,5 +1,5 @@ 29.4 /* 29.5 - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. 29.6 + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. 29.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 29.8 * 29.9 * This code is free software; you can redistribute it and/or modify it 29.10 @@ -87,6 +87,26 @@ 29.11 /** The name of the file for the package frame. */ 29.12 public static final DocPath PACKAGE_FRAME = DocPath.create("package-frame.html"); 29.13 29.14 + /** The name of the file for the profile frame. */ 29.15 + public static final DocPath profileFrame(String profileName) { 29.16 + return DocPath.create(profileName + "-frame.html"); 29.17 + } 29.18 + 29.19 + /** The name of the file for the profile package frame. */ 29.20 + public static final DocPath profilePackageFrame(String profileName) { 29.21 + return DocPath.create(profileName + "-package-frame.html"); 29.22 + } 29.23 + 29.24 + /** The name of the file for the profile package summary. */ 29.25 + public static final DocPath profilePackageSummary(String profileName) { 29.26 + return DocPath.create(profileName + "-package-summary.html"); 29.27 + } 29.28 + 29.29 + /** The name of the file for the profile summary. */ 29.30 + public static final DocPath profileSummary(String profileName) { 29.31 + return DocPath.create(profileName + "-summary.html"); 29.32 + } 29.33 + 29.34 /** The name of the file for the package list. */ 29.35 public static final DocPath PACKAGE_LIST = DocPath.create("package-list"); 29.36 29.37 @@ -99,6 +119,9 @@ 29.38 /** The name of the file for the package usage info. */ 29.39 public static final DocPath PACKAGE_USE = DocPath.create("package-use.html"); 29.40 29.41 + /** The name of the file for the overview frame. */ 29.42 + public static final DocPath PROFILE_OVERVIEW_FRAME = DocPath.create("profile-overview-frame.html"); 29.43 + 29.44 /** The name of the directory in which resources are generated. 29.45 * Also the name of the sub-package from which resources are read. 29.46 */
30.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java Wed Jan 16 12:00:21 2013 -0800 30.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java Mon Jan 21 00:45:35 2013 -0500 30.3 @@ -1,5 +1,5 @@ 30.4 /* 30.5 - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. 30.6 + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. 30.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 30.8 * 30.9 * This code is free software; you can redistribute it and/or modify it 30.10 @@ -28,6 +28,7 @@ 30.11 import java.util.*; 30.12 30.13 import com.sun.javadoc.*; 30.14 +import com.sun.tools.javac.jvm.Profile; 30.15 import com.sun.tools.doclets.internal.toolkit.*; 30.16 30.17 /** 30.18 @@ -105,6 +106,20 @@ 30.19 } 30.20 30.21 /** 30.22 + * Get the profile keywords. 30.23 + * 30.24 + * @param profile the profile being documented 30.25 + */ 30.26 + public String[] getMetaKeywords(Profile profile) { 30.27 + if( configuration.keywords ) { 30.28 + String profileName = profile.name; 30.29 + return new String[] { profileName + " " + "profile" }; 30.30 + } else { 30.31 + return new String[] {}; 30.32 + } 30.33 + } 30.34 + 30.35 + /** 30.36 * Get the overview keywords. 30.37 */ 30.38 public String[] getOverviewMetaKeywords(String title, String docTitle) {
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 31.2 +++ b/test/com/sun/javadoc/testProfiles/TestProfiles.java Mon Jan 21 00:45:35 2013 -0500 31.3 @@ -0,0 +1,186 @@ 31.4 +/* 31.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 31.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 31.7 + * 31.8 + * This code is free software; you can redistribute it and/or modify it 31.9 + * under the terms of the GNU General Public License version 2 only, as 31.10 + * published by the Free Software Foundation. 31.11 + * 31.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 31.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 31.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 31.15 + * version 2 for more details (a copy is included in the LICENSE file that 31.16 + * accompanied this code). 31.17 + * 31.18 + * You should have received a copy of the GNU General Public License version 31.19 + * 2 along with this work; if not, write to the Free Software Foundation, 31.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 31.21 + * 31.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 31.23 + * or visit www.oracle.com if you need additional information or have any 31.24 + * questions. 31.25 + */ 31.26 + 31.27 +/* 31.28 + * @test 31.29 + * @bug 8006124 31.30 + * @summary Test javadoc support for profiles. 31.31 + * @author Bhavesh Patel 31.32 + * @library ../lib/ 31.33 + * @build JavadocTester TestProfiles 31.34 + * @run main TestProfiles 31.35 + */ 31.36 +public class TestProfiles extends JavadocTester { 31.37 + 31.38 + //Test information. 31.39 + private static final String BUG_ID = "8006124"; 31.40 + private static final String PROFILE_BUG_ID = BUG_ID + "-1"; 31.41 + private static final String PACKAGE_BUG_ID = BUG_ID + "-2"; 31.42 + //Javadoc arguments. 31.43 + private static final String[] ARGS1 = new String[]{ 31.44 + "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath", SRC_DIR + FS 31.45 + + "profile-rtjar-includes.txt", "pkg1", "pkg2", "pkg3", "pkg4", "pkg5" 31.46 + }; 31.47 + private static final String[] ARGS2 = new String[]{ 31.48 + "-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2", "pkg3", "pkg4", "pkg5" 31.49 + }; 31.50 + //Input for string tests for profiles. 31.51 + private static final String[][] PROFILES_TEST = { 31.52 + // Tests for profile-overview-frame.html listing all profiles. 31.53 + {PROFILE_BUG_ID + FS + "profile-overview-frame.html", 31.54 + "<span><a href=\"overview-frame.html\" " 31.55 + + "target=\"profileListFrame\">All Packages</a></span>" 31.56 + }, 31.57 + {PROFILE_BUG_ID + FS + "profile-overview-frame.html", 31.58 + "<li><a href=\"compact1-frame.html\" target=\"profileListFrame\">" 31.59 + + "compact1</a></li>" 31.60 + }, 31.61 + // Tests for profileName-frame.html listing all packages in a profile. 31.62 + {PROFILE_BUG_ID + FS + "compact2-frame.html", 31.63 + "<span><a href=\"overview-frame.html\" target=\"profileListFrame\">" 31.64 + + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" " 31.65 + + "target=\"profileListFrame\">All Profiles</a></span>" 31.66 + }, 31.67 + {PROFILE_BUG_ID + FS + "compact2-frame.html", 31.68 + "<li><a href=\"pkg4/compact2-package-frame.html\" " 31.69 + + "target=\"packageFrame\">pkg4</a></li>" 31.70 + }, 31.71 + // Test for profileName-package-frame.html listing all types in a 31.72 + // package of a profile. 31.73 + {PROFILE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html", 31.74 + "<a href=\"../compact2-summary.html\" target=\"classFrame\">" 31.75 + + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" " 31.76 + + "target=\"classFrame\">pkg2</a>" 31.77 + }, 31.78 + // Tests for profileName-summary.html listing the summary for a profile. 31.79 + {PROFILE_BUG_ID + FS + "compact2-summary.html", 31.80 + "<li><a href=\"compact1-summary.html\">Prev Profile</a></li>" + NL 31.81 + + "<li><a href=\"compact3-summary.html\">Next Profile</a></li>" 31.82 + }, 31.83 + {PROFILE_BUG_ID + FS + "compact2-summary.html", 31.84 + "<h1 title=\"Profile\" class=\"title\">Profile compact2</h1>" 31.85 + }, 31.86 + {PROFILE_BUG_ID + FS + "compact2-summary.html", 31.87 + "<h3><a href=\"pkg2/compact2-package-summary.html\" " 31.88 + + "target=\"classFrame\">pkg2</a></h3>" 31.89 + }, 31.90 + // Tests for profileName-package-summary.html listing the summary for a 31.91 + // package in a profile. 31.92 + {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", 31.93 + "<li><a href=\"../pkg4/compact3-package-summary.html\">Prev Package" 31.94 + + "</a></li>" 31.95 + }, 31.96 + {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", 31.97 + "<div class=\"subTitle\">compact3</div>" 31.98 + }, 31.99 + //Test for "overview-frame.html" showing the "All Profiles" link. 31.100 + {PROFILE_BUG_ID + FS + "overview-frame.html", 31.101 + "<span><a href=\"profile-overview-frame.html\" " 31.102 + + "target=\"profileListFrame\">All Profiles</a></span>" 31.103 + }, 31.104 + //Test for "className.html" showing the profile information for the type. 31.105 + {PROFILE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", 31.106 + "<div class=\"subTitle\">compact1, compact2, compact3</div>" 31.107 + } 31.108 + }; 31.109 + private static final String[][] PROFILES_NEGATED_TEST = { 31.110 + {PROFILE_BUG_ID + FS + "pkg3" + FS + "Class2Pkg3.html", 31.111 + "<div class=\"subTitle\">compact1" 31.112 + }, 31.113 + {PROFILE_BUG_ID + FS + "pkg3" + FS + "Interface1Pkg3.html", 31.114 + "<div class=\"subTitle\">compact1" 31.115 + }, 31.116 + {PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html", 31.117 + "<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" " 31.118 + + "target=\"classFrame\">Anno1Pkg4</a></li>" 31.119 + } 31.120 + }; 31.121 + private static final String[][] PACKAGES_TEST = { 31.122 + {PACKAGE_BUG_ID + FS + "overview-frame.html", 31.123 + "<h2 title=\"Packages\">Packages</h2>" 31.124 + }, 31.125 + {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-frame.html", 31.126 + "<h1 class=\"bar\"><a href=\"../pkg4/package-summary.html\" " 31.127 + + "target=\"classFrame\">pkg4</a></h1>" 31.128 + }, 31.129 + {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-summary.html", 31.130 + "<div class=\"header\">" + NL + "<h1 title=\"Package\" " 31.131 + + "class=\"title\">Package pkg4</h1>" + NL + "</div>" 31.132 + } 31.133 + }; 31.134 + private static final String[][] PACKAGES_NEGATED_TEST = { 31.135 + {PACKAGE_BUG_ID + FS + "profile-overview-frame.html", 31.136 + "<span><a href=\"overview-frame.html\" " 31.137 + + "target=\"profileListFrame\">All Packages</a></span>" 31.138 + }, 31.139 + {PACKAGE_BUG_ID + FS + "compact2-frame.html", 31.140 + "<span><a href=\"overview-frame.html\" target=\"profileListFrame\">" 31.141 + + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" " 31.142 + + "target=\"profileListFrame\">All Profiles</a></span>" 31.143 + }, 31.144 + {PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html", 31.145 + "<a href=\"../compact2-summary.html\" target=\"classFrame\">" 31.146 + + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" " 31.147 + + "target=\"classFrame\">pkg2</a>" 31.148 + }, 31.149 + {PACKAGE_BUG_ID + FS + "compact2-summary.html", 31.150 + "<h1 title=\"Profile\" class=\"title\">Profile compact2</h1>" 31.151 + }, 31.152 + {PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", 31.153 + "<div class=\"subTitle\">compact3</div>" 31.154 + }, 31.155 + {PACKAGE_BUG_ID + FS + "overview-frame.html", 31.156 + "<span><a href=\"profile-overview-frame.html\" " 31.157 + + "target=\"profileListFrame\">All Profiles</a></span>" 31.158 + }, 31.159 + {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", 31.160 + "<div class=\"subTitle\">compact1, compact2, compact3</div>" 31.161 + } 31.162 + }; 31.163 + 31.164 + /** 31.165 + * The entry point of the test. 31.166 + * 31.167 + * @param args the array of command line arguments. 31.168 + */ 31.169 + public static void main(String[] args) { 31.170 + TestProfiles tester = new TestProfiles(); 31.171 + run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST); 31.172 + run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST); 31.173 + tester.printSummary(); 31.174 + } 31.175 + 31.176 + /** 31.177 + * {@inheritDoc} 31.178 + */ 31.179 + public String getBugId() { 31.180 + return BUG_ID; 31.181 + } 31.182 + 31.183 + /** 31.184 + * {@inheritDoc} 31.185 + */ 31.186 + public String getBugName() { 31.187 + return getClass().getName(); 31.188 + } 31.189 +}
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 32.2 +++ b/test/com/sun/javadoc/testProfiles/pkg1/Class1Pkg1.java Mon Jan 21 00:45:35 2013 -0500 32.3 @@ -0,0 +1,32 @@ 32.4 +/* 32.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 32.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 32.7 + * 32.8 + * This code is free software; you can redistribute it and/or modify it 32.9 + * under the terms of the GNU General Public License version 2 only, as 32.10 + * published by the Free Software Foundation. 32.11 + * 32.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 32.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 32.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 32.15 + * version 2 for more details (a copy is included in the LICENSE file that 32.16 + * accompanied this code). 32.17 + * 32.18 + * You should have received a copy of the GNU General Public License version 32.19 + * 2 along with this work; if not, write to the Free Software Foundation, 32.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 32.21 + * 32.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 32.23 + * or visit www.oracle.com if you need additional information or have any 32.24 + * questions. 32.25 + */ 32.26 + 32.27 +package pkg1; 32.28 + 32.29 +/** 32.30 + * A test class. 32.31 + * 32.32 + * @author Bhavesh Patel 32.33 + */ 32.34 +public class Class1Pkg1 { 32.35 +}
33.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 33.2 +++ b/test/com/sun/javadoc/testProfiles/pkg1/Class2Pkg1.java Mon Jan 21 00:45:35 2013 -0500 33.3 @@ -0,0 +1,32 @@ 33.4 +/* 33.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 33.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 33.7 + * 33.8 + * This code is free software; you can redistribute it and/or modify it 33.9 + * under the terms of the GNU General Public License version 2 only, as 33.10 + * published by the Free Software Foundation. 33.11 + * 33.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 33.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 33.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 33.15 + * version 2 for more details (a copy is included in the LICENSE file that 33.16 + * accompanied this code). 33.17 + * 33.18 + * You should have received a copy of the GNU General Public License version 33.19 + * 2 along with this work; if not, write to the Free Software Foundation, 33.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 33.21 + * 33.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 33.23 + * or visit www.oracle.com if you need additional information or have any 33.24 + * questions. 33.25 + */ 33.26 + 33.27 +package pkg1; 33.28 + 33.29 +/** 33.30 + * A test class. 33.31 + * 33.32 + * @author Bhavesh Patel 33.33 + */ 33.34 +public class Class2Pkg1 { 33.35 +}
34.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 34.2 +++ b/test/com/sun/javadoc/testProfiles/pkg1/Class3Pkg1.java Mon Jan 21 00:45:35 2013 -0500 34.3 @@ -0,0 +1,32 @@ 34.4 +/* 34.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 34.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 34.7 + * 34.8 + * This code is free software; you can redistribute it and/or modify it 34.9 + * under the terms of the GNU General Public License version 2 only, as 34.10 + * published by the Free Software Foundation. 34.11 + * 34.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 34.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 34.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 34.15 + * version 2 for more details (a copy is included in the LICENSE file that 34.16 + * accompanied this code). 34.17 + * 34.18 + * You should have received a copy of the GNU General Public License version 34.19 + * 2 along with this work; if not, write to the Free Software Foundation, 34.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 34.21 + * 34.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 34.23 + * or visit www.oracle.com if you need additional information or have any 34.24 + * questions. 34.25 + */ 34.26 + 34.27 +package pkg1; 34.28 + 34.29 +/** 34.30 + * A test class. 34.31 + * 34.32 + * @author Bhavesh Patel 34.33 + */ 34.34 +public class Class3Pkg1 { 34.35 +}
35.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 35.2 +++ b/test/com/sun/javadoc/testProfiles/pkg1/Interface1Pkg1.java Mon Jan 21 00:45:35 2013 -0500 35.3 @@ -0,0 +1,48 @@ 35.4 +/* 35.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 35.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 35.7 + * 35.8 + * This code is free software; you can redistribute it and/or modify it 35.9 + * under the terms of the GNU General Public License version 2 only, as 35.10 + * published by the Free Software Foundation. 35.11 + * 35.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 35.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 35.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 35.15 + * version 2 for more details (a copy is included in the LICENSE file that 35.16 + * accompanied this code). 35.17 + * 35.18 + * You should have received a copy of the GNU General Public License version 35.19 + * 2 along with this work; if not, write to the Free Software Foundation, 35.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 35.21 + * 35.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 35.23 + * or visit www.oracle.com if you need additional information or have any 35.24 + * questions. 35.25 + */ 35.26 + 35.27 +package pkg1; 35.28 + 35.29 +/** 35.30 + * A sample interface. 35.31 + * 35.32 + * @author Bhavesh Patel 35.33 + */ 35.34 +public interface Interface1Pkg1 { 35.35 + 35.36 + /** 35.37 + * A test method. 35.38 + * 35.39 + * @param a blah. 35.40 + * @param b blah. 35.41 + */ 35.42 + void method1(int a, int b); 35.43 + 35.44 + /** 35.45 + * Another test method. 35.46 + * 35.47 + * @param c blah. 35.48 + */ 35.49 + void method2(int c); 35.50 + 35.51 +}
36.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 36.2 +++ b/test/com/sun/javadoc/testProfiles/pkg2/Anno1Pkg2.java Mon Jan 21 00:45:35 2013 -0500 36.3 @@ -0,0 +1,40 @@ 36.4 +/* 36.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 36.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 36.7 + * 36.8 + * This code is free software; you can redistribute it and/or modify it 36.9 + * under the terms of the GNU General Public License version 2 only, as 36.10 + * published by the Free Software Foundation. Oracle designates this 36.11 + * particular file as subject to the "Classpath" exception as provided 36.12 + * by Oracle in the LICENSE file that accompanied this code. 36.13 + * 36.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 36.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 36.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 36.17 + * version 2 for more details (a copy is included in the LICENSE file that 36.18 + * accompanied this code). 36.19 + * 36.20 + * You should have received a copy of the GNU General Public License version 36.21 + * 2 along with this work; if not, write to the Free Software Foundation, 36.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 36.23 + * 36.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 36.25 + * or visit www.oracle.com if you need additional information or have any 36.26 + * questions. 36.27 + */ 36.28 + 36.29 +package pkg2; 36.30 + 36.31 +import java.lang.annotation.*; 36.32 + 36.33 +/** 36.34 + * Test Annotation class. 36.35 + * 36.36 + * @author Bhavesh Patel 36.37 + */ 36.38 +public @interface Anno1Pkg2 { 36.39 + /** 36.40 + * Comment. 36.41 + */ 36.42 + String[] value(); 36.43 +}
37.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 37.2 +++ b/test/com/sun/javadoc/testProfiles/pkg2/Anno2Pkg2.java Mon Jan 21 00:45:35 2013 -0500 37.3 @@ -0,0 +1,35 @@ 37.4 +/* 37.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 37.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 37.7 + * 37.8 + * This code is free software; you can redistribute it and/or modify it 37.9 + * under the terms of the GNU General Public License version 2 only, as 37.10 + * published by the Free Software Foundation. Oracle designates this 37.11 + * particular file as subject to the "Classpath" exception as provided 37.12 + * by Oracle in the LICENSE file that accompanied this code. 37.13 + * 37.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 37.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 37.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 37.17 + * version 2 for more details (a copy is included in the LICENSE file that 37.18 + * accompanied this code). 37.19 + * 37.20 + * You should have received a copy of the GNU General Public License version 37.21 + * 2 along with this work; if not, write to the Free Software Foundation, 37.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 37.23 + * 37.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 37.25 + * or visit www.oracle.com if you need additional information or have any 37.26 + * questions. 37.27 + */ 37.28 + 37.29 +package pkg2; 37.30 + 37.31 +import java.lang.annotation.*; 37.32 + 37.33 +/* 37.34 + * A sample interface. 37.35 + */ 37.36 +public @interface Anno2Pkg2 { 37.37 + boolean value() default true; 37.38 +}
38.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 38.2 +++ b/test/com/sun/javadoc/testProfiles/pkg2/Class1Pkg2.java Mon Jan 21 00:45:35 2013 -0500 38.3 @@ -0,0 +1,51 @@ 38.4 +/* 38.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 38.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 38.7 + * 38.8 + * This code is free software; you can redistribute it and/or modify it 38.9 + * under the terms of the GNU General Public License version 2 only, as 38.10 + * published by the Free Software Foundation. 38.11 + * 38.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 38.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 38.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 38.15 + * version 2 for more details (a copy is included in the LICENSE file that 38.16 + * accompanied this code). 38.17 + * 38.18 + * You should have received a copy of the GNU General Public License version 38.19 + * 2 along with this work; if not, write to the Free Software Foundation, 38.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 38.21 + * 38.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 38.23 + * or visit www.oracle.com if you need additional information or have any 38.24 + * questions. 38.25 + */ 38.26 + 38.27 +package pkg2; 38.28 + 38.29 +/** 38.30 + * Another test class. 38.31 + * 38.32 + * @author Bhavesh Patel 38.33 + */ 38.34 +public class Class1Pkg2 { 38.35 + 38.36 + /** 38.37 + * A sample enum. 38.38 + */ 38.39 + public static enum ModalExclusionType { 38.40 + /** 38.41 + * Test comment. 38.42 + */ 38.43 + NO_EXCLUDE, 38.44 + /** 38.45 + * Another comment. 38.46 + */ 38.47 + APPLICATION_EXCLUDE 38.48 + }; 38.49 + 38.50 + /** 38.51 + * A string constant. 38.52 + */ 38.53 + public static final String CONSTANT1 = "C2"; 38.54 +}
39.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 39.2 +++ b/test/com/sun/javadoc/testProfiles/pkg3/Class1Pkg3.java Mon Jan 21 00:45:35 2013 -0500 39.3 @@ -0,0 +1,32 @@ 39.4 +/* 39.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 39.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 39.7 + * 39.8 + * This code is free software; you can redistribute it and/or modify it 39.9 + * under the terms of the GNU General Public License version 2 only, as 39.10 + * published by the Free Software Foundation. 39.11 + * 39.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 39.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 39.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 39.15 + * version 2 for more details (a copy is included in the LICENSE file that 39.16 + * accompanied this code). 39.17 + * 39.18 + * You should have received a copy of the GNU General Public License version 39.19 + * 2 along with this work; if not, write to the Free Software Foundation, 39.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 39.21 + * 39.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 39.23 + * or visit www.oracle.com if you need additional information or have any 39.24 + * questions. 39.25 + */ 39.26 + 39.27 +package pkg3; 39.28 + 39.29 +/** 39.30 + * A test class. 39.31 + * 39.32 + * @author Bhavesh Patel 39.33 + */ 39.34 +public class Class1Pkg3 { 39.35 +}
40.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 40.2 +++ b/test/com/sun/javadoc/testProfiles/pkg3/Class2Pkg3.java Mon Jan 21 00:45:35 2013 -0500 40.3 @@ -0,0 +1,32 @@ 40.4 +/* 40.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 40.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 40.7 + * 40.8 + * This code is free software; you can redistribute it and/or modify it 40.9 + * under the terms of the GNU General Public License version 2 only, as 40.10 + * published by the Free Software Foundation. 40.11 + * 40.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 40.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 40.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 40.15 + * version 2 for more details (a copy is included in the LICENSE file that 40.16 + * accompanied this code). 40.17 + * 40.18 + * You should have received a copy of the GNU General Public License version 40.19 + * 2 along with this work; if not, write to the Free Software Foundation, 40.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 40.21 + * 40.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 40.23 + * or visit www.oracle.com if you need additional information or have any 40.24 + * questions. 40.25 + */ 40.26 + 40.27 +package pkg3; 40.28 + 40.29 +/** 40.30 + * A test class. 40.31 + * 40.32 + * @author Bhavesh Patel 40.33 + */ 40.34 +public class Class2Pkg3 { 40.35 +}
41.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 41.2 +++ b/test/com/sun/javadoc/testProfiles/pkg3/Interface1Pkg3.java Mon Jan 21 00:45:35 2013 -0500 41.3 @@ -0,0 +1,48 @@ 41.4 +/* 41.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 41.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 41.7 + * 41.8 + * This code is free software; you can redistribute it and/or modify it 41.9 + * under the terms of the GNU General Public License version 2 only, as 41.10 + * published by the Free Software Foundation. 41.11 + * 41.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 41.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 41.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 41.15 + * version 2 for more details (a copy is included in the LICENSE file that 41.16 + * accompanied this code). 41.17 + * 41.18 + * You should have received a copy of the GNU General Public License version 41.19 + * 2 along with this work; if not, write to the Free Software Foundation, 41.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 41.21 + * 41.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 41.23 + * or visit www.oracle.com if you need additional information or have any 41.24 + * questions. 41.25 + */ 41.26 + 41.27 +package pkg3; 41.28 + 41.29 +/** 41.30 + * A sample interface. 41.31 + * 41.32 + * @author Bhavesh Patel 41.33 + */ 41.34 +public interface Interface1Pkg3 { 41.35 + 41.36 + /** 41.37 + * A test method. 41.38 + * 41.39 + * @param a blah. 41.40 + * @param b blah. 41.41 + */ 41.42 + void method1(int a, int b); 41.43 + 41.44 + /** 41.45 + * Another test method. 41.46 + * 41.47 + * @param c blah. 41.48 + */ 41.49 + void method2(int c); 41.50 + 41.51 +}
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 42.2 +++ b/test/com/sun/javadoc/testProfiles/pkg4/Anno1Pkg4.java Mon Jan 21 00:45:35 2013 -0500 42.3 @@ -0,0 +1,40 @@ 42.4 +/* 42.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 42.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 42.7 + * 42.8 + * This code is free software; you can redistribute it and/or modify it 42.9 + * under the terms of the GNU General Public License version 2 only, as 42.10 + * published by the Free Software Foundation. Oracle designates this 42.11 + * particular file as subject to the "Classpath" exception as provided 42.12 + * by Oracle in the LICENSE file that accompanied this code. 42.13 + * 42.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 42.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 42.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 42.17 + * version 2 for more details (a copy is included in the LICENSE file that 42.18 + * accompanied this code). 42.19 + * 42.20 + * You should have received a copy of the GNU General Public License version 42.21 + * 2 along with this work; if not, write to the Free Software Foundation, 42.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 42.23 + * 42.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 42.25 + * or visit www.oracle.com if you need additional information or have any 42.26 + * questions. 42.27 + */ 42.28 + 42.29 +package pkg4; 42.30 + 42.31 +import java.lang.annotation.*; 42.32 + 42.33 +/** 42.34 + * Test Annotation class. 42.35 + * 42.36 + * @author Bhavesh Patel 42.37 + */ 42.38 +public @interface Anno1Pkg4 { 42.39 + /** 42.40 + * Comment. 42.41 + */ 42.42 + String[] value(); 42.43 +}
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 43.2 +++ b/test/com/sun/javadoc/testProfiles/pkg4/Class1Pkg4.java Mon Jan 21 00:45:35 2013 -0500 43.3 @@ -0,0 +1,32 @@ 43.4 +/* 43.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 43.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 43.7 + * 43.8 + * This code is free software; you can redistribute it and/or modify it 43.9 + * under the terms of the GNU General Public License version 2 only, as 43.10 + * published by the Free Software Foundation. 43.11 + * 43.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 43.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 43.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 43.15 + * version 2 for more details (a copy is included in the LICENSE file that 43.16 + * accompanied this code). 43.17 + * 43.18 + * You should have received a copy of the GNU General Public License version 43.19 + * 2 along with this work; if not, write to the Free Software Foundation, 43.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 43.21 + * 43.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 43.23 + * or visit www.oracle.com if you need additional information or have any 43.24 + * questions. 43.25 + */ 43.26 + 43.27 +package pkg4; 43.28 + 43.29 +/** 43.30 + * Another test class. 43.31 + * 43.32 + * @author Bhavesh Patel 43.33 + */ 43.34 +public class Class1Pkg4 { 43.35 +}
44.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 44.2 +++ b/test/com/sun/javadoc/testProfiles/pkg5/Class1Pkg5.java Mon Jan 21 00:45:35 2013 -0500 44.3 @@ -0,0 +1,32 @@ 44.4 +/* 44.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 44.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 44.7 + * 44.8 + * This code is free software; you can redistribute it and/or modify it 44.9 + * under the terms of the GNU General Public License version 2 only, as 44.10 + * published by the Free Software Foundation. 44.11 + * 44.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 44.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 44.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 44.15 + * version 2 for more details (a copy is included in the LICENSE file that 44.16 + * accompanied this code). 44.17 + * 44.18 + * You should have received a copy of the GNU General Public License version 44.19 + * 2 along with this work; if not, write to the Free Software Foundation, 44.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 44.21 + * 44.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 44.23 + * or visit www.oracle.com if you need additional information or have any 44.24 + * questions. 44.25 + */ 44.26 + 44.27 +package pkg5; 44.28 + 44.29 +/** 44.30 + * A test class. 44.31 + * 44.32 + * @author Bhavesh Patel 44.33 + */ 44.34 +public class Class1Pkg5 { 44.35 +}
45.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 45.2 +++ b/test/com/sun/javadoc/testProfiles/pkg5/Interface1Pkg5.java Mon Jan 21 00:45:35 2013 -0500 45.3 @@ -0,0 +1,40 @@ 45.4 +/* 45.5 + * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 45.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 45.7 + * 45.8 + * This code is free software; you can redistribute it and/or modify it 45.9 + * under the terms of the GNU General Public License version 2 only, as 45.10 + * published by the Free Software Foundation. 45.11 + * 45.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 45.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 45.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 45.15 + * version 2 for more details (a copy is included in the LICENSE file that 45.16 + * accompanied this code). 45.17 + * 45.18 + * You should have received a copy of the GNU General Public License version 45.19 + * 2 along with this work; if not, write to the Free Software Foundation, 45.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 45.21 + * 45.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 45.23 + * or visit www.oracle.com if you need additional information or have any 45.24 + * questions. 45.25 + */ 45.26 + 45.27 +package pkg5; 45.28 + 45.29 +/** 45.30 + * A sample interface. 45.31 + * 45.32 + * @author Bhavesh Patel 45.33 + */ 45.34 +public interface Interface1Pkg5 { 45.35 + 45.36 + /** 45.37 + * A test method. 45.38 + * 45.39 + * @param a blah. 45.40 + * @param b blah. 45.41 + */ 45.42 + void method1(int a, int b); 45.43 +}
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 46.2 +++ b/test/com/sun/javadoc/testProfiles/profile-rtjar-includes.txt Mon Jan 21 00:45:35 2013 -0500 46.3 @@ -0,0 +1,42 @@ 46.4 +PROFILE_1_RTJAR_INCLUDE_PACKAGES := \ 46.5 + pkg2 46.6 + 46.7 +PROFILE_1_RTJAR_INCLUDE_TYPES := \ 46.8 + pkg3/Class1Pkg3.class 46.9 + 46.10 +PROFILE_1_RTJAR_EXCLUDE_TYPES := 46.11 + 46.12 +PROFILE_1_INCLUDE_METAINF_SERVICES := 46.13 + 46.14 + 46.15 +PROFILE_2_RTJAR_INCLUDE_PACKAGES := \ 46.16 + pkg4 46.17 + 46.18 +PROFILE_2_RTJAR_INCLUDE_TYPES := 46.19 + 46.20 +PROFILE_2_RTJAR_EXCLUDE_TYPES := \ 46.21 + pkg4/Anno1Pkg4.class 46.22 + 46.23 +PROFILE_2_INCLUDE_METAINF_SERVICES := 46.24 + 46.25 + 46.26 +PROFILE_3_RTJAR_INCLUDE_PACKAGES := \ 46.27 + pkg5 46.28 + 46.29 +PROFILE_3_RTJAR_INCLUDE_TYPES := 46.30 + 46.31 +PROFILE_3_RTJAR_EXCLUDE_TYPES := 46.32 + 46.33 +PROFILE_3_INCLUDE_METAINF_SERVICES := 46.34 + 46.35 + 46.36 +PROFILE_4_RTJAR_INCLUDE_PACKAGES := \ 46.37 + pkg1 46.38 + 46.39 +PROFILE_4_RTJAR_INCLUDE_TYPES := 46.40 + 46.41 +PROFILE_4_RTJAR_EXCLUDE_TYPES := 46.42 + 46.43 +PROFILE_4_INCLUDE_METAINF_SERVICES := 46.44 + 46.45 +