diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/Taglet.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/Taglet.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/Taglet.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets; - -import com.sun.javadoc.*; - -/** - * The interface for a custom tag used by Doclets. A custom - * tag must implement this interface. - * - *

- * Note: This interface has been superseded by one - * in the new package {@code jdk.javadoc.doclet.taglet}. - *

- * - * To be loaded and used by - * doclets at run-time, the taglet must have a static method called - * register that accepts a {@link java.util.Map} as an - * argument with the following signature: - *
- *   public void register(Map map)
- * 
- * This method should add an instance of the custom taglet to the map - * with the name of the taglet as the key. If overriding a taglet, - * to avoid a name conflict, the overridden taglet must be deleted from - * the map before an instance of the new taglet is added to the map. - *

- * It is recommended that the taglet throw an exception when it fails - * to register itself. The exception that it throws is up to the user. - *

- * Here are two sample taglets:
- *

- *

- * For more information on how to create your own Taglets, please see the - * Taglet Overview. - * - * @since 1.4 - * @author Jamie Ho - * - * @deprecated - * This interface has been superseded by one in the new package {@code jdk.javadoc.doclet.taglet}. - */ -@Deprecated -public interface Taglet { - - /** - * Return true if this Taglet - * is used in field documentation. Set to - * false for inline tags. - * @return true if this Taglet - * is used in field documentation and false - * otherwise. - */ - public abstract boolean inField(); - - /** - * Return true if this Taglet - * is used in constructor documentation. Set to - * false for inline tags. - * @return true if this Taglet - * is used in constructor documentation and false - * otherwise. - */ - public abstract boolean inConstructor(); - - /** - * Return true if this Taglet - * is used in method documentation. Set to - * false for inline tags. - * @return true if this Taglet - * is used in method documentation and false - * otherwise. - */ - public abstract boolean inMethod(); - - /** - * Return true if this Taglet - * is used in overview documentation. Set to - * false for inline tags. - * @return true if this Taglet - * is used in method documentation and false - * otherwise. - */ - public abstract boolean inOverview(); - - /** - * Return true if this Taglet - * is used in package documentation. Set to - * false for inline tags. - * @return true if this Taglet - * is used in package documentation and false - * otherwise. - */ - public abstract boolean inPackage(); - - /** - * Return true if this Taglet - * is used in type documentation (classes or - * interfaces). Set to false for inline tags. - * @return true if this Taglet - * is used in type documentation and false - * otherwise. - */ - public abstract boolean inType(); - - /** - * Return true if this Taglet - * is an inline tag. Return false otherwise. - * @return true if this Taglet - * is an inline tag and false otherwise. - */ - public abstract boolean isInlineTag(); - - /** - * Return the name of this custom tag. - * @return the name of this custom tag. - */ - public abstract String getName(); - - /** - * Given the Tag representation of this custom - * tag, return its string representation, which is output - * to the generated page. - * @param tag the Tag representation of this custom tag. - * @return the string representation of this Tag. - */ - public abstract String toString(Tag tag); - - /** - * Given an array of Tags representing this custom - * tag, return its string representation, which is output - * to the generated page. This method should - * return null if this taglet represents an inline tag. - * @param tags the array of Tags representing of this custom tag. - * @return the string representation of this Tag. - */ - public abstract String toString(Tag[] tags); - -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Print method and constructor info. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert Field - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public abstract class AbstractExecutableMemberWriter extends AbstractMemberWriter { - - public AbstractExecutableMemberWriter(SubWriterHolderWriter writer, - ClassDoc classdoc) { - super(writer, classdoc); - } - - public AbstractExecutableMemberWriter(SubWriterHolderWriter writer) { - super(writer); - } - - /** - * Add the type parameters for the executable member. - * - * @param member the member to write type parameters for. - * @param htmltree the content tree to which the parameters will be added. - */ - protected void addTypeParameters(ExecutableMemberDoc member, Content htmltree) { - Content typeParameters = getTypeParameters(member); - if (!typeParameters.isEmpty()) { - htmltree.addContent(typeParameters); - htmltree.addContent(writer.getSpace()); - } - } - - /** - * Get the type parameters for the executable member. - * - * @param member the member for which to get the type parameters. - * @return the type parameters. - */ - protected Content getTypeParameters(ExecutableMemberDoc member) { - LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.MEMBER_TYPE_PARAMS, member); - return writer.getTypeParameterLinks(linkInfo); - } - - /** - * {@inheritDoc} - */ - protected Content getDeprecatedLink(ProgramElementDoc member) { - ExecutableMemberDoc emd = (ExecutableMemberDoc)member; - return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, (MemberDoc) emd, - emd.qualifiedName() + emd.flatSignature()); - } - - /** - * Add the summary link for the member. - * - * @param context the id of the context where the link will be printed - * @param cd the classDoc that we should link to - * @param member the member being linked to - * @param tdSummary the content tree to which the link will be added - */ - protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member, - Content tdSummary) { - ExecutableMemberDoc emd = (ExecutableMemberDoc)member; - String name = emd.name(); - Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, - writer.getDocLink(context, cd, (MemberDoc) emd, - name, false)); - Content code = HtmlTree.CODE(memberLink); - addParameters(emd, false, code, name.length() - 1); - tdSummary.addContent(code); - } - - /** - * Add the inherited summary link for the member. - * - * @param cd the classDoc that we should link to - * @param member the member being linked to - * @param linksTree the content tree to which the link will be added - */ - protected void addInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member, Content linksTree) { - linksTree.addContent( - writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc) member, - member.name(), false)); - } - - /** - * Add the parameter for the executable member. - * - * @param member the member to write parameter for. - * @param param the parameter that needs to be written. - * @param isVarArg true if this is a link to var arg. - * @param tree the content tree to which the parameter information will be added. - */ - protected void addParam(ExecutableMemberDoc member, Parameter param, - boolean isVarArg, Content tree) { - if (param.type() != null) { - Content link = writer.getLink(new LinkInfoImpl( - configuration, LinkInfoImpl.Kind.EXECUTABLE_MEMBER_PARAM, - param.type()).varargs(isVarArg)); - tree.addContent(link); - } - if(param.name().length() > 0) { - tree.addContent(writer.getSpace()); - tree.addContent(param.name()); - } - } - - /** - * Add the receiver annotations information. - * - * @param member the member to write receiver annotations for. - * @param rcvrType the receiver type. - * @param descList list of annotation description. - * @param tree the content tree to which the information will be added. - */ - protected void addReceiverAnnotations(ExecutableMemberDoc member, Type rcvrType, - AnnotationDesc[] descList, Content tree) { - writer.addReceiverAnnotationInfo(member, descList, tree); - tree.addContent(writer.getSpace()); - tree.addContent(rcvrType.typeName()); - LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_SIGNATURE, rcvrType); - tree.addContent(writer.getTypeParameterLinks(linkInfo)); - tree.addContent(writer.getSpace()); - tree.addContent("this"); - } - - - /** - * Add all the parameters for the executable member. - * - * @param member the member to write parameters for. - * @param htmltree the content tree to which the parameters information will be added. - */ - protected void addParameters(ExecutableMemberDoc member, Content htmltree, int indentSize) { - addParameters(member, true, htmltree, indentSize); - } - - /** - * Add all the parameters for the executable member. - * - * @param member the member to write parameters for. - * @param includeAnnotations true if annotation information needs to be added. - * @param htmltree the content tree to which the parameters information will be added. - */ - protected void addParameters(ExecutableMemberDoc member, - boolean includeAnnotations, Content htmltree, int indentSize) { - htmltree.addContent("("); - String sep = ""; - Parameter[] params = member.parameters(); - String indent = makeSpace(indentSize + 1); - Type rcvrType = member.receiverType(); - if (includeAnnotations && rcvrType instanceof AnnotatedType) { - AnnotationDesc[] descList = rcvrType.asAnnotatedType().annotations(); - if (descList.length > 0) { - addReceiverAnnotations(member, rcvrType, descList, htmltree); - sep = "," + DocletConstants.NL + indent; - } - } - int paramstart; - for (paramstart = 0; paramstart < params.length; paramstart++) { - htmltree.addContent(sep); - Parameter param = params[paramstart]; - if (!param.name().startsWith("this$")) { - if (includeAnnotations) { - boolean foundAnnotations = - writer.addAnnotationInfo(indent.length(), - member, param, htmltree); - if (foundAnnotations) { - htmltree.addContent(DocletConstants.NL); - htmltree.addContent(indent); - } - } - addParam(member, param, - (paramstart == params.length - 1) && member.isVarArgs(), htmltree); - break; - } - } - - for (int i = paramstart + 1; i < params.length; i++) { - htmltree.addContent(","); - htmltree.addContent(DocletConstants.NL); - htmltree.addContent(indent); - if (includeAnnotations) { - boolean foundAnnotations = - writer.addAnnotationInfo(indent.length(), member, params[i], - htmltree); - if (foundAnnotations) { - htmltree.addContent(DocletConstants.NL); - htmltree.addContent(indent); - } - } - addParam(member, params[i], (i == params.length - 1) && member.isVarArgs(), - htmltree); - } - htmltree.addContent(")"); - } - - /** - * Add exceptions for the executable member. - * - * @param member the member to write exceptions for. - * @param htmltree the content tree to which the exceptions information will be added. - */ - protected void addExceptions(ExecutableMemberDoc member, Content htmltree, int indentSize) { - Type[] exceptions = member.thrownExceptionTypes(); - if (exceptions.length > 0) { - LinkInfoImpl memberTypeParam = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.MEMBER, member); - String indent = makeSpace(indentSize + 1 - 7); - htmltree.addContent(DocletConstants.NL); - htmltree.addContent(indent); - htmltree.addContent("throws "); - indent = makeSpace(indentSize + 1); - Content link = writer.getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.MEMBER, exceptions[0])); - htmltree.addContent(link); - for(int i = 1; i < exceptions.length; i++) { - htmltree.addContent(","); - htmltree.addContent(DocletConstants.NL); - htmltree.addContent(indent); - Content exceptionLink = writer.getLink(new LinkInfoImpl( - configuration, LinkInfoImpl.Kind.MEMBER, exceptions[i])); - htmltree.addContent(exceptionLink); - } - } - } - - protected ClassDoc implementsMethodInIntfac(MethodDoc method, - ClassDoc[] intfacs) { - for (ClassDoc intf : intfacs) { - MethodDoc[] methods = intf.methods(); - if (methods.length > 0) { - for (MethodDoc md : methods) { - if (md.name().equals(method.name()) && - md.signature().equals(method.signature())) { - return intf; - } - } - } - } - return null; - } - - /** - * For backward compatibility, include an anchor using the erasures of the - * parameters. NOTE: We won't need this method anymore after we fix - * see tags so that they use the type instead of the erasure. - * - * @param emd the ExecutableMemberDoc to anchor to. - * @return the 1.4.x style anchor for the ExecutableMemberDoc. - */ - protected String getErasureAnchor(ExecutableMemberDoc emd) { - StringBuilder buf = new StringBuilder(emd.name() + "("); - Parameter[] params = emd.parameters(); - boolean foundTypeVariable = false; - for (int i = 0; i < params.length; i++) { - if (i > 0) { - buf.append(","); - } - Type t = params[i].type(); - foundTypeVariable = foundTypeVariable || t.asTypeVariable() != null; - buf.append(t.isPrimitive() ? - t.typeName() : t.asClassDoc().qualifiedName()); - buf.append(t.dimension()); - } - buf.append(")"); - return foundTypeVariable ? writer.getName(buf.toString()) : null; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java +++ /dev/null @@ -1,436 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; -import java.nio.file.*; -import java.util.zip.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate Index for all the Member Names with Indexing in - * Unicode Order. This class is a base class for {@link SingleIndexWriter} and - * {@link SplitIndexWriter}. It uses the functionality from - * {@link HtmlDocletWriter} to generate the Index Contents. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @see IndexBuilder - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class AbstractIndexWriter extends HtmlDocletWriter { - - /** - * The index of all the members with unicode character. - */ - protected IndexBuilder indexbuilder; - - /** - * This constructor will be used by {@link SplitIndexWriter}. Initializes - * path to this file and relative path from this file. - * - * @param configuration The current configuration - * @param path Path to the file which is getting generated. - * @param indexbuilder Unicode based Index from {@link IndexBuilder} - */ - protected AbstractIndexWriter(ConfigurationImpl configuration, - DocPath path, - IndexBuilder indexbuilder) - throws IOException { - super(configuration, path); - this.indexbuilder = indexbuilder; - } - - /** - * Get the index label for navigation bar. - * - * @return a content tree for the tree label - */ - protected Content getNavLinkIndex() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, indexLabel); - return li; - } - - /** - * Add the member information for the unicode character along with the - * list of the members. - * - * @param uc Unicode for which member list information to be generated - * @param memberlist List of members for the unicode character - * @param contentTree the content tree to which the information will be added - */ - protected void addContents(Character uc, List memberlist, - Content contentTree) { - addHeading(uc, contentTree); - int memberListSize = memberlist.size(); - // Display the list only if there are elements to be displayed. - if (memberListSize > 0) { - Content dl = new HtmlTree(HtmlTag.DL); - for (Doc element : memberlist) { - addDescription(dl, element); - } - contentTree.addContent(dl); - } - } - - protected void addSearchContents(Character uc, List searchList, - Content contentTree) { - addHeading(uc, contentTree); - // Display the list only if there are elements to be displayed. - if (!searchList.isEmpty()) { - Content dl = new HtmlTree(HtmlTag.DL); - for (SearchIndexItem sii : searchList) { - addDescription(sii, dl); - } - contentTree.addContent(dl); - } - } - - protected void addContents(Character uc, List memberlist, List searchList, - Content contentTree) { - addHeading(uc, contentTree); - int memberListSize = memberlist.size(); - int searchListSize = searchList.size(); - int i = 0; - int j = 0; - Content dl = new HtmlTree(HtmlTag.DL); - while (i < memberListSize && j < searchListSize) { - if (memberlist.get(i).name().compareTo(searchList.get(j).getLabel()) < 0) { - addDescription(dl, memberlist.get(i)); - i++; - } else if (memberlist.get(i).name().compareTo(searchList.get(j).getLabel()) > 0) { - addDescription(searchList.get(j), dl); - j++; - } else { - addDescription(dl, memberlist.get(i)); - addDescription(searchList.get(j), dl); - j++; - i++; - } - } - if (i >= memberListSize) { - while (j < searchListSize) { - addDescription(searchList.get(j), dl); - j++; - } - } - if (j >= searchListSize) { - while (i < memberListSize) { - addDescription(dl, memberlist.get(i)); - i++; - } - } - contentTree.addContent(dl); - } - - protected void addHeading(Character uc, Content contentTree) { - String unicode = uc.toString(); - contentTree.addContent(getMarkerAnchorForIndex(unicode)); - Content headContent = new StringContent(unicode); - Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, false, - HtmlStyle.title, headContent); - contentTree.addContent(heading); - } - - protected void addDescription(Content dl, Doc element) { - SearchIndexItem si = new SearchIndexItem(); - if (element instanceof MemberDoc) { - addDescription((MemberDoc) element, dl, si); - configuration.memberSearchIndex.add(si); - } else if (element instanceof ClassDoc) { - addDescription((ClassDoc) element, dl, si); - configuration.typeSearchIndex.add(si); - } else if (element instanceof PackageDoc) { - addDescription((PackageDoc) element, dl, si); - configuration.packageSearchIndex.add(si); - } - } - /** - * Add one line summary comment for the package. - * - * @param pkg the package to be documented - * @param dlTree the content tree to which the description will be added - */ - protected void addDescription(PackageDoc pkg, Content dlTree, SearchIndexItem si) { - Content link = getPackageLink(pkg, new StringContent(utils.getPackageName(pkg))); - si.setLabel(utils.getPackageName(pkg)); - si.setCategory(getResource("doclet.Packages").toString()); - Content dt = HtmlTree.DT(link); - dt.addContent(" - "); - dt.addContent(getResource("doclet.package")); - dt.addContent(" " + pkg.name()); - dlTree.addContent(dt); - Content dd = new HtmlTree(HtmlTag.DD); - addSummaryComment(pkg, dd); - dlTree.addContent(dd); - } - - /** - * Add one line summary comment for the class. - * - * @param cd the class being documented - * @param dlTree the content tree to which the description will be added - */ - protected void addDescription(ClassDoc cd, Content dlTree, SearchIndexItem si) { - Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.INDEX, cd).strong(true)); - si.setContainingPackage(utils.getPackageName(cd.containingPackage())); - si.setLabel(cd.typeName()); - si.setCategory(getResource("doclet.Types").toString()); - Content dt = HtmlTree.DT(link); - dt.addContent(" - "); - addClassInfo(cd, dt); - dlTree.addContent(dt); - Content dd = new HtmlTree(HtmlTag.DD); - addComment(cd, dd); - dlTree.addContent(dd); - } - - /** - * Add the classkind (class, interface, exception), error of the class - * passed. - * - * @param cd the class being documented - * @param contentTree the content tree to which the class info will be added - */ - protected void addClassInfo(ClassDoc cd, Content contentTree) { - contentTree.addContent(getResource("doclet.in", - utils.getTypeName(configuration, cd, false), - getPackageLink(cd.containingPackage(), - utils.getPackageName(cd.containingPackage())) - )); - } - - /** - * Add description for Class, Field, Method or Constructor. - * - * @param member MemberDoc for the member of the Class Kind - * @param dlTree the content tree to which the description will be added - */ - protected void addDescription(MemberDoc member, Content dlTree, SearchIndexItem si) { - String name = (member instanceof ExecutableMemberDoc)? - member.name() + ((ExecutableMemberDoc)member).flatSignature() : - member.name(); - si.setContainingPackage(utils.getPackageName((member.containingClass()).containingPackage())); - si.setContainingClass((member.containingClass()).typeName()); - if (member instanceof ExecutableMemberDoc) { - ExecutableMemberDoc emd = (ExecutableMemberDoc)member; - si.setLabel(member.name() + emd.flatSignature()); - if (!((emd.signature()).equals(emd.flatSignature()))) { - si.setUrl(getName(getAnchor((ExecutableMemberDoc) member))); - } - } else { - si.setLabel(member.name()); - } - si.setCategory(getResource("doclet.Members").toString()); - Content span = HtmlTree.SPAN(HtmlStyle.memberNameLink, - getDocLink(LinkInfoImpl.Kind.INDEX, member, name)); - Content dt = HtmlTree.DT(span); - dt.addContent(" - "); - addMemberDesc(member, dt); - dlTree.addContent(dt); - Content dd = new HtmlTree(HtmlTag.DD); - addComment(member, dd); - dlTree.addContent(dd); - } - - protected void addDescription(SearchIndexItem sii, Content dlTree) { - String path = pathToRoot.isEmpty() ? "" : pathToRoot.getPath() + "/"; - path += sii.getUrl(); - HtmlTree labelLink = HtmlTree.A(path, new StringContent(sii.getLabel())); - Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.searchTagLink, labelLink)); - dt.addContent(" - "); - dt.addContent(getResource("doclet.Search_tag_in", sii.getHolder())); - dlTree.addContent(dt); - Content dd = new HtmlTree(HtmlTag.DD); - if (sii.getDescription().isEmpty()) { - dd.addContent(getSpace()); - } else { - dd.addContent(sii.getDescription()); - } - dlTree.addContent(dd); - } - - /** - * Add comment for each element in the index. If the element is deprecated - * and it has a @deprecated tag, use that comment. Else if the containing - * class for this element is deprecated, then add the word "Deprecated." at - * the start and then print the normal comment. - * - * @param element Index element - * @param contentTree the content tree to which the comment will be added - */ - protected void addComment(ProgramElementDoc element, Content contentTree) { - Tag[] tags; - Content span = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.block); - if (utils.isDeprecated(element)) { - div.addContent(span); - if ((tags = element.tags("deprecated")).length > 0) - addInlineDeprecatedComment(element, tags[0], div); - contentTree.addContent(div); - } else { - ClassDoc cont = element.containingClass(); - while (cont != null) { - if (utils.isDeprecated(cont)) { - div.addContent(span); - contentTree.addContent(div); - break; - } - cont = cont.containingClass(); - } - addSummaryComment(element, contentTree); - } - } - - /** - * Add description about the Static Varible/Method/Constructor for a - * member. - * - * @param member MemberDoc for the member within the Class Kind - * @param contentTree the content tree to which the member description will be added - */ - protected void addMemberDesc(MemberDoc member, Content contentTree) { - ClassDoc containing = member.containingClass(); - String classdesc = utils.getTypeName( - configuration, containing, true) + " "; - if (member.isField()) { - if (member.isStatic()) { - contentTree.addContent( - getResource("doclet.Static_variable_in", classdesc)); - } else { - contentTree.addContent( - getResource("doclet.Variable_in", classdesc)); - } - } else if (member.isConstructor()) { - contentTree.addContent( - getResource("doclet.Constructor_for", classdesc)); - } else if (member.isMethod()) { - if (member.isStatic()) { - contentTree.addContent( - getResource("doclet.Static_method_in", classdesc)); - } else { - contentTree.addContent( - getResource("doclet.Method_in", classdesc)); - } - } - addPreQualifiedClassLink(LinkInfoImpl.Kind.INDEX, containing, - false, contentTree); - } - - /** - * Get the marker anchor which will be added to the index documentation tree. - * - * @param anchorNameForIndex the anchor name attribute for index page - * @return a content tree for the marker anchor - */ - public Content getMarkerAnchorForIndex(String anchorNameForIndex) { - return getMarkerAnchor(getNameForIndex(anchorNameForIndex), null); - } - - /** - * Generate a valid HTML name for member index page. - * - * @param unicode the string that needs to be converted to valid HTML name. - * @return a valid HTML name string. - */ - public String getNameForIndex(String unicode) { - return "I:" + getName(unicode); - } - - protected void createSearchIndexFiles() { - createSearchIndexFile(DocPaths.PACKAGE_SEARCH_INDEX_JSON, DocPaths.PACKAGE_SEARCH_INDEX_ZIP, - configuration.packageSearchIndex); - createSearchIndexFile(DocPaths.TYPE_SEARCH_INDEX_JSON, DocPaths.TYPE_SEARCH_INDEX_ZIP, - configuration.typeSearchIndex); - createSearchIndexFile(DocPaths.MEMBER_SEARCH_INDEX_JSON, DocPaths.MEMBER_SEARCH_INDEX_ZIP, - configuration.memberSearchIndex); - createSearchIndexFile(DocPaths.TAG_SEARCH_INDEX_JSON, DocPaths.TAG_SEARCH_INDEX_ZIP, - configuration.tagSearchIndex); - } - - protected void createSearchIndexFile(DocPath searchIndexFile, DocPath searchIndexZip, - List searchIndex) { - if (!searchIndex.isEmpty()) { - try { - StringBuilder searchVar = new StringBuilder("["); - boolean first = true; - DocFile searchFile = DocFile.createFileForOutput(configuration, searchIndexFile); - Path p = Paths.get(searchFile.getPath()); - for (SearchIndexItem item : searchIndex) { - if (first) { - searchVar.append(item.toString()); - first = false; - } else { - searchVar.append(",").append(item.toString()); - } - } - searchVar.append("]"); - Files.write(p, searchVar.toString().getBytes()); - DocFile zipFile = DocFile.createFileForOutput(configuration, searchIndexZip); - try (FileOutputStream fos = new FileOutputStream(zipFile.getPath()); - ZipOutputStream zos = new ZipOutputStream(fos)) { - zipFile(searchFile.getPath(), searchIndexFile, zos); - } - Files.delete(p); - } catch (IOException ie) { - throw new DocletAbortException(ie); - } - } - } - - protected void zipFile(String inputFile, DocPath file, ZipOutputStream zos) { - try { - try { - ZipEntry ze = new ZipEntry(file.getPath()); - zos.putNextEntry(ze); - try (FileInputStream fis = new FileInputStream(new File(inputFile))) { - byte[] buf = new byte[2048]; - int len = fis.read(buf); - while (len > 0) { - zos.write(buf, 0, len); - len = fis.read(buf); - } - } - } finally { - zos.closeEntry(); - } - } catch (IOException e) { - throw new DocletAbortException(e); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java +++ /dev/null @@ -1,699 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.lang.reflect.Modifier; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.taglets.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * The base class for member writers. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert Field - * @author Atul M Dambalkar - * @author Jamie Ho (Re-write) - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public abstract class AbstractMemberWriter { - - protected final ConfigurationImpl configuration; - protected final Utils utils; - protected final SubWriterHolderWriter writer; - protected final ClassDoc classdoc; - protected Map typeMap = new LinkedHashMap<>(); - protected Set methodTypes = EnumSet.noneOf(MethodTypes.class); - private int methodTypesOr = 0; - public final boolean nodepr; - - protected boolean printedSummaryHeader = false; - - public AbstractMemberWriter(SubWriterHolderWriter writer, ClassDoc classdoc) { - this.configuration = writer.configuration; - this.writer = writer; - this.nodepr = configuration.nodeprecated; - this.classdoc = classdoc; - this.utils = writer.configuration.utils; - } - - public AbstractMemberWriter(SubWriterHolderWriter writer) { - this(writer, null); - } - - /*** abstracts ***/ - - /** - * Add the summary label for the member. - * - * @param memberTree the content tree to which the label will be added - */ - public abstract void addSummaryLabel(Content memberTree); - - /** - * Get the summary for the member summary table. - * - * @return a string for the table summary - */ - public abstract String getTableSummary(); - - /** - * Get the caption for the member summary table. - * - * @return a string for the table caption - */ - public abstract Content getCaption(); - - /** - * Get the summary table header for the member. - * - * @param member the member to be documented - * @return the summary table header - */ - public abstract String[] getSummaryTableHeader(ProgramElementDoc member); - - /** - * Add inherited summary lable for the member. - * - * @param cd the class doc to which to link to - * @param inheritedTree the content tree to which the inherited summary label will be added - */ - public abstract void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree); - - /** - * Add the anchor for the summary section of the member. - * - * @param cd the class doc to be documented - * @param memberTree the content tree to which the summary anchor will be added - */ - public abstract void addSummaryAnchor(ClassDoc cd, Content memberTree); - - /** - * Add the anchor for the inherited summary section of the member. - * - * @param cd the class doc to be documented - * @param inheritedTree the content tree to which the inherited summary anchor will be added - */ - public abstract void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree); - - /** - * Add the summary type for the member. - * - * @param member the member to be documented - * @param tdSummaryType the content tree to which the type will be added - */ - protected abstract void addSummaryType(ProgramElementDoc member, - Content tdSummaryType); - - /** - * Add the summary link for the member. - * - * @param cd the class doc to be documented - * @param member the member to be documented - * @param tdSummary the content tree to which the link will be added - */ - protected void addSummaryLink(ClassDoc cd, ProgramElementDoc member, - Content tdSummary) { - addSummaryLink(LinkInfoImpl.Kind.MEMBER, cd, member, tdSummary); - } - - /** - * Add the summary link for the member. - * - * @param context the id of the context where the link will be printed - * @param cd the class doc to be documented - * @param member the member to be documented - * @param tdSummary the content tree to which the summary link will be added - */ - protected abstract void addSummaryLink(LinkInfoImpl.Kind context, - ClassDoc cd, ProgramElementDoc member, Content tdSummary); - - /** - * Add the inherited summary link for the member. - * - * @param cd the class doc to be documented - * @param member the member to be documented - * @param linksTree the content tree to which the inherited summary link will be added - */ - protected abstract void addInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member, Content linksTree); - - /** - * Get the deprecated link. - * - * @param member the member being linked to - * @return a content tree representing the link - */ - protected abstract Content getDeprecatedLink(ProgramElementDoc member); - - /** - * Get the navigation summary link. - * - * @param cd the class doc to be documented - * @param link true if its a link else the label to be printed - * @return a content tree for the navigation summary link. - */ - protected abstract Content getNavSummaryLink(ClassDoc cd, boolean link); - - /** - * Add the navigation detail link. - * - * @param link true if its a link else the label to be printed - * @param liNav the content tree to which the navigation detail link will be added - */ - protected abstract void addNavDetailLink(boolean link, Content liNav); - - /** - * Add the member name to the content tree. - * - * @param name the member name to be added to the content tree. - * @param htmltree the content tree to which the name will be added. - */ - protected void addName(String name, Content htmltree) { - htmltree.addContent(name); - } - - /** - * Return a string describing the access modifier flags. - * Don't include native or synchronized. - * - * The modifier names are returned in canonical order, as - * specified by The Java Language Specification. - */ - protected String modifierString(MemberDoc member) { - int ms = member.modifierSpecifier(); - int no = Modifier.NATIVE | Modifier.SYNCHRONIZED; - return Modifier.toString(ms & ~no); - } - - protected String typeString(MemberDoc member) { - String type = ""; - if (member instanceof MethodDoc) { - type = ((MethodDoc)member).returnType().toString(); - } else if (member instanceof FieldDoc) { - type = ((FieldDoc)member).type().toString(); - } - return type; - } - - /** - * Add the modifier for the member. - * - * @param member the member for which teh modifier will be added. - * @param htmltree the content tree to which the modifier information will be added. - */ - protected void addModifiers(MemberDoc member, Content htmltree) { - String mod = modifierString(member); - // According to JLS, we should not be showing public modifier for - // interface methods. - if ((member.isField() || member.isMethod()) && - writer instanceof ClassWriterImpl && - ((ClassWriterImpl) writer).getClassDoc().isInterface()) { - // This check for isDefault() and the default modifier needs to be - // added for it to appear on the method details section. Once the - // default modifier is added to the Modifier list on DocEnv and once - // it is updated to use the javax.lang.model.element.Modifier, we - // will need to remove this. - mod = (member.isMethod() && ((MethodDoc)member).isDefault()) ? - utils.replaceText(mod, "public", "default").trim() : - utils.replaceText(mod, "public", "").trim(); - } - if(mod.length() > 0) { - htmltree.addContent(mod); - htmltree.addContent(writer.getSpace()); - } - } - - protected String makeSpace(int len) { - if (len <= 0) { - return ""; - } - StringBuilder sb = new StringBuilder(len); - for (int i = 0; i < len; i++) { - sb.append(' '); - } - return sb.toString(); - } - - /** - * Add the modifier and type for the member in the member summary. - * - * @param member the member to add the type for - * @param type the type to add - * @param tdSummaryType the content tree to which the modified and type will be added - */ - protected void addModifierAndType(ProgramElementDoc member, Type type, - Content tdSummaryType) { - HtmlTree code = new HtmlTree(HtmlTag.CODE); - addModifier(member, code); - if (type == null) { - if (member.isClass()) { - code.addContent("class"); - } else { - code.addContent("interface"); - } - code.addContent(writer.getSpace()); - } else { - if (member instanceof ExecutableMemberDoc && - ((ExecutableMemberDoc) member).typeParameters().length > 0) { - Content typeParameters = ((AbstractExecutableMemberWriter) this).getTypeParameters( - (ExecutableMemberDoc) member); - code.addContent(typeParameters); - //Code to avoid ugly wrapping in member summary table. - if (typeParameters.charCount() > 10) { - code.addContent(new HtmlTree(HtmlTag.BR)); - } else { - code.addContent(writer.getSpace()); - } - code.addContent( - writer.getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))); - } else { - code.addContent( - writer.getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.SUMMARY_RETURN_TYPE, type))); - } - - } - tdSummaryType.addContent(code); - } - - /** - * Add the modifier for the member. - * - * @param member the member to add the type for - * @param code the content tree to which the modified will be added - */ - private void addModifier(ProgramElementDoc member, Content code) { - if (member.isProtected()) { - code.addContent("protected "); - } else if (member.isPrivate()) { - code.addContent("private "); - } else if (!member.isPublic()) { // Package private - code.addContent(configuration.getText("doclet.Package_private")); - code.addContent(" "); - } - if (member.isMethod()) { - if (!(member.containingClass().isInterface()) && - ((MethodDoc)member).isAbstract()) { - code.addContent("abstract "); - } - // This check for isDefault() and the default modifier needs to be - // added for it to appear on the "Modifier and Type" column in the - // method summary section. Once the default modifier is added - // to the Modifier list on DocEnv and once it is updated to use the - // javax.lang.model.element.Modifier, we will need to remove this. - if (((MethodDoc)member).isDefault()) { - code.addContent("default "); - } - } - if (member.isStatic()) { - code.addContent("static "); - } - } - - /** - * Add the deprecated information for the given member. - * - * @param member the member being documented. - * @param contentTree the content tree to which the deprecated information will be added. - */ - protected void addDeprecatedInfo(ProgramElementDoc member, Content contentTree) { - Content output = (new DeprecatedTaglet()).getTagletOutput(member, - writer.getTagletWriterInstance(false)); - if (!output.isEmpty()) { - Content deprecatedContent = output; - Content div = HtmlTree.DIV(HtmlStyle.block, deprecatedContent); - contentTree.addContent(div); - } - } - - /** - * Add the comment for the given member. - * - * @param member the member being documented. - * @param htmltree the content tree to which the comment will be added. - */ - protected void addComment(ProgramElementDoc member, Content htmltree) { - if (member.inlineTags().length > 0) { - writer.addInlineComment(member, htmltree); - } - } - - protected String name(ProgramElementDoc member) { - return member.name(); - } - - /** - * Get the header for the section. - * - * @param member the member being documented. - * @return a header content for the section. - */ - protected Content getHead(MemberDoc member) { - Content memberContent = new StringContent(member.name()); - Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, memberContent); - return heading; - } - - /** - * Return true if the given ProgramElement is inherited - * by the class that is being documented. - * - * @param ped The ProgramElement being checked. - * return true if the ProgramElement is being inherited and - * false otherwise. - */ - protected boolean isInherited(ProgramElementDoc ped){ - if(ped.isPrivate() || (ped.isPackagePrivate() && - ! ped.containingPackage().equals(classdoc.containingPackage()))){ - return false; - } - return true; - } - - /** - * Add deprecated information to the documentation tree - * - * @param deprmembers list of deprecated members - * @param headingKey the caption for the deprecated members table - * @param tableSummary the summary for the deprecated members table - * @param tableHeader table headers for the deprecated members table - * @param contentTree the content tree to which the deprecated members table will be added - */ - protected void addDeprecatedAPI(List deprmembers, String headingKey, - String tableSummary, String[] tableHeader, Content contentTree) { - if (deprmembers.size() > 0) { - Content caption = writer.getTableCaption(configuration.getResource(headingKey)); - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption) - : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption); - table.addContent(writer.getSummaryTableHeader(tableHeader, "col")); - Content tbody = new HtmlTree(HtmlTag.TBODY); - for (int i = 0; i < deprmembers.size(); i++) { - ProgramElementDoc member =(ProgramElementDoc)deprmembers.get(i); - HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, getDeprecatedLink(member)); - if (member.tags("deprecated").length > 0) - writer.addInlineDeprecatedComment(member, - member.tags("deprecated")[0], td); - HtmlTree tr = HtmlTree.TR(td); - if (i%2 == 0) - tr.addStyle(HtmlStyle.altColor); - else - tr.addStyle(HtmlStyle.rowColor); - tbody.addContent(tr); - } - table.addContent(tbody); - Content li = HtmlTree.LI(HtmlStyle.blockList, table); - Content ul = HtmlTree.UL(HtmlStyle.blockList, li); - contentTree.addContent(ul); - } - } - - /** - * Add use information to the documentation tree. - * - * @param mems list of program elements for which the use information will be added - * @param heading the section heading - * @param tableSummary the summary for the use table - * @param contentTree the content tree to which the use information will be added - */ - protected void addUseInfo(List mems, - Content heading, String tableSummary, Content contentTree) { - if (mems == null) { - return; - } - List members = mems; - boolean printedUseTableHeader = false; - if (members.size() > 0) { - Content caption = writer.getTableCaption(heading); - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.useSummary, caption) - : HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption); - Content tbody = new HtmlTree(HtmlTag.TBODY); - Iterator it = members.iterator(); - for (int i = 0; it.hasNext(); i++) { - ProgramElementDoc pgmdoc = it.next(); - ClassDoc cd = pgmdoc.containingClass(); - if (!printedUseTableHeader) { - table.addContent(writer.getSummaryTableHeader( - this.getSummaryTableHeader(pgmdoc), "col")); - printedUseTableHeader = true; - } - HtmlTree tr = new HtmlTree(HtmlTag.TR); - if (i % 2 == 0) { - tr.addStyle(HtmlStyle.altColor); - } else { - tr.addStyle(HtmlStyle.rowColor); - } - HtmlTree tdFirst = new HtmlTree(HtmlTag.TD); - tdFirst.addStyle(HtmlStyle.colFirst); - writer.addSummaryType(this, pgmdoc, tdFirst); - tr.addContent(tdFirst); - HtmlTree tdLast = new HtmlTree(HtmlTag.TD); - tdLast.addStyle(HtmlStyle.colLast); - if (cd != null && !(pgmdoc instanceof ConstructorDoc) - && !(pgmdoc instanceof ClassDoc)) { - HtmlTree name = new HtmlTree(HtmlTag.SPAN); - name.addStyle(HtmlStyle.typeNameLabel); - name.addContent(cd.name() + "."); - tdLast.addContent(name); - } - addSummaryLink(pgmdoc instanceof ClassDoc ? - LinkInfoImpl.Kind.CLASS_USE : LinkInfoImpl.Kind.MEMBER, - cd, pgmdoc, tdLast); - writer.addSummaryLinkComment(this, pgmdoc, tdLast); - tr.addContent(tdLast); - tbody.addContent(tr); - } - table.addContent(tbody); - contentTree.addContent(table); - } - } - - /** - * Add the navigation detail link. - * - * @param members the members to be linked - * @param liNav the content tree to which the navigation detail link will be added - */ - protected void addNavDetailLink(List members, Content liNav) { - addNavDetailLink(members.size() > 0 ? true : false, liNav); - } - - /** - * Add the navigation summary link. - * - * @param members members to be linked - * @param visibleMemberMap the visible inherited members map - * @param liNav the content tree to which the navigation summary link will be added - */ - protected void addNavSummaryLink(List members, - VisibleMemberMap visibleMemberMap, Content liNav) { - if (members.size() > 0) { - liNav.addContent(getNavSummaryLink(null, true)); - return; - } - ClassDoc icd = classdoc.superclass(); - while (icd != null) { - List inhmembers = visibleMemberMap.getMembersFor(icd); - if (inhmembers.size() > 0) { - liNav.addContent(getNavSummaryLink(icd, true)); - return; - } - icd = icd.superclass(); - } - liNav.addContent(getNavSummaryLink(null, false)); - } - - protected void serialWarning(SourcePosition pos, String key, String a1, String a2) { - if (configuration.serialwarn) { - configuration.getDocletSpecificMsg().warning(pos, key, a1, a2); - } - } - - public ProgramElementDoc[] eligibleMembers(ProgramElementDoc[] members) { - return nodepr? utils.excludeDeprecatedMembers(members): members; - } - - /** - * Add the member summary for the given class. - * - * @param classDoc the class that is being documented - * @param member the member being documented - * @param firstSentenceTags the first sentence tags to be added to the summary - * @param tableContents the list of contents to which the documentation will be added - * @param counter the counter for determining id and style for the table row - */ - public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member, - Tag[] firstSentenceTags, List tableContents, int counter) { - HtmlTree tdSummaryType = new HtmlTree(HtmlTag.TD); - tdSummaryType.addStyle(HtmlStyle.colFirst); - writer.addSummaryType(this, member, tdSummaryType); - HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); - setSummaryColumnStyle(tdSummary); - addSummaryLink(classDoc, member, tdSummary); - writer.addSummaryLinkComment(this, member, firstSentenceTags, tdSummary); - HtmlTree tr = HtmlTree.TR(tdSummaryType); - tr.addContent(tdSummary); - if (member instanceof MethodDoc && !member.isAnnotationTypeElement()) { - int methodType = (member.isStatic()) ? MethodTypes.STATIC.value() : - MethodTypes.INSTANCE.value(); - if (member.containingClass().isInterface()) { - methodType = (((MethodDoc) member).isAbstract()) - ? methodType | MethodTypes.ABSTRACT.value() - : methodType | MethodTypes.DEFAULT.value(); - } else { - methodType = (((MethodDoc) member).isAbstract()) - ? methodType | MethodTypes.ABSTRACT.value() - : methodType | MethodTypes.CONCRETE.value(); - } - if (utils.isDeprecated(member) || utils.isDeprecated(classdoc)) { - methodType = methodType | MethodTypes.DEPRECATED.value(); - } - methodTypesOr = methodTypesOr | methodType; - String tableId = "i" + counter; - typeMap.put(tableId, methodType); - tr.addAttr(HtmlAttr.ID, tableId); - } - if (counter%2 == 0) - tr.addStyle(HtmlStyle.altColor); - else - tr.addStyle(HtmlStyle.rowColor); - tableContents.add(tr); - } - - /** - * Generate the method types set and return true if the method summary table - * needs to show tabs. - * - * @return true if the table should show tabs - */ - public boolean showTabs() { - int value; - for (MethodTypes type : EnumSet.allOf(MethodTypes.class)) { - value = type.value(); - if ((value & methodTypesOr) == value) { - methodTypes.add(type); - } - } - boolean showTabs = methodTypes.size() > 1; - if (showTabs) { - methodTypes.add(MethodTypes.ALL); - } - return showTabs; - } - - /** - * Set the style for the summary column. - * - * @param tdTree the column for which the style will be set - */ - public void setSummaryColumnStyle(HtmlTree tdTree) { - tdTree.addStyle(HtmlStyle.colLast); - } - - /** - * Add inherited member summary for the given class and member. - * - * @param classDoc the class the inherited member belongs to - * @param nestedClass the inherited member that is summarized - * @param isFirst true if this is the first member in the list - * @param isLast true if this is the last member in the list - * @param linksTree the content tree to which the summary will be added - */ - public void addInheritedMemberSummary(ClassDoc classDoc, - ProgramElementDoc nestedClass, boolean isFirst, boolean isLast, - Content linksTree) { - writer.addInheritedMemberSummary(this, classDoc, nestedClass, isFirst, - linksTree); - } - - /** - * Get the inherited summary header for the given class. - * - * @param classDoc the class the inherited member belongs to - * @return a content tree for the inherited summary header - */ - public Content getInheritedSummaryHeader(ClassDoc classDoc) { - Content inheritedTree = writer.getMemberTreeHeader(); - writer.addInheritedSummaryHeader(this, classDoc, inheritedTree); - return inheritedTree; - } - - /** - * Get the inherited summary links tree. - * - * @return a content tree for the inherited summary links - */ - public Content getInheritedSummaryLinksTree() { - return new HtmlTree(HtmlTag.CODE); - } - - /** - * Get the summary table tree for the given class. - * - * @param classDoc the class for which the summary table is generated - * @param tableContents list of contents to be displayed in the summary table - * @return a content tree for the summary table - */ - public Content getSummaryTableTree(ClassDoc classDoc, List tableContents) { - return writer.getSummaryTableTree(this, classDoc, tableContents, showTabs()); - } - - /** - * Get the member tree to be documented. - * - * @param memberTree the content tree of member to be documented - * @return a content tree that will be added to the class documentation - */ - public Content getMemberTree(Content memberTree) { - return writer.getMemberTree(memberTree); - } - - /** - * Get the member tree to be documented. - * - * @param memberTree the content tree of member to be documented - * @param isLastContent true if the content to be added is the last content - * @return a content tree that will be added to the class documentation - */ - public Content getMemberTree(Content memberTree, boolean isLastContent) { - if (isLastContent) - return HtmlTree.UL(HtmlStyle.blockListLast, memberTree); - else - return HtmlTree.UL(HtmlStyle.blockList, memberTree); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.DocPath; - -/** - * Abstract class to generate the overview files in - * Frame and Non-Frame format. This will be sub-classed by to - * generate overview-frame.html as well as overview-summary.html. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter { - - /** - * A Set of Packages to be documented. - */ - protected SortedSet packages; - - /** - * Constructor. Also initializes the packages variable. - * - * @param configuration The current configuration - * @param filename Name of the package index file to be generated. - */ - public AbstractPackageIndexWriter(ConfigurationImpl configuration, - DocPath filename) throws IOException { - super(configuration, filename); - packages = configuration.packages; - } - - /** - * Adds the navigation bar header to the documentation tree. - * - * @param body the document tree to which the navigation bar header will be added - */ - protected abstract void addNavigationBarHeader(Content body); - - /** - * Adds the navigation bar footer to the documentation tree. - * - * @param body the document tree to which the navigation bar footer will be added - */ - protected abstract void addNavigationBarFooter(Content body); - - /** - * Adds the overview header to the documentation tree. - * - * @param body the document tree to which the overview header will be added - */ - protected abstract void addOverviewHeader(Content body); - - /** - * Adds the packages list to the documentation tree. - * - * @param packages a collection of packagedoc objects - * @param text caption for the table - * @param tableSummary summary for the table - * @param body the document tree to which the packages list will be added - */ - protected abstract void addPackagesList(Collection packages, String text, - String tableSummary, Content body); - - /** - * Generate and prints the contents in the package index file. Call appropriate - * methods from the sub-class in order to generate Frame or Non - * Frame format. - * - * @param title the title of the window. - * @param includeScript boolean set true if windowtitle script is to be included - */ - protected void buildPackageIndexFile(String title, boolean includeScript) throws IOException { - String windowOverview = configuration.getText(title); - Content body = getBody(includeScript, getWindowTitle(windowOverview)); - addNavigationBarHeader(body); - addOverviewHeader(body); - addIndex(body); - addOverview(body); - addNavigationBarFooter(body); - printHtmlDocument(configuration.metakeywords.getOverviewMetaKeywords(title, - configuration.doctitle), includeScript, body); - } - - /** - * Default to no overview, override to add overview. - * - * @param body the document tree to which the overview will be added - */ - protected void addOverview(Content body) throws IOException { - } - - /** - * Adds the frame or non-frame package index to the documentation tree. - * - * @param body the document tree to which the index will be added - */ - protected void addIndex(Content body) { - addIndexContents(packages, "doclet.Package_Summary", - configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Package_Summary"), - configuration.getText("doclet.packages")), body); - } - - /** - * Adds package index contents. Call appropriate methods from - * the sub-classes. Adds it to the body HtmlTree - * - * @param packages a collection of packages to be documented - * @param text string which will be used as the heading - * @param tableSummary summary for the table - * @param body the document tree to which the index contents will be added - */ - protected void addIndexContents(Collection packages, String text, - String tableSummary, Content body) { - if (!packages.isEmpty()) { - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV)) - ? HtmlTree.NAV() - : new HtmlTree(HtmlTag.DIV); - htmlTree.addStyle(HtmlStyle.indexNav); - HtmlTree ul = new HtmlTree(HtmlTag.UL); - addAllClassesLink(ul); - htmlTree.addContent(ul); - body.addContent(htmlTree); - addPackagesList(packages, text, tableSummary, body); - } - } - - /** - * Adds the doctitle to the documentation tree, if it is specified on the command line. - * - * @param body the document tree to which the title will be added - */ - protected void addConfigurationTitle(Content body) { - if (configuration.doctitle.length() > 0) { - Content title = new RawHtml(configuration.doctitle); - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, - HtmlStyle.title, title); - Content div = HtmlTree.DIV(HtmlStyle.header, heading); - body.addContent(div); - } - } - - /** - * Returns highlighted "Overview", in the navigation bar as this is the - * overview page. - * - * @return a Content object to be added to the documentation tree - */ - protected Content getNavLinkContents() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, overviewLabel); - return li; - } - - /** - * Do nothing. This will be overridden. - * - * @param div the document tree to which the all classes link will be added - */ - protected void addAllClassesLink(Content div) { - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Abstract class to print the class hierarchy page for all the Classes. This - * is sub-classed by {@link PackageTreeWriter} and {@link TreeWriter} to - * generate the Package Tree and global Tree(for all the classes and packages) - * pages. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - */ -@Deprecated -public abstract class AbstractTreeWriter extends HtmlDocletWriter { - - /** - * The class and interface tree built by using {@link ClassTree} - */ - protected final ClassTree classtree; - - /** - * Constructor initializes classtree variable. This constructor will be used - * while generating global tree file "overview-tree.html". - * - * @param configuration The current configuration - * @param filename File to be generated. - * @param classtree Tree built by {@link ClassTree}. - * @throws IOException - * @throws DocletAbortException - */ - protected AbstractTreeWriter(ConfigurationImpl configuration, - DocPath filename, ClassTree classtree) - throws IOException { - super(configuration, filename); - this.classtree = classtree; - } - - /** - * Add each level of the class tree. For each sub-class or - * sub-interface indents the next level information. - * Recurses itself to add subclasses info. - * - * @param parent the superclass or superinterface of the list - * @param list list of the sub-classes at this level - * @param isEnum true if we are generating a tree for enums - * @param contentTree the content tree to which the level information will be added - */ - protected void addLevelInfo(ClassDoc parent, Collection list, - boolean isEnum, Content contentTree) { - if (!list.isEmpty()) { - Content ul = new HtmlTree(HtmlTag.UL); - for (ClassDoc local : list) { - HtmlTree li = new HtmlTree(HtmlTag.LI); - li.addStyle(HtmlStyle.circle); - addPartialInfo(local, li); - addExtendsImplements(parent, local, li); - addLevelInfo(local, classtree.subs(local, isEnum), - isEnum, li); // Recurse - ul.addContent(li); - } - contentTree.addContent(ul); - } - } - - /** - * Add the heading for the tree depending upon tree type if it's a - * Class Tree or Interface tree. - * - * @param list List of classes which are at the most base level, all the - * other classes in this run will derive from these classes - * @param heading heading for the tree - * @param div the content tree to which the tree will be added - */ - protected void addTree(SortedSet list, String heading, HtmlTree div) { - if (!list.isEmpty()) { - ClassDoc firstClassDoc = list.first(); - Content headingContent = getResource(heading); - Content sectionHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, - headingContent); - HtmlTree htmlTree; - if (configuration.allowTag(HtmlTag.SECTION)) { - htmlTree = HtmlTree.SECTION(sectionHeading); - } else { - div.addContent(sectionHeading); - htmlTree = div; - } - addLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null, - list, list == classtree.baseEnums(), htmlTree); - if (configuration.allowTag(HtmlTag.SECTION)) { - div.addContent(htmlTree); - } - } - } - - /** - * Add information regarding the classes which this class extends or - * implements. - * - * @param parent the parent class of the class being documented - * @param cd the classdoc under consideration - * @param contentTree the content tree to which the information will be added - */ - protected void addExtendsImplements(ClassDoc parent, ClassDoc cd, - Content contentTree) { - ClassDoc[] interfaces = cd.interfaces(); - if (interfaces.length > (cd.isInterface()? 1 : 0)) { - Arrays.sort(interfaces); - int counter = 0; - for (ClassDoc intf : interfaces) { - if (parent != intf) { - if (!(intf.isPublic() || - utils.isLinkable(intf, configuration))) { - continue; - } - if (counter == 0) { - if (cd.isInterface()) { - contentTree.addContent(" ("); - contentTree.addContent(getResource("doclet.also")); - contentTree.addContent(" extends "); - } else { - contentTree.addContent(" (implements "); - } - } else { - contentTree.addContent(", "); - } - addPreQualifiedClassLink(LinkInfoImpl.Kind.TREE, - intf, contentTree); - counter++; - } - } - if (counter > 0) { - contentTree.addContent(")"); - } - } - } - - /** - * Add information about the class kind, if it's a "class" or "interface". - * - * @param cd the class being documented - * @param contentTree the content tree to which the information will be added - */ - protected void addPartialInfo(ClassDoc cd, Content contentTree) { - addPreQualifiedStrongClassLink(LinkInfoImpl.Kind.TREE, cd, contentTree); - } - - /** - * Get the tree label for the navigation bar. - * - * @return a content tree for the tree label - */ - protected Content getNavLinkTree() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, treeLabel); - return li; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate the file with list of all the classes in this run. This page will be - * used in the left-hand bottom frame, when "All Classes" link is clicked in - * the left-hand top frame. The name of the generated file is - * "allclasses-frame.html". - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - * @author Doug Kramer - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class AllClassesFrameWriter extends HtmlDocletWriter { - - /** - * Index of all the classes. - */ - protected IndexBuilder indexbuilder; - - /** - * BR tag to be used within a document tree. - */ - final HtmlTree BR = new HtmlTree(HtmlTag.BR); - - /** - * Construct AllClassesFrameWriter object. Also initializes the indexbuilder - * variable in this class. - * @param configuration The current configuration - * @param filename Path to the file which is getting generated. - * @param indexbuilder Unicode based Index from {@link IndexBuilder} - * @throws IOException - * @throws DocletAbortException - */ - public AllClassesFrameWriter(ConfigurationImpl configuration, - DocPath filename, IndexBuilder indexbuilder) - throws IOException { - super(configuration, filename); - this.indexbuilder = indexbuilder; - } - - /** - * Create AllClassesFrameWriter object. Then use it to generate the - * "allclasses-frame.html" file. Generate the file in the current or the - * destination directory. - * - * @param indexbuilder IndexBuilder object for all classes index. - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration, - IndexBuilder indexbuilder) { - AllClassesFrameWriter allclassgen; - DocPath filename = DocPaths.ALLCLASSES_FRAME; - try { - allclassgen = new AllClassesFrameWriter(configuration, - filename, indexbuilder); - allclassgen.buildAllClassesFile(true); - allclassgen.close(); - filename = DocPaths.ALLCLASSES_NOFRAME; - allclassgen = new AllClassesFrameWriter(configuration, - filename, indexbuilder); - allclassgen.buildAllClassesFile(false); - allclassgen.close(); - } catch (IOException exc) { - configuration.standardmessage. - error("doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(exc); - } - } - - /** - * Print all the classes in the file. - * @param wantFrames True if we want frames. - */ - protected void buildAllClassesFile(boolean wantFrames) throws IOException { - String label = configuration.getText("doclet.All_Classes"); - Content body = getBody(false, getWindowTitle(label)); - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, - HtmlStyle.bar, allclassesLabel); - body.addContent(heading); - Content ul = new HtmlTree(HtmlTag.UL); - // Generate the class links and add it to the tdFont tree. - addAllClasses(ul, wantFrames); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN(HtmlStyle.indexContainer, ul) - : HtmlTree.DIV(HtmlStyle.indexContainer, ul); - body.addContent(htmlTree); - printHtmlDocument(null, false, body); - } - - /** - * Use the sorted index of all the classes and add all the classes to the - * content list. - * - * @param content HtmlTree content to which all classes information will be added - * @param wantFrames True if we want frames. - */ - protected void addAllClasses(Content content, boolean wantFrames) { - for (int i = 0; i < indexbuilder.elements().length; i++) { - Character unicode = (Character)((indexbuilder.elements())[i]); - addContents(indexbuilder.getMemberList(unicode), wantFrames, content); - } - } - - /** - * Given a list of classes, generate links for each class or interface. - * If the class kind is interface, print it in the italics font. Also all - * links should target the right-hand frame. If clicked on any class name - * in this page, appropriate class page should get opened in the right-hand - * frame. - * - * @param classlist Sorted list of classes. - * @param wantFrames True if we want frames. - * @param content HtmlTree content to which the links will be added - */ - protected void addContents(List classlist, boolean wantFrames, - Content content) { - for (Doc doc : classlist) { - ClassDoc cd = (ClassDoc) doc; - if (!utils.isCoreClass(cd)) { - continue; - } - Content label = italicsClassName(cd, false); - Content linkContent; - if (wantFrames) { - linkContent = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.ALL_CLASSES_FRAME, cd).label(label).target("classFrame")); - } else { - linkContent = getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, cd).label(label)); - } - Content li = HtmlTree.LI(linkContent); - content.addContent(li); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; - -/** - * Writes annotation type field documentation in HTML format. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public class AnnotationTypeFieldWriterImpl extends AbstractMemberWriter - implements AnnotationTypeFieldWriter, MemberSummaryWriter { - - /** - * Construct a new AnnotationTypeFieldWriterImpl. - * - * @param writer the writer that will write the output. - * @param annotationType the AnnotationType that holds this member. - */ - public AnnotationTypeFieldWriterImpl(SubWriterHolderWriter writer, - AnnotationTypeDoc annotationType) { - super(writer, annotationType); - } - - /** - * {@inheritDoc} - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree) { - memberSummaryTree.addContent( - HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY); - Content memberTree = writer.getMemberTreeHeader(); - writer.addSummaryHeader(this, classDoc, memberTree); - return memberTree; - } - - /** - * {@inheritDoc} - */ - public Content getMemberTreeHeader() { - return writer.getMemberTreeHeader(); - } - - /** - * {@inheritDoc} - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - writer.addMemberTree(memberSummaryTree, memberTree); - } - - /** - * {@inheritDoc} - */ - public void addAnnotationFieldDetailsMarker(Content memberDetails) { - memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_DETAILS); - } - - /** - * {@inheritDoc} - */ - public void addAnnotationDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree) { - if (!writer.printedAnnotationFieldHeading) { - memberDetailsTree.addContent(writer.getMarkerAnchor( - SectionName.ANNOTATION_TYPE_FIELD_DETAIL)); - Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, - writer.fieldDetailsLabel); - memberDetailsTree.addContent(heading); - writer.printedAnnotationFieldHeading = true; - } - } - - /** - * {@inheritDoc} - */ - public Content getAnnotationDocTreeHeader(MemberDoc member, - Content annotationDetailsTree) { - annotationDetailsTree.addContent( - writer.getMarkerAnchor(member.name())); - Content annotationDocTree = writer.getMemberTreeHeader(); - Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); - heading.addContent(member.name()); - annotationDocTree.addContent(heading); - return annotationDocTree; - } - - /** - * {@inheritDoc} - */ - public Content getSignature(MemberDoc member) { - Content pre = new HtmlTree(HtmlTag.PRE); - writer.addAnnotationInfo(member, pre); - addModifiers(member, pre); - Content link = - writer.getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.MEMBER, getType(member))); - pre.addContent(link); - pre.addContent(writer.getSpace()); - if (configuration.linksource) { - Content memberName = new StringContent(member.name()); - writer.addSrcLink(member, memberName, pre); - } else { - addName(member.name(), pre); - } - return pre; - } - - /** - * {@inheritDoc} - */ - public void addDeprecated(MemberDoc member, Content annotationDocTree) { - addDeprecatedInfo(member, annotationDocTree); - } - - /** - * {@inheritDoc} - */ - public void addComments(MemberDoc member, Content annotationDocTree) { - addComment(member, annotationDocTree); - } - - /** - * {@inheritDoc} - */ - public void addTags(MemberDoc member, Content annotationDocTree) { - writer.addTagsInfo(member, annotationDocTree); - } - - /** - * {@inheritDoc} - */ - public Content getAnnotationDetails(Content annotationDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree)); - return htmlTree; - } - return getMemberTree(annotationDetailsTree); - } - - /** - * {@inheritDoc} - */ - public Content getAnnotationDoc(Content annotationDocTree, - boolean isLastContent) { - return getMemberTree(annotationDocTree, isLastContent); - } - - /** - * Close the writer. - */ - public void close() throws IOException { - writer.close(); - } - - /** - * {@inheritDoc} - */ - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - writer.getResource("doclet.Field_Summary")); - memberTree.addContent(label); - } - - /** - * {@inheritDoc} - */ - public String getTableSummary() { - return configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Field_Summary"), - configuration.getText("doclet.fields")); - } - - /** - * {@inheritDoc} - */ - public Content getCaption() { - return configuration.getResource("doclet.Fields"); - } - - /** - * {@inheritDoc} - */ - public String[] getSummaryTableHeader(ProgramElementDoc member) { - String[] header = new String[] { - writer.getModifierTypeHeader(), - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Fields"), - configuration.getText("doclet.Description")) - }; - return header; - } - - /** - * {@inheritDoc} - */ - public void addSummaryAnchor(ClassDoc cd, Content memberTree) { - memberTree.addContent(writer.getMarkerAnchor( - SectionName.ANNOTATION_TYPE_FIELD_SUMMARY)); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { - } - - /** - * {@inheritDoc} - */ - protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member, - Content tdSummary) { - Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, - writer.getDocLink(context, (MemberDoc) member, member.name(), false)); - Content code = HtmlTree.CODE(memberLink); - tdSummary.addContent(code); - } - - /** - * {@inheritDoc} - */ - protected void addInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member, Content linksTree) { - //Not applicable. - } - - /** - * {@inheritDoc} - */ - protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { - MemberDoc m = (MemberDoc)member; - addModifierAndType(m, getType(m), tdSummaryType); - } - - /** - * {@inheritDoc} - */ - protected Content getDeprecatedLink(ProgramElementDoc member) { - return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, - (MemberDoc) member, ((MemberDoc)member).qualifiedName()); - } - - /** - * {@inheritDoc} - */ - protected Content getNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - return writer.getHyperLink( - SectionName.ANNOTATION_TYPE_FIELD_SUMMARY, - writer.getResource("doclet.navField")); - } else { - return writer.getResource("doclet.navField"); - } - } - - /** - * {@inheritDoc} - */ - protected void addNavDetailLink(boolean link, Content liNav) { - if (link) { - liNav.addContent(writer.getHyperLink( - SectionName.ANNOTATION_TYPE_FIELD_DETAIL, - writer.getResource("doclet.navField"))); - } else { - liNav.addContent(writer.getResource("doclet.navField")); - } - } - - private Type getType(MemberDoc member) { - if (member instanceof FieldDoc) { - return ((FieldDoc) member).type(); - } else { - return ((MethodDoc) member).returnType(); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; - -/** - * Writes annotation type optional member documentation in HTML format. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class AnnotationTypeOptionalMemberWriterImpl extends - AnnotationTypeRequiredMemberWriterImpl - implements AnnotationTypeOptionalMemberWriter, MemberSummaryWriter { - - /** - * Construct a new AnnotationTypeOptionalMemberWriterImpl. - * - * @param writer the writer that will write the output. - * @param annotationType the AnnotationType that holds this member. - */ - public AnnotationTypeOptionalMemberWriterImpl(SubWriterHolderWriter writer, - AnnotationTypeDoc annotationType) { - super(writer, annotationType); - } - - /** - * {@inheritDoc} - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree) { - memberSummaryTree.addContent( - HtmlConstants.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY); - Content memberTree = writer.getMemberTreeHeader(); - writer.addSummaryHeader(this, classDoc, memberTree); - return memberTree; - } - - /** - * {@inheritDoc} - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - writer.addMemberTree(memberSummaryTree, memberTree); - } - - /** - * {@inheritDoc} - */ - public void addDefaultValueInfo(MemberDoc member, Content annotationDocTree) { - if (((AnnotationTypeElementDoc) member).defaultValue() != null) { - Content dt = HtmlTree.DT(writer.getResource("doclet.Default")); - Content dl = HtmlTree.DL(dt); - Content dd = HtmlTree.DD(new StringContent( - ((AnnotationTypeElementDoc) member).defaultValue().toString())); - dl.addContent(dd); - annotationDocTree.addContent(dl); - } - } - - /** - * {@inheritDoc} - */ - public void close() throws IOException { - writer.close(); - } - - /** - * {@inheritDoc} - */ - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - writer.getResource("doclet.Annotation_Type_Optional_Member_Summary")); - memberTree.addContent(label); - } - - /** - * {@inheritDoc} - */ - public String getTableSummary() { - return configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Annotation_Type_Optional_Member_Summary"), - configuration.getText("doclet.annotation_type_optional_members")); - } - - /** - * {@inheritDoc} - */ - public Content getCaption() { - return configuration.getResource("doclet.Annotation_Type_Optional_Members"); - } - - /** - * {@inheritDoc} - */ - public String[] getSummaryTableHeader(ProgramElementDoc member) { - String[] header = new String[] { - writer.getModifierTypeHeader(), - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Annotation_Type_Optional_Member"), - configuration.getText("doclet.Description")) - }; - return header; - } - - /** - * {@inheritDoc} - */ - public void addSummaryAnchor(ClassDoc cd, Content memberTree) { - memberTree.addContent(writer.getMarkerAnchor( - SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY)); - } - - /** - * {@inheritDoc} - */ - protected Content getNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - return writer.getHyperLink( - SectionName.ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY, - writer.getResource("doclet.navAnnotationTypeOptionalMember")); - } else { - return writer.getResource("doclet.navAnnotationTypeOptionalMember"); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; - -/** - * Writes annotation type required member documentation in HTML format. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter - implements AnnotationTypeRequiredMemberWriter, MemberSummaryWriter { - - /** - * Construct a new AnnotationTypeRequiredMemberWriterImpl. - * - * @param writer the writer that will write the output. - * @param annotationType the AnnotationType that holds this member. - */ - public AnnotationTypeRequiredMemberWriterImpl(SubWriterHolderWriter writer, - AnnotationTypeDoc annotationType) { - super(writer, annotationType); - } - - /** - * {@inheritDoc} - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree) { - memberSummaryTree.addContent( - HtmlConstants.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY); - Content memberTree = writer.getMemberTreeHeader(); - writer.addSummaryHeader(this, classDoc, memberTree); - return memberTree; - } - - /** - * {@inheritDoc} - */ - public Content getMemberTreeHeader() { - return writer.getMemberTreeHeader(); - } - - /** - * {@inheritDoc} - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - writer.addMemberTree(memberSummaryTree, memberTree); - } - - /** - * {@inheritDoc} - */ - public void addAnnotationDetailsMarker(Content memberDetails) { - memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS); - } - - /** - * {@inheritDoc} - */ - public void addAnnotationDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree) { - if (!writer.printedAnnotationHeading) { - memberDetailsTree.addContent(writer.getMarkerAnchor( - SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL)); - Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, - writer.annotationTypeDetailsLabel); - memberDetailsTree.addContent(heading); - writer.printedAnnotationHeading = true; - } - } - - /** - * {@inheritDoc} - */ - public Content getAnnotationDocTreeHeader(MemberDoc member, - Content annotationDetailsTree) { - annotationDetailsTree.addContent( - writer.getMarkerAnchor(member.name() + - ((ExecutableMemberDoc) member).signature())); - Content annotationDocTree = writer.getMemberTreeHeader(); - Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); - heading.addContent(member.name()); - annotationDocTree.addContent(heading); - return annotationDocTree; - } - - /** - * {@inheritDoc} - */ - public Content getSignature(MemberDoc member) { - Content pre = new HtmlTree(HtmlTag.PRE); - writer.addAnnotationInfo(member, pre); - addModifiers(member, pre); - Content link = - writer.getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.MEMBER, getType(member))); - pre.addContent(link); - pre.addContent(writer.getSpace()); - if (configuration.linksource) { - Content memberName = new StringContent(member.name()); - writer.addSrcLink(member, memberName, pre); - } else { - addName(member.name(), pre); - } - return pre; - } - - /** - * {@inheritDoc} - */ - public void addDeprecated(MemberDoc member, Content annotationDocTree) { - addDeprecatedInfo(member, annotationDocTree); - } - - /** - * {@inheritDoc} - */ - public void addComments(MemberDoc member, Content annotationDocTree) { - addComment(member, annotationDocTree); - } - - /** - * {@inheritDoc} - */ - public void addTags(MemberDoc member, Content annotationDocTree) { - writer.addTagsInfo(member, annotationDocTree); - } - - /** - * {@inheritDoc} - */ - public Content getAnnotationDetails(Content annotationDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree)); - return htmlTree; - } - return getMemberTree(annotationDetailsTree); - } - - /** - * {@inheritDoc} - */ - public Content getAnnotationDoc(Content annotationDocTree, - boolean isLastContent) { - return getMemberTree(annotationDocTree, isLastContent); - } - - /** - * Close the writer. - */ - public void close() throws IOException { - writer.close(); - } - - /** - * {@inheritDoc} - */ - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - writer.getResource("doclet.Annotation_Type_Required_Member_Summary")); - memberTree.addContent(label); - } - - /** - * {@inheritDoc} - */ - public String getTableSummary() { - return configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Annotation_Type_Required_Member_Summary"), - configuration.getText("doclet.annotation_type_required_members")); - } - - /** - * {@inheritDoc} - */ - public Content getCaption() { - return configuration.getResource("doclet.Annotation_Type_Required_Members"); - } - - /** - * {@inheritDoc} - */ - public String[] getSummaryTableHeader(ProgramElementDoc member) { - String[] header = new String[] { - writer.getModifierTypeHeader(), - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Annotation_Type_Required_Member"), - configuration.getText("doclet.Description")) - }; - return header; - } - - /** - * {@inheritDoc} - */ - public void addSummaryAnchor(ClassDoc cd, Content memberTree) { - memberTree.addContent(writer.getMarkerAnchor( - SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY)); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { - } - - /** - * {@inheritDoc} - */ - protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member, - Content tdSummary) { - Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, - writer.getDocLink(context, (MemberDoc) member, member.name(), false)); - Content code = HtmlTree.CODE(memberLink); - tdSummary.addContent(code); - } - - /** - * {@inheritDoc} - */ - protected void addInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member, Content linksTree) { - //Not applicable. - } - - /** - * {@inheritDoc} - */ - protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { - MemberDoc m = (MemberDoc)member; - addModifierAndType(m, getType(m), tdSummaryType); - } - - /** - * {@inheritDoc} - */ - protected Content getDeprecatedLink(ProgramElementDoc member) { - return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, - (MemberDoc) member, ((MemberDoc)member).qualifiedName()); - } - - /** - * {@inheritDoc} - */ - protected Content getNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - return writer.getHyperLink( - SectionName.ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY, - writer.getResource("doclet.navAnnotationTypeRequiredMember")); - } else { - return writer.getResource("doclet.navAnnotationTypeRequiredMember"); - } - } - - /** - * {@inheritDoc} - */ - protected void addNavDetailLink(boolean link, Content liNav) { - if (link) { - liNav.addContent(writer.getHyperLink( - SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL, - writer.getResource("doclet.navAnnotationTypeMember"))); - } else { - liNav.addContent(writer.getResource("doclet.navAnnotationTypeMember")); - } - } - - private Type getType(MemberDoc member) { - if (member instanceof FieldDoc) { - return ((FieldDoc) member).type(); - } else { - return ((MethodDoc) member).returnType(); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java +++ /dev/null @@ -1,432 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.IOException; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.builders.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate the Class Information Page. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @see com.sun.javadoc.ClassDoc - * @see java.util.Collections - * @see java.util.List - * @see java.util.ArrayList - * @see java.util.HashMap - * - * @author Atul M Dambalkar - * @author Robert Field - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class AnnotationTypeWriterImpl extends SubWriterHolderWriter - implements AnnotationTypeWriter { - - protected AnnotationTypeDoc annotationType; - - protected Type prev; - - protected Type next; - - /** - * @param annotationType the annotation type being documented. - * @param prevType the previous class that was documented. - * @param nextType the next class being documented. - */ - public AnnotationTypeWriterImpl(ConfigurationImpl configuration, - AnnotationTypeDoc annotationType, Type prevType, Type nextType) - throws Exception { - super(configuration, DocPath.forClass(annotationType)); - this.annotationType = annotationType; - configuration.currentcd = annotationType.asClassDoc(); - this.prev = prevType; - this.next = nextType; - } - - /** - * Get this package link. - * - * @return a content tree for the package link - */ - protected Content getNavLinkPackage() { - Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY, - packageLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get the class link. - * - * @return a content tree for the class link - */ - protected Content getNavLinkClass() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel); - return li; - } - - /** - * Get the class use link. - * - * @return a content tree for the class use link - */ - protected Content getNavLinkClassUse() { - Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), useLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get link to previous class. - * - * @return a content tree for the previous class link - */ - public Content getNavLinkPrevious() { - Content li; - if (prev != null) { - Content prevLink = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS, prev.asClassDoc()) - .label(prevclassLabel).strong(true)); - li = HtmlTree.LI(prevLink); - } - else - li = HtmlTree.LI(prevclassLabel); - return li; - } - - /** - * Get link to next class. - * - * @return a content tree for the next class link - */ - public Content getNavLinkNext() { - Content li; - if (next != null) { - Content nextLink = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS, next.asClassDoc()) - .label(nextclassLabel).strong(true)); - li = HtmlTree.LI(nextLink); - } - else - li = HtmlTree.LI(nextclassLabel); - return li; - } - - /** - * {@inheritDoc} - */ - public Content getHeader(String header) { - String pkgname = (annotationType.containingPackage() != null)? - annotationType.containingPackage().name(): ""; - String clname = annotationType.name(); - HtmlTree bodyTree = getBody(true, getWindowTitle(clname)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.header); - if (pkgname.length() > 0) { - Content pkgNameContent = new StringContent(pkgname); - Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); - div.addContent(pkgNameDiv); - } - LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_HEADER, annotationType); - Content headerContent = new StringContent(header); - Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, - HtmlStyle.title, headerContent); - heading.addContent(getTypeParameterLinks(linkInfo)); - div.addContent(heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } - return bodyTree; - } - - /** - * {@inheritDoc} - */ - public Content getAnnotationContentHeader() { - return getContentHeader(); - } - - /** - * {@inheritDoc} - */ - public void addFooter(Content contentTree) { - contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA); - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : contentTree; - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - contentTree.addContent(htmlTree); - } - } - - /** - * {@inheritDoc} - */ - public void printDocument(Content contentTree) throws IOException { - printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType), - true, contentTree); - } - - /** - * {@inheritDoc} - */ - public Content getAnnotationInfoTreeHeader() { - return getMemberTreeHeader(); - } - - /** - * {@inheritDoc} - */ - public Content getAnnotationInfo(Content annotationInfoTree) { - return getMemberTree(HtmlStyle.description, annotationInfoTree); - } - - /** - * {@inheritDoc} - */ - public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree) { - annotationInfoTree.addContent(new HtmlTree(HtmlTag.BR)); - Content pre = new HtmlTree(HtmlTag.PRE); - addAnnotationInfo(annotationType, pre); - pre.addContent(modifiers); - LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType); - Content annotationName = new StringContent(annotationType.name()); - Content parameterLinks = getTypeParameterLinks(linkInfo); - if (configuration.linksource) { - addSrcLink(annotationType, annotationName, pre); - pre.addContent(parameterLinks); - } else { - Content span = HtmlTree.SPAN(HtmlStyle.memberNameLabel, annotationName); - span.addContent(parameterLinks); - pre.addContent(span); - } - annotationInfoTree.addContent(pre); - } - - /** - * {@inheritDoc} - */ - public void addAnnotationTypeDescription(Content annotationInfoTree) { - if(!configuration.nocomment) { - if (annotationType.inlineTags().length > 0) { - addInlineComment(annotationType, annotationInfoTree); - } - } - } - - /** - * {@inheritDoc} - */ - public void addAnnotationTypeTagInfo(Content annotationInfoTree) { - if(!configuration.nocomment) { - addTagsInfo(annotationType, annotationInfoTree); - } - } - - /** - * {@inheritDoc} - */ - public void addAnnotationTypeDeprecationInfo(Content annotationInfoTree) { - Content hr = new HtmlTree(HtmlTag.HR); - annotationInfoTree.addContent(hr); - Tag[] deprs = annotationType.tags("deprecated"); - if (utils.isDeprecated(annotationType)) { - Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); - Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel); - if (deprs.length > 0) { - Tag[] commentTags = deprs[0].inlineTags(); - if (commentTags.length > 0) { - div.addContent(getSpace()); - addInlineDeprecatedComment(annotationType, deprs[0], div); - } - } - annotationInfoTree.addContent(div); - } - } - - /** - * {@inheritDoc} - */ - protected Content getNavLinkTree() { - Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE, - treeLabel, "", ""); - Content li = HtmlTree.LI(treeLinkContent); - return li; - } - - /** - * Add summary details to the navigation bar. - * - * @param subDiv the content tree to which the summary detail links will be added - */ - protected void addSummaryDetailLinks(Content subDiv) { - try { - Content div = HtmlTree.DIV(getNavSummaryLinks()); - div.addContent(getNavDetailLinks()); - subDiv.addContent(div); - } catch (Exception e) { - e.printStackTrace(); - throw new DocletAbortException(e); - } - } - - /** - * Get summary links for navigation bar. - * - * @return the content tree for the navigation summary links - */ - protected Content getNavSummaryLinks() throws Exception { - Content li = HtmlTree.LI(summaryLabel); - li.addContent(getSpace()); - Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); - MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) - configuration.getBuilderFactory().getMemberSummaryBuilder(this); - Content liNavField = new HtmlTree(HtmlTag.LI); - addNavSummaryLink(memberSummaryBuilder, - "doclet.navField", - VisibleMemberMap.ANNOTATION_TYPE_FIELDS, liNavField); - addNavGap(liNavField); - ulNav.addContent(liNavField); - Content liNavReq = new HtmlTree(HtmlTag.LI); - addNavSummaryLink(memberSummaryBuilder, - "doclet.navAnnotationTypeRequiredMember", - VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, liNavReq); - addNavGap(liNavReq); - ulNav.addContent(liNavReq); - Content liNavOpt = new HtmlTree(HtmlTag.LI); - addNavSummaryLink(memberSummaryBuilder, - "doclet.navAnnotationTypeOptionalMember", - VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, liNavOpt); - ulNav.addContent(liNavOpt); - return ulNav; - } - - /** - * Add the navigation summary link. - * - * @param builder builder for the member to be documented - * @param label the label for the navigation - * @param type type to be documented - * @param liNav the content tree to which the navigation summary link will be added - */ - protected void addNavSummaryLink(MemberSummaryBuilder builder, - String label, int type, Content liNav) { - AbstractMemberWriter writer = ((AbstractMemberWriter) builder. - getMemberSummaryWriter(type)); - if (writer == null) { - liNav.addContent(getResource(label)); - } else { - liNav.addContent(writer.getNavSummaryLink(null, - ! builder.getVisibleMemberMap(type).noVisibleMembers())); - } - } - - /** - * Get detail links for the navigation bar. - * - * @return the content tree for the detail links - */ - protected Content getNavDetailLinks() throws Exception { - Content li = HtmlTree.LI(detailLabel); - li.addContent(getSpace()); - Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); - MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) - configuration.getBuilderFactory().getMemberSummaryBuilder(this); - AbstractMemberWriter writerField = - ((AbstractMemberWriter) memberSummaryBuilder. - getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_FIELDS)); - AbstractMemberWriter writerOptional = - ((AbstractMemberWriter) memberSummaryBuilder. - getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL)); - AbstractMemberWriter writerRequired = - ((AbstractMemberWriter) memberSummaryBuilder. - getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED)); - Content liNavField = new HtmlTree(HtmlTag.LI); - if (writerField != null){ - writerField.addNavDetailLink(annotationType.fields().length > 0, liNavField); - } else { - liNavField.addContent(getResource("doclet.navField")); - } - addNavGap(liNavField); - ulNav.addContent(liNavField); - if (writerOptional != null){ - Content liNavOpt = new HtmlTree(HtmlTag.LI); - writerOptional.addNavDetailLink(annotationType.elements().length > 0, liNavOpt); - ulNav.addContent(liNavOpt); - } else if (writerRequired != null){ - Content liNavReq = new HtmlTree(HtmlTag.LI); - writerRequired.addNavDetailLink(annotationType.elements().length > 0, liNavReq); - ulNav.addContent(liNavReq); - } else { - Content liNav = HtmlTree.LI(getResource("doclet.navAnnotationTypeMember")); - ulNav.addContent(liNav); - } - return ulNav; - } - - /** - * Add gap between navigation bar elements. - * - * @param liNav the content tree to which the gap will be added - */ - protected void addNavGap(Content liNav) { - liNav.addContent(getSpace()); - liNav.addContent("|"); - liNav.addContent(getSpace()); - } - - /** - * {@inheritDoc} - */ - public AnnotationTypeDoc getAnnotationTypeDoc() { - return annotationType; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java +++ /dev/null @@ -1,550 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate class usage information. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert G. Field - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class ClassUseWriter extends SubWriterHolderWriter { - - final ClassDoc classdoc; - Set pkgToPackageAnnotations = null; - final Map> pkgToClassTypeParameter; - final Map> pkgToClassAnnotations; - final Map> pkgToMethodTypeParameter; - final Map> pkgToMethodArgTypeParameter; - final Map> pkgToMethodReturnTypeParameter; - final Map> pkgToMethodAnnotations; - final Map> pkgToMethodParameterAnnotations; - final Map> pkgToFieldTypeParameter; - final Map> pkgToFieldAnnotations; - final Map> pkgToSubclass; - final Map> pkgToSubinterface; - final Map> pkgToImplementingClass; - final Map> pkgToField; - final Map> pkgToMethodReturn; - final Map> pkgToMethodArgs; - final Map> pkgToMethodThrows; - final Map> pkgToConstructorAnnotations; - final Map> pkgToConstructorParameterAnnotations; - final Map> pkgToConstructorArgs; - final Map> pkgToConstructorArgTypeParameter; - final Map> pkgToConstructorThrows; - final SortedSet pkgSet; - final MethodWriterImpl methodSubWriter; - final ConstructorWriterImpl constrSubWriter; - final FieldWriterImpl fieldSubWriter; - final NestedClassWriterImpl classSubWriter; - // Summary for various use tables. - final String classUseTableSummary; - final String subclassUseTableSummary; - final String subinterfaceUseTableSummary; - final String fieldUseTableSummary; - final String methodUseTableSummary; - final String constructorUseTableSummary; - - /** - * The HTML tree for main tag. - */ - protected HtmlTree mainTree = HtmlTree.MAIN(); - - /** - * Constructor. - * - * @param filename the file to be generated. - * @throws IOException - * @throws DocletAbortException - */ - public ClassUseWriter(ConfigurationImpl configuration, - ClassUseMapper mapper, DocPath filename, - ClassDoc classdoc) throws IOException { - super(configuration, filename); - this.classdoc = classdoc; - if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName())) - pkgToPackageAnnotations = new TreeSet<>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName())); - configuration.currentcd = classdoc; - this.pkgSet = new TreeSet<>(); - this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam); - this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations); - this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam); - this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToExecMemberDocArgTypeParam); - this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldDocTypeParam); - this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToFieldDoc); - this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToExecMemberDocReturnTypeParam); - this.pkgToMethodAnnotations = pkgDivide(mapper.classToExecMemberDocAnnotations); - this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToExecMemberDocParamAnnotation); - this.pkgToSubclass = pkgDivide(mapper.classToSubclass); - this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface); - this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass); - this.pkgToField = pkgDivide(mapper.classToField); - this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn); - this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs); - this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows); - this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations); - this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation); - this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs); - this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorDocArgTypeParam); - this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows); - //tmp test - if (pkgSet.size() > 0 && - mapper.classToPackage.containsKey(classdoc.qualifiedName()) && - !pkgSet.equals(mapper.classToPackage.get(classdoc.qualifiedName()))) { - configuration.root.printWarning("Internal error: package sets don't match: " + pkgSet + " with: " + - mapper.classToPackage.get(classdoc.qualifiedName())); - } - methodSubWriter = new MethodWriterImpl(this); - constrSubWriter = new ConstructorWriterImpl(this); - fieldSubWriter = new FieldWriterImpl(this); - classSubWriter = new NestedClassWriterImpl(this); - classUseTableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.classes")); - subclassUseTableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.subclasses")); - subinterfaceUseTableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.subinterfaces")); - fieldUseTableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.fields")); - methodUseTableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.methods")); - constructorUseTableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.constructors")); - } - - /** - * Write out class use pages. - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration, - ClassTree classtree) { - ClassUseMapper mapper = new ClassUseMapper(configuration, classtree); - for (ClassDoc aClass : configuration.root.classes()) { - // If -nodeprecated option is set and the containing package is marked - // as deprecated, do not generate the class-use page. We will still generate - // the class-use page if the class is marked as deprecated but the containing - // package is not since it could still be linked from that package-use page. - if (!(configuration.nodeprecated && - configuration.utils.isDeprecated(aClass.containingPackage()))) - ClassUseWriter.generate(configuration, mapper, aClass); - } - for (PackageDoc pkg : configuration.packages) { - // If -nodeprecated option is set and the package is marked - // as deprecated, do not generate the package-use page. - if (!(configuration.nodeprecated && configuration.utils.isDeprecated(pkg))) - PackageUseWriter.generate(configuration, mapper, pkg); - } - } - - private Map> pkgDivide(Map> classMap) { - Map> map = new HashMap<>(); - List list= classMap.get(classdoc.qualifiedName()); - if (list != null) { - Collections.sort(list, utils.makeComparatorForClassUse()); - for (ProgramElementDoc doc : list) { - PackageDoc pkg = doc.containingPackage(); - pkgSet.add(pkg); - List inPkg = map.get(pkg.name()); - if (inPkg == null) { - inPkg = new ArrayList<>(); - map.put(pkg.name(), inPkg); - } - inPkg.add(doc); - } - } - return map; - } - - /** - * Generate a class page. - */ - public static void generate(ConfigurationImpl configuration, - ClassUseMapper mapper, ClassDoc classdoc) { - ClassUseWriter clsgen; - DocPath path = DocPath.forPackage(classdoc) - .resolve(DocPaths.CLASS_USE) - .resolve(DocPath.forName(classdoc)); - try { - clsgen = new ClassUseWriter(configuration, - mapper, path, - classdoc); - clsgen.generateClassUseFile(); - clsgen.close(); - } catch (IOException exc) { - configuration.standardmessage. - error("doclet.exception_encountered", - exc.toString(), path.getPath()); - throw new DocletAbortException(exc); - } - } - - /** - * Generate the class use list. - */ - protected void generateClassUseFile() throws IOException { - HtmlTree body = getClassUseHeader(); - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.classUseContainer); - if (pkgSet.size() > 0) { - addClassUse(div); - } else { - div.addContent(getResource("doclet.ClassUse_No.usage.of.0", - classdoc.qualifiedName())); - } - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - body.addContent(mainTree); - } else { - body.addContent(div); - } - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : body; - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } - printHtmlDocument(null, true, body); - } - - /** - * Add the class use documentation. - * - * @param contentTree the content tree to which the class use information will be added - */ - protected void addClassUse(Content contentTree) throws IOException { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - if (configuration.packages.size() > 1) { - addPackageList(ul); - addPackageAnnotationList(ul); - } - addClassList(ul); - contentTree.addContent(ul); - } - - /** - * Add the packages list that use the given class. - * - * @param contentTree the content tree to which the packages list will be added - */ - protected void addPackageList(Content contentTree) throws IOException { - Content caption = getTableCaption(configuration.getResource( - "doclet.ClassUse_Packages.that.use.0", - getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)))); - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.useSummary, caption) - : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption); - table.addContent(getSummaryTableHeader(packageTableHeader, "col")); - Content tbody = new HtmlTree(HtmlTag.TBODY); - Iterator it = pkgSet.iterator(); - for (int i = 0; it.hasNext(); i++) { - PackageDoc pkg = it.next(); - HtmlTree tr = new HtmlTree(HtmlTag.TR); - if (i % 2 == 0) { - tr.addStyle(HtmlStyle.altColor); - } else { - tr.addStyle(HtmlStyle.rowColor); - } - addPackageUse(pkg, tr); - tbody.addContent(tr); - } - table.addContent(tbody); - Content li = HtmlTree.LI(HtmlStyle.blockList, table); - contentTree.addContent(li); - } - - /** - * Add the package annotation list. - * - * @param contentTree the content tree to which the package annotation list will be added - */ - protected void addPackageAnnotationList(Content contentTree) throws IOException { - if ((!classdoc.isAnnotationType()) || - pkgToPackageAnnotations == null || - pkgToPackageAnnotations.isEmpty()) { - return; - } - Content caption = getTableCaption(configuration.getResource( - "doclet.ClassUse_PackageAnnotation", - getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)))); - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.useSummary, caption) - : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption); - table.addContent(getSummaryTableHeader(packageTableHeader, "col")); - Content tbody = new HtmlTree(HtmlTag.TBODY); - Iterator it = pkgToPackageAnnotations.iterator(); - for (int i = 0; it.hasNext(); i++) { - PackageDoc pkg = it.next(); - HtmlTree tr = new HtmlTree(HtmlTag.TR); - if (i % 2 == 0) { - tr.addStyle(HtmlStyle.altColor); - } else { - tr.addStyle(HtmlStyle.rowColor); - } - Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, - getPackageLink(pkg, new StringContent(pkg.name()))); - tr.addContent(tdFirst); - HtmlTree tdLast = new HtmlTree(HtmlTag.TD); - tdLast.addStyle(HtmlStyle.colLast); - addSummaryComment(pkg, tdLast); - tr.addContent(tdLast); - tbody.addContent(tr); - } - table.addContent(tbody); - Content li = HtmlTree.LI(HtmlStyle.blockList, table); - contentTree.addContent(li); - } - - /** - * Add the class list that use the given class. - * - * @param contentTree the content tree to which the class list will be added - */ - protected void addClassList(Content contentTree) throws IOException { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - for (PackageDoc pkg : pkgSet) { - Content markerAnchor = getMarkerAnchor(getPackageAnchorName(pkg)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(markerAnchor) - : HtmlTree.LI(HtmlStyle.blockList, markerAnchor); - Content link = getResource("doclet.ClassUse_Uses.of.0.in.1", - getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, - classdoc)), - getPackageLink(pkg, utils.getPackageName(pkg))); - Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link); - htmlTree.addContent(heading); - addClassUse(pkg, htmlTree); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - } - Content li = HtmlTree.LI(HtmlStyle.blockList, ul); - contentTree.addContent(li); - } - - /** - * Add the package use information. - * - * @param pkg the package that uses the given class - * @param contentTree the content tree to which the package use information will be added - */ - protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { - Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, - getHyperLink(getPackageAnchorName(pkg), new StringContent(utils.getPackageName(pkg)))); - contentTree.addContent(tdFirst); - HtmlTree tdLast = new HtmlTree(HtmlTag.TD); - tdLast.addStyle(HtmlStyle.colLast); - addSummaryComment(pkg, tdLast); - contentTree.addContent(tdLast); - } - - /** - * Add the class use information. - * - * @param pkg the package that uses the given class - * @param contentTree the content tree to which the class use information will be added - */ - protected void addClassUse(PackageDoc pkg, Content contentTree) throws IOException { - Content classLink = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)); - Content pkgLink = getPackageLink(pkg, utils.getPackageName(pkg)); - classSubWriter.addUseInfo(pkgToClassAnnotations.get(pkg.name()), - configuration.getResource("doclet.ClassUse_Annotation", classLink, - pkgLink), classUseTableSummary, contentTree); - classSubWriter.addUseInfo(pkgToClassTypeParameter.get(pkg.name()), - configuration.getResource("doclet.ClassUse_TypeParameter", classLink, - pkgLink), classUseTableSummary, contentTree); - classSubWriter.addUseInfo(pkgToSubclass.get(pkg.name()), - configuration.getResource("doclet.ClassUse_Subclass", classLink, - pkgLink), subclassUseTableSummary, contentTree); - classSubWriter.addUseInfo(pkgToSubinterface.get(pkg.name()), - configuration.getResource("doclet.ClassUse_Subinterface", classLink, - pkgLink), subinterfaceUseTableSummary, contentTree); - classSubWriter.addUseInfo(pkgToImplementingClass.get(pkg.name()), - configuration.getResource("doclet.ClassUse_ImplementingClass", classLink, - pkgLink), classUseTableSummary, contentTree); - fieldSubWriter.addUseInfo(pkgToField.get(pkg.name()), - configuration.getResource("doclet.ClassUse_Field", classLink, - pkgLink), fieldUseTableSummary, contentTree); - fieldSubWriter.addUseInfo(pkgToFieldAnnotations.get(pkg.name()), - configuration.getResource("doclet.ClassUse_FieldAnnotations", classLink, - pkgLink), fieldUseTableSummary, contentTree); - fieldSubWriter.addUseInfo(pkgToFieldTypeParameter.get(pkg.name()), - configuration.getResource("doclet.ClassUse_FieldTypeParameter", classLink, - pkgLink), fieldUseTableSummary, contentTree); - methodSubWriter.addUseInfo(pkgToMethodAnnotations.get(pkg.name()), - configuration.getResource("doclet.ClassUse_MethodAnnotations", classLink, - pkgLink), methodUseTableSummary, contentTree); - methodSubWriter.addUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()), - configuration.getResource("doclet.ClassUse_MethodParameterAnnotations", classLink, - pkgLink), methodUseTableSummary, contentTree); - methodSubWriter.addUseInfo(pkgToMethodTypeParameter.get(pkg.name()), - configuration.getResource("doclet.ClassUse_MethodTypeParameter", classLink, - pkgLink), methodUseTableSummary, contentTree); - methodSubWriter.addUseInfo(pkgToMethodReturn.get(pkg.name()), - configuration.getResource("doclet.ClassUse_MethodReturn", classLink, - pkgLink), methodUseTableSummary, contentTree); - methodSubWriter.addUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()), - configuration.getResource("doclet.ClassUse_MethodReturnTypeParameter", classLink, - pkgLink), methodUseTableSummary, contentTree); - methodSubWriter.addUseInfo(pkgToMethodArgs.get(pkg.name()), - configuration.getResource("doclet.ClassUse_MethodArgs", classLink, - pkgLink), methodUseTableSummary, contentTree); - methodSubWriter.addUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()), - configuration.getResource("doclet.ClassUse_MethodArgsTypeParameters", classLink, - pkgLink), methodUseTableSummary, contentTree); - methodSubWriter.addUseInfo(pkgToMethodThrows.get(pkg.name()), - configuration.getResource("doclet.ClassUse_MethodThrows", classLink, - pkgLink), methodUseTableSummary, contentTree); - constrSubWriter.addUseInfo(pkgToConstructorAnnotations.get(pkg.name()), - configuration.getResource("doclet.ClassUse_ConstructorAnnotations", classLink, - pkgLink), constructorUseTableSummary, contentTree); - constrSubWriter.addUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()), - configuration.getResource("doclet.ClassUse_ConstructorParameterAnnotations", classLink, - pkgLink), constructorUseTableSummary, contentTree); - constrSubWriter.addUseInfo(pkgToConstructorArgs.get(pkg.name()), - configuration.getResource("doclet.ClassUse_ConstructorArgs", classLink, - pkgLink), constructorUseTableSummary, contentTree); - constrSubWriter.addUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()), - configuration.getResource("doclet.ClassUse_ConstructorArgsTypeParameters", classLink, - pkgLink), constructorUseTableSummary, contentTree); - constrSubWriter.addUseInfo(pkgToConstructorThrows.get(pkg.name()), - configuration.getResource("doclet.ClassUse_ConstructorThrows", classLink, - pkgLink), constructorUseTableSummary, contentTree); - } - - /** - * Get the header for the class use Listing. - * - * @return a content tree representing the class use header - */ - protected HtmlTree getClassUseHeader() { - String cltype = configuration.getText(classdoc.isInterface()? - "doclet.Interface":"doclet.Class"); - String clname = classdoc.qualifiedName(); - String title = configuration.getText("doclet.Window_ClassUse_Header", - cltype, clname); - HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - ContentBuilder headContent = new ContentBuilder(); - headContent.addContent(getResource("doclet.ClassUse_Title", cltype)); - headContent.addContent(new HtmlTree(HtmlTag.BR)); - headContent.addContent(clname); - Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, - true, HtmlStyle.title, headContent); - Content div = HtmlTree.DIV(HtmlStyle.header, heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } - return bodyTree; - } - - /** - * Get this package link. - * - * @return a content tree for the package link - */ - protected Content getNavLinkPackage() { - Content linkContent = - getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), packageLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get class page link. - * - * @return a content tree for the class page link - */ - protected Content getNavLinkClass() { - Content linkContent = getLink(new LinkInfoImpl( - configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc) - .label(configuration.getText("doclet.Class"))); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get the use link. - * - * @return a content tree for the use link - */ - protected Content getNavLinkClassUse() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel); - return li; - } - - /** - * Get the tree link. - * - * @return a content tree for the tree link - */ - protected Content getNavLinkTree() { - Content linkContent = classdoc.containingPackage().isIncluded() ? - getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), treeLabel) : - getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), treeLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java +++ /dev/null @@ -1,738 +0,0 @@ -/* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.javadoc.main.RootDocImpl; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.builders.*; -import com.sun.tools.doclets.internal.toolkit.taglets.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -import java.io.IOException; - -/** - * Generate the Class Information Page. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @see com.sun.javadoc.ClassDoc - * @see java.util.Collections - * @see java.util.List - * @see java.util.ArrayList - * @see java.util.HashMap - * - * @author Atul M Dambalkar - * @author Robert Field - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class ClassWriterImpl extends SubWriterHolderWriter - implements ClassWriter { - - protected final ClassDoc classDoc; - - protected final ClassTree classtree; - - protected final ClassDoc prev; - - protected final ClassDoc next; - - /** - * @param configuration the configuration data for the doclet - * @param classDoc the class being documented. - * @param prevClass the previous class that was documented. - * @param nextClass the next class being documented. - * @param classTree the class tree for the given class. - */ - public ClassWriterImpl (ConfigurationImpl configuration, ClassDoc classDoc, - ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) - throws IOException { - super(configuration, DocPath.forClass(classDoc)); - this.classDoc = classDoc; - configuration.currentcd = classDoc; - this.classtree = classTree; - this.prev = prevClass; - this.next = nextClass; - } - - /** - * Get this package link. - * - * @return a content tree for the package link - */ - protected Content getNavLinkPackage() { - Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY, - packageLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get the class link. - * - * @return a content tree for the class link - */ - protected Content getNavLinkClass() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, classLabel); - return li; - } - - /** - * Get the class use link. - * - * @return a content tree for the class use link - */ - protected Content getNavLinkClassUse() { - Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), useLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get link to previous class. - * - * @return a content tree for the previous class link - */ - public Content getNavLinkPrevious() { - Content li; - if (prev != null) { - Content prevLink = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS, prev) - .label(prevclassLabel).strong(true)); - li = HtmlTree.LI(prevLink); - } - else - li = HtmlTree.LI(prevclassLabel); - return li; - } - - /** - * Get link to next class. - * - * @return a content tree for the next class link - */ - public Content getNavLinkNext() { - Content li; - if (next != null) { - Content nextLink = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS, next) - .label(nextclassLabel).strong(true)); - li = HtmlTree.LI(nextLink); - } - else - li = HtmlTree.LI(nextclassLabel); - return li; - } - - /** - * {@inheritDoc} - */ - public Content getHeader(String header) { - String pkgname = (classDoc.containingPackage() != null)? - classDoc.containingPackage().name(): ""; - String clname = classDoc.name(); - HtmlTree bodyTree = getBody(true, getWindowTitle(clname)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA); - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.header); - if (pkgname.length() > 0) { - Content classPackageLabel = HtmlTree.SPAN(HtmlStyle.packageLabelInClass, packageLabel); - Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, classPackageLabel); - pkgNameDiv.addContent(getSpace()); - Content pkgNameContent = getTargetPackageLink(classDoc.containingPackage(), - "classFrame", new StringContent(pkgname)); - pkgNameDiv.addContent(pkgNameContent); - div.addContent(pkgNameDiv); - } - LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_HEADER, classDoc); - //Let's not link to ourselves in the header. - linkInfo.linkToSelf = false; - Content headerContent = new StringContent(header); - Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, - HtmlStyle.title, headerContent); - heading.addContent(getTypeParameterLinks(linkInfo)); - div.addContent(heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } - return bodyTree; - } - - /** - * {@inheritDoc} - */ - public Content getClassContentHeader() { - return getContentHeader(); - } - - /** - * {@inheritDoc} - */ - public void addFooter(Content contentTree) { - contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA); - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : contentTree; - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - contentTree.addContent(htmlTree); - } - } - - /** - * {@inheritDoc} - */ - public void printDocument(Content contentTree) throws IOException { - printHtmlDocument(configuration.metakeywords.getMetaKeywords(classDoc), - true, contentTree); - } - - /** - * {@inheritDoc} - */ - public Content getClassInfoTreeHeader() { - return getMemberTreeHeader(); - } - - /** - * {@inheritDoc} - */ - public Content getClassInfo(Content classInfoTree) { - return getMemberTree(HtmlStyle.description, classInfoTree); - } - - /** - * {@inheritDoc} - */ - public void addClassSignature(String modifiers, Content classInfoTree) { - boolean isInterface = classDoc.isInterface(); - classInfoTree.addContent(new HtmlTree(HtmlTag.BR)); - Content pre = new HtmlTree(HtmlTag.PRE); - addAnnotationInfo(classDoc, pre); - pre.addContent(modifiers); - LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_SIGNATURE, classDoc); - //Let's not link to ourselves in the signature. - linkInfo.linkToSelf = false; - Content className = new StringContent(classDoc.name()); - Content parameterLinks = getTypeParameterLinks(linkInfo); - if (configuration.linksource) { - addSrcLink(classDoc, className, pre); - pre.addContent(parameterLinks); - } else { - Content span = HtmlTree.SPAN(HtmlStyle.typeNameLabel, className); - span.addContent(parameterLinks); - pre.addContent(span); - } - if (!isInterface) { - Type superclass = utils.getFirstVisibleSuperClass(classDoc, - configuration); - if (superclass != null) { - pre.addContent(DocletConstants.NL); - pre.addContent("extends "); - Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, - superclass)); - pre.addContent(link); - } - } - Type[] implIntfacs = classDoc.interfaceTypes(); - if (implIntfacs != null && implIntfacs.length > 0) { - int counter = 0; - for (Type implType : implIntfacs) { - ClassDoc classDoc = implType.asClassDoc(); - if (!(classDoc.isPublic() || utils.isLinkable(classDoc, configuration))) { - continue; - } - if (counter == 0) { - pre.addContent(DocletConstants.NL); - pre.addContent(isInterface ? "extends " : "implements "); - } else { - pre.addContent(", "); - } - Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_SIGNATURE_PARENT_NAME, - implType)); - pre.addContent(link); - counter++; - } - } - classInfoTree.addContent(pre); - } - - /** - * {@inheritDoc} - */ - public void addClassDescription(Content classInfoTree) { - if(!configuration.nocomment) { - // generate documentation for the class. - if (classDoc.inlineTags().length > 0) { - addInlineComment(classDoc, classInfoTree); - } - } - } - - /** - * {@inheritDoc} - */ - public void addClassTagInfo(Content classInfoTree) { - if(!configuration.nocomment) { - // Print Information about all the tags here - addTagsInfo(classDoc, classInfoTree); - } - } - - /** - * Get the class hierarchy tree for the given class. - * - * @param type the class to print the hierarchy for - * @return a content tree for class inheritence - */ - private Content getClassInheritenceTree(Type type) { - Type sup; - HtmlTree classTreeUl = new HtmlTree(HtmlTag.UL); - classTreeUl.addStyle(HtmlStyle.inheritance); - Content liTree = null; - do { - sup = utils.getFirstVisibleSuperClass( - type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(), - configuration); - if (sup != null) { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.inheritance); - ul.addContent(getTreeForClassHelper(type)); - if (liTree != null) - ul.addContent(liTree); - Content li = HtmlTree.LI(ul); - liTree = li; - type = sup; - } - else - classTreeUl.addContent(getTreeForClassHelper(type)); - } - while (sup != null); - if (liTree != null) - classTreeUl.addContent(liTree); - return classTreeUl; - } - - /** - * Get the class helper tree for the given class. - * - * @param type the class to print the helper for - * @return a content tree for class helper - */ - private Content getTreeForClassHelper(Type type) { - Content li = new HtmlTree(HtmlTag.LI); - if (type.equals(classDoc)) { - Content typeParameters = getTypeParameterLinks( - new LinkInfoImpl(configuration, LinkInfoImpl.Kind.TREE, - classDoc)); - if (configuration.shouldExcludeQualifier( - classDoc.containingPackage().name())) { - li.addContent(type.asClassDoc().name()); - li.addContent(typeParameters); - } else { - li.addContent(type.asClassDoc().qualifiedName()); - li.addContent(typeParameters); - } - } else { - Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS_TREE_PARENT, type) - .label(configuration.getClassName(type.asClassDoc()))); - li.addContent(link); - } - return li; - } - - /** - * {@inheritDoc} - */ - public void addClassTree(Content classContentTree) { - if (!classDoc.isClass()) { - return; - } - classContentTree.addContent(getClassInheritenceTree(classDoc)); - } - - /** - * {@inheritDoc} - */ - public void addTypeParamInfo(Content classInfoTree) { - if (classDoc.typeParamTags().length > 0) { - Content typeParam = (new ParamTaglet()).getTagletOutput(classDoc, - getTagletWriterInstance(false)); - Content dl = HtmlTree.DL(typeParam); - classInfoTree.addContent(dl); - } - } - - /** - * {@inheritDoc} - */ - public void addSubClassInfo(Content classInfoTree) { - if (classDoc.isClass()) { - if (classDoc.qualifiedName().equals("java.lang.Object") || - classDoc.qualifiedName().equals("org.omg.CORBA.Object")) { - return; // Don't generate the list, too huge - } - SortedSet subclasses = classtree.subs(classDoc, false); - if (!subclasses.isEmpty()) { - Content label = getResource( - "doclet.Subclasses"); - Content dt = HtmlTree.DT(label); - Content dl = HtmlTree.DL(dt); - dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBCLASSES, - subclasses)); - classInfoTree.addContent(dl); - } - } - } - - /** - * {@inheritDoc} - */ - public void addSubInterfacesInfo(Content classInfoTree) { - if (classDoc.isInterface()) { - SortedSet subInterfaces = classtree.allSubs(classDoc, false); - if (!subInterfaces.isEmpty()) { - Content label = getResource( - "doclet.Subinterfaces"); - Content dt = HtmlTree.DT(label); - Content dl = HtmlTree.DL(dt); - dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBINTERFACES, - subInterfaces)); - classInfoTree.addContent(dl); - } - } - } - - /** - * {@inheritDoc} - */ - public void addInterfaceUsageInfo (Content classInfoTree) { - if (! classDoc.isInterface()) { - return; - } - if (classDoc.qualifiedName().equals("java.lang.Cloneable") || - classDoc.qualifiedName().equals("java.io.Serializable")) { - return; // Don't generate the list, too big - } - SortedSet implcl = classtree.implementingclasses(classDoc); - if (!implcl.isEmpty()) { - Content label = getResource( - "doclet.Implementing_Classes"); - Content dt = HtmlTree.DT(label); - Content dl = HtmlTree.DL(dt); - dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_CLASSES, - implcl)); - classInfoTree.addContent(dl); - } - } - - /** - * {@inheritDoc} - */ - public void addImplementedInterfacesInfo(Content classInfoTree) { - //NOTE: we really should be using ClassDoc.interfaceTypes() here, but - // it doesn't walk up the tree like we want it to. - List interfaceArray = utils.getAllInterfaces(classDoc, configuration); - if (classDoc.isClass() && interfaceArray.size() > 0) { - Content label = getResource( - "doclet.All_Implemented_Interfaces"); - Content dt = HtmlTree.DT(label); - Content dl = HtmlTree.DL(dt); - dl.addContent(getClassLinks(LinkInfoImpl.Kind.IMPLEMENTED_INTERFACES, - interfaceArray)); - classInfoTree.addContent(dl); - } - } - - /** - * {@inheritDoc} - */ - public void addSuperInterfacesInfo(Content classInfoTree) { - //NOTE: we really should be using ClassDoc.interfaceTypes() here, but - // it doesn't walk up the tree like we want it to. - List interfaceArray = utils.getAllInterfaces(classDoc, configuration); - if (classDoc.isInterface() && interfaceArray.size() > 0) { - Content label = getResource( - "doclet.All_Superinterfaces"); - Content dt = HtmlTree.DT(label); - Content dl = HtmlTree.DL(dt); - dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUPER_INTERFACES, - interfaceArray)); - classInfoTree.addContent(dl); - } - } - - /** - * {@inheritDoc} - */ - public void addNestedClassInfo(Content classInfoTree) { - ClassDoc outerClass = classDoc.containingClass(); - if (outerClass != null) { - Content label; - if (outerClass.isInterface()) { - label = getResource( - "doclet.Enclosing_Interface"); - } else { - label = getResource( - "doclet.Enclosing_Class"); - } - Content dt = HtmlTree.DT(label); - Content dl = HtmlTree.DL(dt); - Content dd = new HtmlTree(HtmlTag.DD); - dd.addContent(getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CLASS, outerClass))); - dl.addContent(dd); - classInfoTree.addContent(dl); - } - } - - /** - * {@inheritDoc} - */ - public void addFunctionalInterfaceInfo (Content classInfoTree) { - if (isFunctionalInterface()) { - Content dt = HtmlTree.DT(getResource("doclet.Functional_Interface")); - Content dl = HtmlTree.DL(dt); - Content dd = new HtmlTree(HtmlTag.DD); - dd.addContent(getResource("doclet.Functional_Interface_Message")); - dl.addContent(dd); - classInfoTree.addContent(dl); - } - } - - public boolean isFunctionalInterface() { - if (configuration.root instanceof RootDocImpl) { - RootDocImpl root = (RootDocImpl) configuration.root; - AnnotationDesc[] annotationDescList = classDoc.annotations(); - for (AnnotationDesc annoDesc : annotationDescList) { - if (root.isFunctionalInterface(annoDesc)) { - return true; - } - } - } - return false; - } - - /** - * {@inheritDoc} - */ - public void addClassDeprecationInfo(Content classInfoTree) { - Content hr = new HtmlTree(HtmlTag.HR); - classInfoTree.addContent(hr); - Tag[] deprs = classDoc.tags("deprecated"); - if (utils.isDeprecated(classDoc)) { - Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); - Content div = HtmlTree.DIV(HtmlStyle.block, deprLabel); - if (deprs.length > 0) { - Tag[] commentTags = deprs[0].inlineTags(); - if (commentTags.length > 0) { - div.addContent(getSpace()); - addInlineDeprecatedComment(classDoc, deprs[0], div); - } - } - classInfoTree.addContent(div); - } - } - - /** - * Get links to the given classes. - * - * @param context the id of the context where the link will be printed - * @param list the list of classes - * @return a content tree for the class list - */ - private Content getClassLinks(LinkInfoImpl.Kind context, Collection list) { - Object[] typeList = list.toArray(); - Content dd = new HtmlTree(HtmlTag.DD); - boolean isFirst = true; - for (Object item : typeList) { - if (!isFirst) { - Content separator = new StringContent(", "); - dd.addContent(separator); - } else { - isFirst = false; - } - - if (item instanceof ClassDoc) { - Content link = getLink(new LinkInfoImpl(configuration, context, (ClassDoc)item)); - dd.addContent(link); - } else { - Content link = getLink(new LinkInfoImpl(configuration, context, (Type)item)); - dd.addContent(link); - } - } - return dd; - } - - /** - * {@inheritDoc} - */ - protected Content getNavLinkTree() { - Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE, - treeLabel, "", ""); - Content li = HtmlTree.LI(treeLinkContent); - return li; - } - - /** - * Add summary details to the navigation bar. - * - * @param subDiv the content tree to which the summary detail links will be added - */ - protected void addSummaryDetailLinks(Content subDiv) { - try { - Content div = HtmlTree.DIV(getNavSummaryLinks()); - div.addContent(getNavDetailLinks()); - subDiv.addContent(div); - } catch (Exception e) { - e.printStackTrace(); - throw new DocletAbortException(e); - } - } - - /** - * Get summary links for navigation bar. - * - * @return the content tree for the navigation summary links - */ - protected Content getNavSummaryLinks() throws Exception { - Content li = HtmlTree.LI(summaryLabel); - li.addContent(getSpace()); - Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); - MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) - configuration.getBuilderFactory().getMemberSummaryBuilder(this); - String[] navLinkLabels = new String[] { - "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor", - "doclet.navMethod" - }; - for (int i = 0; i < navLinkLabels.length; i++ ) { - Content liNav = new HtmlTree(HtmlTag.LI); - if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) { - continue; - } - if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) { - continue; - } - AbstractMemberWriter writer = - ((AbstractMemberWriter) memberSummaryBuilder. - getMemberSummaryWriter(i)); - if (writer == null) { - liNav.addContent(getResource(navLinkLabels[i])); - } else { - writer.addNavSummaryLink( - memberSummaryBuilder.members(i), - memberSummaryBuilder.getVisibleMemberMap(i), liNav); - } - if (i < navLinkLabels.length-1) { - addNavGap(liNav); - } - ulNav.addContent(liNav); - } - return ulNav; - } - - /** - * Get detail links for the navigation bar. - * - * @return the content tree for the detail links - */ - protected Content getNavDetailLinks() throws Exception { - Content li = HtmlTree.LI(detailLabel); - li.addContent(getSpace()); - Content ulNav = HtmlTree.UL(HtmlStyle.subNavList, li); - MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) - configuration.getBuilderFactory().getMemberSummaryBuilder(this); - String[] navLinkLabels = new String[] { - "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor", - "doclet.navMethod" - }; - for (int i = 1; i < navLinkLabels.length; i++ ) { - Content liNav = new HtmlTree(HtmlTag.LI); - AbstractMemberWriter writer = - ((AbstractMemberWriter) memberSummaryBuilder. - getMemberSummaryWriter(i)); - if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) { - continue; - } - if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) { - continue; - } - if (writer == null) { - liNav.addContent(getResource(navLinkLabels[i])); - } else { - writer.addNavDetailLink(memberSummaryBuilder.members(i), liNav); - } - if (i < navLinkLabels.length - 1) { - addNavGap(liNav); - } - ulNav.addContent(liNav); - } - return ulNav; - } - - /** - * Add gap between navigation bar elements. - * - * @param liNav the content tree to which the gap will be added - */ - protected void addNavGap(Content liNav) { - liNav.addContent(getSpace()); - liNav.addContent("|"); - liNav.addContent(getSpace()); - } - - /** - * Return the classDoc being documented. - * - * @return the classDoc being documented. - */ - public ClassDoc getClassDoc() { - return classDoc; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java +++ /dev/null @@ -1,710 +0,0 @@ -/* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.net.*; -import java.util.*; - -import javax.tools.JavaFileManager; -import javax.tools.JavaFileManager.Location; -import javax.tools.StandardLocation; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.doclint.DocLint; -import com.sun.tools.javac.file.JavacFileManager; -import com.sun.tools.javac.util.Context; -import com.sun.tools.javac.util.StringUtils; -import com.sun.tools.javadoc.main.JavaScriptScanner; -import com.sun.tools.javadoc.main.RootDocImpl; - -/** - * Configure the output based on the command line options. - *

- * Also determine the length of the command line option. For example, - * for a option "-header" there will be a string argument associated, then the - * the length of option "-header" is two. But for option "-nohelp" no argument - * is needed so it's length is 1. - *

- *

- * Also do the error checking on the options used. For example it is illegal to - * use "-helpfile" option when already "-nohelp" option is used. - *

- * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert Field. - * @author Atul Dambalkar. - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class ConfigurationImpl extends Configuration { - - /** - * The build date. Note: For now, we will use - * a version number instead of a date. - */ - public static final String BUILD_DATE = System.getProperty("java.version"); - - /** - * Argument for command line option "-header". - */ - public String header = ""; - - /** - * Argument for command line option "-packagesheader". - */ - public String packagesheader = ""; - - /** - * Argument for command line option "-footer". - */ - public String footer = ""; - - /** - * Argument for command line option "-doctitle". - */ - public String doctitle = ""; - - /** - * Argument for command line option "-windowtitle". - */ - public String windowtitle = ""; - - /** - * Argument for command line option "-top". - */ - public String top = ""; - - /** - * Argument for command line option "-bottom". - */ - public String bottom = ""; - - /** - * Argument for command line option "-helpfile". - */ - public String helpfile = ""; - - /** - * Argument for command line option "-stylesheetfile". - */ - public String stylesheetfile = ""; - - /** - * Argument for command line option "-Xdocrootparent". - */ - public String docrootparent = ""; - - /** - * True if command line option "-nohelp" is used. Default value is false. - */ - public boolean nohelp = false; - - /** - * True if command line option "-splitindex" is used. Default value is - * false. - */ - public boolean splitindex = false; - - /** - * False if command line option "-noindex" is used. Default value is true. - */ - public boolean createindex = true; - - /** - * True if command line option "-use" is used. Default value is false. - */ - public boolean classuse = false; - - /** - * False if command line option "-notree" is used. Default value is true. - */ - public boolean createtree = true; - - /** - * True if command line option "-nodeprecated" is used. Default value is - * false. - */ - public boolean nodeprecatedlist = false; - - /** - * True if command line option "-nonavbar" is used. Default value is false. - */ - public boolean nonavbar = false; - - /** - * True if command line option "-nooverview" is used. Default value is - * false - */ - private boolean nooverview = false; - - /** - * True if command line option "-overview" is used. Default value is false. - */ - public boolean overview = false; - - /** - * This is true if option "-overview" is used or option "-overview" is not - * used and number of packages is more than one. - */ - public boolean createoverview = false; - - /** - * This is the HTML version of the generated pages. HTML 4.01 is the default output version. - */ - public HtmlVersion htmlVersion = HtmlVersion.HTML4; - - /** - * Collected set of doclint options - */ - public Set doclintOpts = new LinkedHashSet<>(); - - /** - * Whether or not to check for JavaScript in doc comments. - */ - private boolean allowScriptInComments; - - /** - * Unique Resource Handler for this package. - */ - public final MessageRetriever standardmessage; - - /** - * First file to appear in the right-hand frame in the generated - * documentation. - */ - public DocPath topFile = DocPath.empty; - - /** - * The classdoc for the class file getting generated. - */ - public ClassDoc currentcd = null; // Set this classdoc in the ClassWriter. - - protected List memberSearchIndex = new ArrayList<>(); - - protected List packageSearchIndex = new ArrayList<>(); - - protected List tagSearchIndex = new ArrayList<>(); - - protected List typeSearchIndex = new ArrayList<>(); - - protected Map> tagSearchIndexMap = new HashMap<>(); - - protected Set tagSearchIndexKeys; - - /** - * Constructor. Initializes resource for the - * {@link com.sun.tools.doclets.internal.toolkit.util.MessageRetriever MessageRetriever}. - */ - public ConfigurationImpl() { - standardmessage = new MessageRetriever(this, - "com.sun.tools.doclets.formats.html.resources.standard"); - } - - private final String versionRBName = "com.sun.tools.javadoc.resources.version"; - private ResourceBundle versionRB; - - /** - * Return the build date for the doclet. - */ - @Override - public String getDocletSpecificBuildDate() { - if (versionRB == null) { - try { - versionRB = ResourceBundle.getBundle(versionRBName); - } catch (MissingResourceException e) { - return BUILD_DATE; - } - } - - try { - return versionRB.getString("release"); - } catch (MissingResourceException e) { - return BUILD_DATE; - } - } - - /** - * Depending upon the command line options provided by the user, set - * configure the output generation environment. - * - * @param options The array of option names and values. - */ - @Override - public void setSpecificDocletOptions(String[][] options) { - for (int oi = 0; oi < options.length; ++oi) { - String[] os = options[oi]; - String opt = StringUtils.toLowerCase(os[0]); - if (opt.equals("-footer")) { - footer = os[1]; - } else if (opt.equals("-header")) { - header = os[1]; - } else if (opt.equals("-packagesheader")) { - packagesheader = os[1]; - } else if (opt.equals("-doctitle")) { - doctitle = os[1]; - } else if (opt.equals("-windowtitle")) { - windowtitle = os[1].replaceAll("\\<.*?>", ""); - } else if (opt.equals("-top")) { - top = os[1]; - } else if (opt.equals("-bottom")) { - bottom = os[1]; - } else if (opt.equals("-helpfile")) { - helpfile = os[1]; - } else if (opt.equals("-stylesheetfile")) { - stylesheetfile = os[1]; - } else if (opt.equals("-charset")) { - charset = os[1]; - } else if (opt.equals("-xdocrootparent")) { - docrootparent = os[1]; - } else if (opt.equals("-nohelp")) { - nohelp = true; - } else if (opt.equals("-splitindex")) { - splitindex = true; - } else if (opt.equals("-noindex")) { - createindex = false; - } else if (opt.equals("-use")) { - classuse = true; - } else if (opt.equals("-notree")) { - createtree = false; - } else if (opt.equals("-nodeprecatedlist")) { - nodeprecatedlist = true; - } else if (opt.equals("-nonavbar")) { - nonavbar = true; - } else if (opt.equals("-nooverview")) { - nooverview = true; - } else if (opt.equals("-overview")) { - overview = true; - } else if (opt.equals("-html4")) { - htmlVersion = HtmlVersion.HTML4; - } else if (opt.equals("-html5")) { - htmlVersion = HtmlVersion.HTML5; - } else if (opt.equals("-xdoclint")) { - doclintOpts.add(DocLint.XMSGS_OPTION); - } else if (opt.startsWith("-xdoclint:")) { - doclintOpts.add(DocLint.XMSGS_CUSTOM_PREFIX + opt.substring(opt.indexOf(":") + 1)); - } else if (opt.startsWith("-xdoclint/package:")) { - doclintOpts.add(DocLint.XCHECK_PACKAGE + opt.substring(opt.indexOf(":") + 1)); - } else if (opt.equals("--allow-script-in-comments")) { - allowScriptInComments = true; - } - } - - if (root.specifiedClasses().length > 0) { - Map map = new HashMap<>(); - PackageDoc pd; - ClassDoc[] classes = root.classes(); - for (ClassDoc aClass : classes) { - pd = aClass.containingPackage(); - if (!map.containsKey(pd.name())) { - map.put(pd.name(), pd); - } - } - } - - setCreateOverview(); - setTopFile(root); - - if (root instanceof RootDocImpl) { - ((RootDocImpl) root).initDocLint(doclintOpts, tagletManager.getCustomTagNames(), - StringUtils.toLowerCase(htmlVersion.name())); - JavaScriptScanner jss = ((RootDocImpl) root).initJavaScriptScanner(isAllowScriptInComments()); - if (jss != null) { - // In a more object-oriented world, this would be done by methods on the Option objects. - // Note that -windowtitle silently removes any and all HTML elements, and so does not need - // to be handled here. - checkJavaScript(jss, "-header", header); - checkJavaScript(jss, "-footer", footer); - checkJavaScript(jss, "-top", top); - checkJavaScript(jss, "-bottom", bottom); - checkJavaScript(jss, "-doctitle", doctitle); - checkJavaScript(jss, "-packagesheader", packagesheader); - } - } - } - - private void checkJavaScript(JavaScriptScanner jss, final String opt, String value) { - jss.parse(value, new JavaScriptScanner.Reporter() { - public void report() { - root.printError(getText("doclet.JavaScript_in_option", opt)); - throw new FatalError(); - } - }); - } - - /** - * Returns the "length" of a given option. If an option takes no - * arguments, its length is one. If it takes one argument, it's - * length is two, and so on. This method is called by JavaDoc to - * parse the options it does not recognize. It then calls - * {@link #validOptions(String[][], DocErrorReporter)} to - * validate them. - * Note:
- * The options arrive as case-sensitive strings. For options that - * are not case-sensitive, use toLowerCase() on the option string - * before comparing it. - * - * @return number of arguments + 1 for a option. Zero return means - * option not known. Negative value means error occurred. - */ - public int optionLength(String option) { - int result = -1; - if ((result = super.optionLength(option)) > 0) { - return result; - } - // otherwise look for the options we have added - option = StringUtils.toLowerCase(option); - if (option.equals("-nodeprecatedlist") || - option.equals("-noindex") || - option.equals("-notree") || - option.equals("-nohelp") || - option.equals("-splitindex") || - option.equals("-serialwarn") || - option.equals("-use") || - option.equals("-nonavbar") || - option.equals("-nooverview") || - option.equals("-html4") || - option.equals("-html5") || - option.equals("-xdoclint") || - option.startsWith("-xdoclint:") || - option.startsWith("-xdoclint/package:") || - option.startsWith("--allow-script-in-comments")) { - return 1; - } else if (option.equals("-help")) { - // Uugh: first, this should not be hidden inside optionLength, - // and second, we should not be writing directly to stdout. - // But we have no access to a DocErrorReporter, which would - // allow use of reporter.printNotice - System.out.println(getText("doclet.usage")); - return 1; - } else if (option.equals("-x")) { - // Uugh: first, this should not be hidden inside optionLength, - // and second, we should not be writing directly to stdout. - // But we have no access to a DocErrorReporter, which would - // allow use of reporter.printNotice - System.out.println(getText("doclet.X.usage")); - return 1; - } else if (option.equals("-footer") || - option.equals("-header") || - option.equals("-packagesheader") || - option.equals("-doctitle") || - option.equals("-windowtitle") || - option.equals("-top") || - option.equals("-bottom") || - option.equals("-helpfile") || - option.equals("-stylesheetfile") || - option.equals("-charset") || - option.equals("-overview") || - option.equals("-xdocrootparent")) { - return 2; - } else { - return 0; - } - } - - /** - * {@inheritDoc} - */ - @Override - public boolean validOptions(String options[][], - DocErrorReporter reporter) { - boolean helpfile = false; - boolean nohelp = false; - boolean overview = false; - boolean nooverview = false; - boolean splitindex = false; - boolean noindex = false; - // check shared options - if (!generalValidOptions(options, reporter)) { - return false; - } - // otherwise look at our options - for (int oi = 0; oi < options.length; ++oi) { - String[] os = options[oi]; - String opt = StringUtils.toLowerCase(os[0]); - if (opt.equals("-helpfile")) { - if (nohelp == true) { - reporter.printError(getText("doclet.Option_conflict", - "-helpfile", "-nohelp")); - return false; - } - if (helpfile == true) { - reporter.printError(getText("doclet.Option_reuse", - "-helpfile")); - return false; - } - DocFile help = DocFile.createFileForInput(this, os[1]); - if (!help.exists()) { - reporter.printError(getText("doclet.File_not_found", os[1])); - return false; - } - helpfile = true; - } else if (opt.equals("-nohelp")) { - if (helpfile == true) { - reporter.printError(getText("doclet.Option_conflict", - "-nohelp", "-helpfile")); - return false; - } - nohelp = true; - } else if (opt.equals("-xdocrootparent")) { - try { - new URL(os[1]); - } catch (MalformedURLException e) { - reporter.printError(getText("doclet.MalformedURL", os[1])); - return false; - } - } else if (opt.equals("-overview")) { - if (nooverview == true) { - reporter.printError(getText("doclet.Option_conflict", - "-overview", "-nooverview")); - return false; - } - if (overview == true) { - reporter.printError(getText("doclet.Option_reuse", - "-overview")); - return false; - } - overview = true; - } else if (opt.equals("-nooverview")) { - if (overview == true) { - reporter.printError(getText("doclet.Option_conflict", - "-nooverview", "-overview")); - return false; - } - nooverview = true; - } else if (opt.equals("-splitindex")) { - if (noindex == true) { - reporter.printError(getText("doclet.Option_conflict", - "-splitindex", "-noindex")); - return false; - } - splitindex = true; - } else if (opt.equals("-noindex")) { - if (splitindex == true) { - reporter.printError(getText("doclet.Option_conflict", - "-noindex", "-splitindex")); - return false; - } - noindex = true; - } else if (opt.startsWith("-xdoclint:")) { - if (opt.contains("/")) { - reporter.printError(getText("doclet.Option_doclint_no_qualifiers")); - return false; - } - if (!DocLint.isValidOption( - opt.replace("-xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX))) { - reporter.printError(getText("doclet.Option_doclint_invalid_arg")); - return false; - } - } else if (opt.startsWith("-xdoclint/package:")) { - if (!DocLint.isValidOption( - opt.replace("-xdoclint/package:", DocLint.XCHECK_PACKAGE))) { - reporter.printError(getText("doclet.Option_doclint_package_invalid_arg")); - return false; - } - } - } - return true; - } - - /** - * Return true if the generated output is HTML5. - */ - public boolean isOutputHtml5() { - return htmlVersion == HtmlVersion.HTML5; - } - - /** - * Return true if the tag is allowed for this specific version of HTML. - */ - public boolean allowTag(HtmlTag htmlTag) { - return htmlTag.allowTag(this.htmlVersion); - } - - /** - * {@inheritDoc} - */ - @Override - public MessageRetriever getDocletSpecificMsg() { - return standardmessage; - } - - /** - * Decide the page which will appear first in the right-hand frame. It will - * be "overview-summary.html" if "-overview" option is used or no - * "-overview" but the number of packages is more than one. It will be - * "package-summary.html" of the respective package if there is only one - * package to document. It will be a class page(first in the sorted order), - * if only classes are provided on the command line. - * - * @param root Root of the program structure. - */ - protected void setTopFile(RootDoc root) { - if (!checkForDeprecation(root)) { - return; - } - if (createoverview) { - topFile = DocPaths.OVERVIEW_SUMMARY; - } else { - if (packages.size() == 1 && packages.first().name().equals("")) { - if (root.classes().length > 0) { - ClassDoc[] classarr = root.classes(); - Arrays.sort(classarr); - ClassDoc cd = getValidClass(classarr); - topFile = DocPath.forClass(cd); - } - } else if (!packages.isEmpty()) { - topFile = DocPath.forPackage(packages.first()).resolve(DocPaths.PACKAGE_SUMMARY); - } - } - } - - protected ClassDoc getValidClass(ClassDoc[] classarr) { - if (!nodeprecated) { - return classarr[0]; - } - for (ClassDoc cd : classarr) { - if (cd.tags("deprecated").length == 0) { - return cd; - } - } - return null; - } - - protected boolean checkForDeprecation(RootDoc root) { - for (ClassDoc cd : root.classes()) { - if (isGeneratedDoc(cd)) { - return true; - } - } - return false; - } - - /** - * Generate "overview.html" page if option "-overview" is used or number of - * packages is more than one. Sets {@link #createoverview} field to true. - */ - protected void setCreateOverview() { - if ((overview || packages.size() > 1) && !nooverview) { - createoverview = true; - } - } - - /** - * {@inheritDoc} - */ - @Override - public WriterFactory getWriterFactory() { - return new WriterFactoryImpl(this); - } - - /** - * {@inheritDoc} - */ - @Override - public Comparator getMemberComparator() { - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public Locale getLocale() { - if (root instanceof RootDocImpl) - return ((RootDocImpl)root).getLocale(); - else - return Locale.getDefault(); - } - - /** - * {@inheritDoc} - */ - @Override - public JavaFileManager getFileManager() { - if (fileManager == null) { - if (root instanceof RootDocImpl) - fileManager = ((RootDocImpl) root).getFileManager(); - else - fileManager = new JavacFileManager(new Context(), false, null); - } - return fileManager; - } - - private JavaFileManager fileManager; - - @Override - public boolean showMessage(SourcePosition pos, String key) { - if (root instanceof RootDocImpl) { - return pos == null || ((RootDocImpl) root).showTagMessages(); - } - return true; - } - - @Override - public Content newContent() { - return new ContentBuilder(); - } - - @Override - public Location getLocationForPackage(PackageDoc pd) { - JavaFileManager fm = getFileManager(); - return StandardLocation.SOURCE_PATH; - } - - protected void buildSearchTagIndex() { - for (SearchIndexItem sii : tagSearchIndex) { - String tagLabel = sii.getLabel(); - char ch = (tagLabel.length() == 0) - ? '*' - : Character.toUpperCase(tagLabel.charAt(0)); - Character unicode = ch; - List list = tagSearchIndexMap.get(unicode); - if (list == null) { - list = new ArrayList<>(); - tagSearchIndexMap.put(unicode, list); - } - list.add(sii); - } - tagSearchIndexKeys = tagSearchIndexMap.keySet(); - } - - /** - * Returns whether or not to allow JavaScript in comments. - * Default is off; can be set true from a command line option. - * @return the allowScriptInComments - */ - public boolean isAllowScriptInComments() { - return allowScriptInComments; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Write the Constants Summary Page in HTML format. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.4 - */ -@Deprecated -public class ConstantsSummaryWriterImpl extends HtmlDocletWriter - implements ConstantsSummaryWriter { - - /** - * The configuration used in this run of the standard doclet. - */ - ConfigurationImpl configuration; - - /** - * The current class being documented. - */ - private ClassDoc currentClassDoc; - - private final String constantsTableSummary; - - private final String[] constantsTableHeader; - - /** - * The HTML tree for main tag. - */ - private HtmlTree mainTree = HtmlTree.MAIN(); - - /** - * The HTML tree for constant values summary. - */ - private HtmlTree summaryTree; - - /** - * Construct a ConstantsSummaryWriter. - * @param configuration the configuration used in this run - * of the standard doclet. - */ - public ConstantsSummaryWriterImpl(ConfigurationImpl configuration) - throws IOException { - super(configuration, DocPaths.CONSTANT_VALUES); - this.configuration = configuration; - constantsTableSummary = configuration.getText("doclet.Constants_Table_Summary", - configuration.getText("doclet.Constants_Summary")); - constantsTableHeader = new String[] { - getModifierTypeHeader(), - configuration.getText("doclet.ConstantField"), - configuration.getText("doclet.Value") - }; - } - - /** - * {@inheritDoc} - */ - public Content getHeader() { - String label = configuration.getText("doclet.Constants_Summary"); - HtmlTree bodyTree = getBody(true, getWindowTitle(label)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - return bodyTree; - } - - /** - * {@inheritDoc} - */ - public Content getContentsHeader() { - return new HtmlTree(HtmlTag.UL); - } - - /** - * {@inheritDoc} - */ - public void addLinkToPackageContent(PackageDoc pkg, String parsedPackageName, - Set printedPackageHeaders, Content contentListTree) { - String packageName = pkg.name(); - //add link to summary - Content link; - if (packageName.length() == 0) { - link = getHyperLink(getDocLink( - SectionName.UNNAMED_PACKAGE_ANCHOR), - defaultPackageLabel, "", ""); - } else { - Content packageNameContent = getPackageLabel(parsedPackageName); - packageNameContent.addContent(".*"); - link = getHyperLink(DocLink.fragment(parsedPackageName), - packageNameContent, "", ""); - printedPackageHeaders.add(parsedPackageName); - } - contentListTree.addContent(HtmlTree.LI(link)); - } - - /** - * {@inheritDoc} - */ - public void addContentsList(Content contentTree, Content contentListTree) { - Content titleContent = getResource( - "doclet.Constants_Summary"); - Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, - HtmlStyle.title, titleContent); - Content div = HtmlTree.DIV(HtmlStyle.header, pHeading); - Content headingContent = getResource( - "doclet.Contents"); - Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, - headingContent); - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree section = HtmlTree.SECTION(heading); - section.addContent(contentListTree); - div.addContent(section); - mainTree.addContent(div); - } else { - div.addContent(heading); - div.addContent(contentListTree); - contentTree.addContent(div); - } - } - - /** - * {@inheritDoc} - */ - public Content getConstantSummaries() { - HtmlTree summariesDiv = new HtmlTree(HtmlTag.DIV); - summariesDiv.addStyle(HtmlStyle.constantValuesContainer); - return summariesDiv; - } - - /** - * {@inheritDoc} - */ - public void addPackageName(String parsedPackageName, Content summariesTree, boolean first) { - Content pkgNameContent; - if (!first && configuration.allowTag(HtmlTag.SECTION)) { - summariesTree.addContent(summaryTree); - } - if (parsedPackageName.length() == 0) { - summariesTree.addContent(getMarkerAnchor( - SectionName.UNNAMED_PACKAGE_ANCHOR)); - pkgNameContent = defaultPackageLabel; - } else { - summariesTree.addContent(getMarkerAnchor( - parsedPackageName)); - pkgNameContent = getPackageLabel(parsedPackageName); - } - Content headingContent = new StringContent(".*"); - Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, - pkgNameContent); - heading.addContent(headingContent); - if (configuration.allowTag(HtmlTag.SECTION)) { - summaryTree = HtmlTree.SECTION(heading); - } else { - summariesTree.addContent(heading); - } - } - - /** - * {@inheritDoc} - */ - public Content getClassConstantHeader() { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - return ul; - } - - /** - * {@inheritDoc} - */ - public void addClassConstant(Content summariesTree, Content classConstantTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - summaryTree.addContent(classConstantTree); - } else { - summariesTree.addContent(classConstantTree); - } - } - - /** - * Get the table caption and header for the constant summary table - * - * @param cd classdoc to be documented - * @return constant members header content - */ - public Content getConstantMembersHeader(ClassDoc cd) { - //generate links backward only to public classes. - Content classlink = (cd.isPublic() || cd.isProtected()) ? - getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CONSTANT_SUMMARY, cd)) : - new StringContent(cd.qualifiedName()); - String name = cd.containingPackage().name(); - if (name.length() > 0) { - Content cb = new ContentBuilder(); - cb.addContent(name); - cb.addContent("."); - cb.addContent(classlink); - return getClassName(cb); - } else { - return getClassName(classlink); - } - } - - /** - * Get the class name in the table caption and the table header. - * - * @param classStr the class name to print. - * @return the table caption and header - */ - protected Content getClassName(Content classStr) { - Content caption = getTableCaption(classStr); - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.constantsSummary, caption) - : HtmlTree.TABLE(HtmlStyle.constantsSummary, constantsTableSummary, caption); - table.addContent(getSummaryTableHeader(constantsTableHeader, "col")); - return table; - } - - /** - * {@inheritDoc} - */ - public void addConstantMembers(ClassDoc cd, List fields, - Content classConstantTree) { - currentClassDoc = cd; - Content tbody = new HtmlTree(HtmlTag.TBODY); - for (int i = 0; i < fields.size(); ++i) { - HtmlTree tr = new HtmlTree(HtmlTag.TR); - if (i%2 == 0) - tr.addStyle(HtmlStyle.altColor); - else - tr.addStyle(HtmlStyle.rowColor); - addConstantMember(fields.get(i), tr); - tbody.addContent(tr); - } - Content table = getConstantMembersHeader(cd); - table.addContent(tbody); - Content li = HtmlTree.LI(HtmlStyle.blockList, table); - classConstantTree.addContent(li); - } - - /** - * Add the row for the constant summary table. - * - * @param member the field to be documented. - * @param trTree an htmltree object for the table row - */ - private void addConstantMember(FieldDoc member, HtmlTree trTree) { - trTree.addContent(getTypeColumn(member)); - trTree.addContent(getNameColumn(member)); - trTree.addContent(getValue(member)); - } - - /** - * Get the type column for the constant summary table row. - * - * @param member the field to be documented. - * @return the type column of the constant table row - */ - private Content getTypeColumn(FieldDoc member) { - Content anchor = getMarkerAnchor(currentClassDoc.qualifiedName() + - "." + member.name()); - Content tdType = HtmlTree.TD(HtmlStyle.colFirst, anchor); - Content code = new HtmlTree(HtmlTag.CODE); - StringTokenizer mods = new StringTokenizer(member.modifiers()); - while(mods.hasMoreTokens()) { - Content modifier = new StringContent(mods.nextToken()); - code.addContent(modifier); - code.addContent(getSpace()); - } - Content type = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.CONSTANT_SUMMARY, member.type())); - code.addContent(type); - tdType.addContent(code); - return tdType; - } - - /** - * Get the name column for the constant summary table row. - * - * @param member the field to be documented. - * @return the name column of the constant table row - */ - private Content getNameColumn(FieldDoc member) { - Content nameContent = getDocLink( - LinkInfoImpl.Kind.CONSTANT_SUMMARY, member, member.name(), false); - Content code = HtmlTree.CODE(nameContent); - return HtmlTree.TD(code); - } - - /** - * Get the value column for the constant summary table row. - * - * @param member the field to be documented. - * @return the value column of the constant table row - */ - private Content getValue(FieldDoc member) { - Content valueContent = new StringContent(member.constantValueExpression()); - Content code = HtmlTree.CODE(valueContent); - return HtmlTree.TD(HtmlStyle.colLast, code); - } - - /** - * {@inheritDoc} - */ - public void addConstantSummaries(Content contentTree, Content summariesTree) { - if (configuration.allowTag(HtmlTag.SECTION) && summaryTree != null) { - summariesTree.addContent(summaryTree); - } - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(summariesTree); - contentTree.addContent(mainTree); - } else { - contentTree.addContent(summariesTree); - } - } - - /** - * {@inheritDoc} - */ - public void addFooter(Content contentTree) { - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : contentTree; - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - contentTree.addContent(htmlTree); - } - } - - /** - * {@inheritDoc} - */ - public void printDocument(Content contentTree) throws IOException { - printHtmlDocument(null, true, contentTree); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Writes constructor documentation. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert Field - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class ConstructorWriterImpl extends AbstractExecutableMemberWriter - implements ConstructorWriter, MemberSummaryWriter { - - private boolean foundNonPubConstructor = false; - - /** - * Construct a new ConstructorWriterImpl. - * - * @param writer The writer for the class that the constructors belong to. - * @param classDoc the class being documented. - */ - public ConstructorWriterImpl(SubWriterHolderWriter writer, - ClassDoc classDoc) { - super(writer, classDoc); - VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc, - VisibleMemberMap.CONSTRUCTORS, configuration); - List constructors = new ArrayList<>(visibleMemberMap.getMembersFor(classDoc)); - for (ProgramElementDoc constructor : constructors) { - if (constructor.isProtected() || constructor.isPrivate()) { - setFoundNonPubConstructor(true); - } - } - } - - /** - * Construct a new ConstructorWriterImpl. - * - * @param writer The writer for the class that the constructors belong to. - */ - public ConstructorWriterImpl(SubWriterHolderWriter writer) { - super(writer); - } - - /** - * {@inheritDoc} - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree) { - memberSummaryTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_SUMMARY); - Content memberTree = writer.getMemberTreeHeader(); - writer.addSummaryHeader(this, classDoc, memberTree); - return memberTree; - } - - /** - * {@inheritDoc} - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - writer.addMemberTree(memberSummaryTree, memberTree); - } - - /** - * {@inheritDoc} - */ - public Content getConstructorDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree) { - memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS); - Content constructorDetailsTree = writer.getMemberTreeHeader(); - constructorDetailsTree.addContent(writer.getMarkerAnchor( - SectionName.CONSTRUCTOR_DETAIL)); - Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, - writer.constructorDetailsLabel); - constructorDetailsTree.addContent(heading); - return constructorDetailsTree; - } - - /** - * {@inheritDoc} - */ - public Content getConstructorDocTreeHeader(ConstructorDoc constructor, - Content constructorDetailsTree) { - String erasureAnchor; - if ((erasureAnchor = getErasureAnchor(constructor)) != null) { - constructorDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor))); - } - constructorDetailsTree.addContent( - writer.getMarkerAnchor(writer.getAnchor(constructor))); - Content constructorDocTree = writer.getMemberTreeHeader(); - Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); - heading.addContent(constructor.name()); - constructorDocTree.addContent(heading); - return constructorDocTree; - } - - /** - * {@inheritDoc} - */ - public Content getSignature(ConstructorDoc constructor) { - Content pre = new HtmlTree(HtmlTag.PRE); - writer.addAnnotationInfo(constructor, pre); - int annotationLength = pre.charCount(); - addModifiers(constructor, pre); - if (configuration.linksource) { - Content constructorName = new StringContent(constructor.name()); - writer.addSrcLink(constructor, constructorName, pre); - } else { - addName(constructor.name(), pre); - } - int indent = pre.charCount() - annotationLength; - addParameters(constructor, pre, indent); - addExceptions(constructor, pre, indent); - return pre; - } - - /** - * {@inheritDoc} - */ - @Override - public void setSummaryColumnStyle(HtmlTree tdTree) { - if (foundNonPubConstructor) - tdTree.addStyle(HtmlStyle.colLast); - else - tdTree.addStyle(HtmlStyle.colOne); - } - - /** - * {@inheritDoc} - */ - public void addDeprecated(ConstructorDoc constructor, Content constructorDocTree) { - addDeprecatedInfo(constructor, constructorDocTree); - } - - /** - * {@inheritDoc} - */ - public void addComments(ConstructorDoc constructor, Content constructorDocTree) { - addComment(constructor, constructorDocTree); - } - - /** - * {@inheritDoc} - */ - public void addTags(ConstructorDoc constructor, Content constructorDocTree) { - writer.addTagsInfo(constructor, constructorDocTree); - } - - /** - * {@inheritDoc} - */ - public Content getConstructorDetails(Content constructorDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(constructorDetailsTree)); - return htmlTree; - } - return getMemberTree(constructorDetailsTree); - } - - /** - * {@inheritDoc} - */ - public Content getConstructorDoc(Content constructorDocTree, - boolean isLastContent) { - return getMemberTree(constructorDocTree, isLastContent); - } - - /** - * Close the writer. - */ - public void close() throws IOException { - writer.close(); - } - - /** - * Let the writer know whether a non public constructor was found. - * - * @param foundNonPubConstructor true if we found a non public constructor. - */ - public void setFoundNonPubConstructor(boolean foundNonPubConstructor) { - this.foundNonPubConstructor = foundNonPubConstructor; - } - - /** - * {@inheritDoc} - */ - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - writer.getResource("doclet.Constructor_Summary")); - memberTree.addContent(label); - } - - /** - * {@inheritDoc} - */ - public String getTableSummary() { - return configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Constructor_Summary"), - configuration.getText("doclet.constructors")); - } - - /** - * {@inheritDoc} - */ - public Content getCaption() { - return configuration.getResource("doclet.Constructors"); - } - - /** - * {@inheritDoc} - */ - public String[] getSummaryTableHeader(ProgramElementDoc member) { - String[] header; - if (foundNonPubConstructor) { - header = new String[] { - configuration.getText("doclet.Modifier"), - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Constructor"), - configuration.getText("doclet.Description")) - }; - } - else { - header = new String[] { - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Constructor"), - configuration.getText("doclet.Description")) - }; - } - return header; - } - - /** - * {@inheritDoc} - */ - public void addSummaryAnchor(ClassDoc cd, Content memberTree) { - memberTree.addContent(writer.getMarkerAnchor( - SectionName.CONSTRUCTOR_SUMMARY)); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { - } - - public int getMemberKind() { - return VisibleMemberMap.CONSTRUCTORS; - } - - /** - * {@inheritDoc} - */ - protected Content getNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - return writer.getHyperLink(SectionName.CONSTRUCTOR_SUMMARY, - writer.getResource("doclet.navConstructor")); - } else { - return writer.getResource("doclet.navConstructor"); - } - } - - /** - * {@inheritDoc} - */ - protected void addNavDetailLink(boolean link, Content liNav) { - if (link) { - liNav.addContent(writer.getHyperLink( - SectionName.CONSTRUCTOR_DETAIL, - writer.getResource("doclet.navConstructor"))); - } else { - liNav.addContent(writer.getResource("doclet.navConstructor")); - } - } - - /** - * {@inheritDoc} - */ - protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { - if (foundNonPubConstructor) { - Content code = new HtmlTree(HtmlTag.CODE); - if (member.isProtected()) { - code.addContent("protected "); - } else if (member.isPrivate()) { - code.addContent("private "); - } else if (member.isPublic()) { - code.addContent(writer.getSpace()); - } else { - code.addContent( - configuration.getText("doclet.Package_private")); - } - tdSummaryType.addContent(code); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate File to list all the deprecated classes and class members with the - * appropriate links. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @see java.util.List - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class DeprecatedListWriter extends SubWriterHolderWriter { - - private static final String[] ANCHORS = new String[] { - "package", "interface", "class", "enum", "exception", "error", - "annotation.type", "field", "method", "constructor", "enum.constant", - "annotation.type.member" - }; - - private static final String[] HEADING_KEYS = new String[] { - "doclet.Deprecated_Packages", "doclet.Deprecated_Interfaces", - "doclet.Deprecated_Classes", "doclet.Deprecated_Enums", - "doclet.Deprecated_Exceptions", "doclet.Deprecated_Errors", - "doclet.Deprecated_Annotation_Types", - "doclet.Deprecated_Fields", - "doclet.Deprecated_Methods", "doclet.Deprecated_Constructors", - "doclet.Deprecated_Enum_Constants", - "doclet.Deprecated_Annotation_Type_Members" - }; - - private static final String[] SUMMARY_KEYS = new String[] { - "doclet.deprecated_packages", "doclet.deprecated_interfaces", - "doclet.deprecated_classes", "doclet.deprecated_enums", - "doclet.deprecated_exceptions", "doclet.deprecated_errors", - "doclet.deprecated_annotation_types", - "doclet.deprecated_fields", - "doclet.deprecated_methods", "doclet.deprecated_constructors", - "doclet.deprecated_enum_constants", - "doclet.deprecated_annotation_type_members" - }; - - private static final String[] HEADER_KEYS = new String[] { - "doclet.Package", "doclet.Interface", "doclet.Class", - "doclet.Enum", "doclet.Exceptions", - "doclet.Errors", - "doclet.AnnotationType", - "doclet.Field", - "doclet.Method", "doclet.Constructor", - "doclet.Enum_Constant", - "doclet.Annotation_Type_Member" - }; - - private AbstractMemberWriter[] writers; - - private ConfigurationImpl configuration; - - /** - * Constructor. - * - * @param filename the file to be generated. - */ - public DeprecatedListWriter(ConfigurationImpl configuration, - DocPath filename) throws IOException { - super(configuration, filename); - this.configuration = configuration; - NestedClassWriterImpl classW = new NestedClassWriterImpl(this); - writers = new AbstractMemberWriter[] - {classW, classW, classW, classW, classW, classW, - new FieldWriterImpl(this), - new MethodWriterImpl(this), - new ConstructorWriterImpl(this), - new EnumConstantWriterImpl(this), - new AnnotationTypeOptionalMemberWriterImpl(this, null)}; - } - - /** - * Get list of all the deprecated classes and members in all the Packages - * specified on the Command Line. - * Then instantiate DeprecatedListWriter and generate File. - * - * @param configuration the current configuration of the doclet. - */ - public static void generate(ConfigurationImpl configuration) { - DocPath filename = DocPaths.DEPRECATED_LIST; - try { - DeprecatedListWriter depr = - new DeprecatedListWriter(configuration, filename); - depr.generateDeprecatedListFile( - new DeprecatedAPIListBuilder(configuration)); - depr.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(exc); - } - } - - /** - * Generate the deprecated API list. - * - * @param deprapi list of deprecated API built already. - */ - protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi) - throws IOException { - HtmlTree body = getHeader(); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN() - : body; - htmlTree.addContent(getContentsList(deprapi)); - String memberTableSummary; - String[] memberTableHeader = new String[1]; - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.contentContainer); - for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { - if (deprapi.hasDocumentation(i)) { - addAnchor(deprapi, i, div); - memberTableSummary = - configuration.getText("doclet.Member_Table_Summary", - configuration.getText(HEADING_KEYS[i]), - configuration.getText(SUMMARY_KEYS[i])); - memberTableHeader[0] = configuration.getText("doclet.0_and_1", - configuration.getText(HEADER_KEYS[i]), - configuration.getText("doclet.Description")); - // DeprecatedAPIListBuilder.PACKAGE == 0, so if i == 0, it is - // a PackageDoc. - if (i == DeprecatedAPIListBuilder.PACKAGE) - addPackageDeprecatedAPI(deprapi.getList(i), - HEADING_KEYS[i], memberTableSummary, memberTableHeader, div); - else - writers[i - 1].addDeprecatedAPI(deprapi.getList(i), - HEADING_KEYS[i], memberTableSummary, memberTableHeader, div); - } - } - if (configuration.allowTag(HtmlTag.MAIN)) { - htmlTree.addContent(div); - body.addContent(htmlTree); - } else { - body.addContent(div); - } - htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : body; - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } - printHtmlDocument(null, true, body); - } - - /** - * Add the index link. - * - * @param builder the deprecated list builder - * @param type the type of list being documented - * @param contentTree the content tree to which the index link will be added - */ - private void addIndexLink(DeprecatedAPIListBuilder builder, - int type, Content contentTree) { - if (builder.hasDocumentation(type)) { - Content li = HtmlTree.LI(getHyperLink(ANCHORS[type], - getResource(HEADING_KEYS[type]))); - contentTree.addContent(li); - } - } - - /** - * Get the contents list. - * - * @param deprapi the deprecated list builder - * @return a content tree for the contents list - */ - public Content getContentsList(DeprecatedAPIListBuilder deprapi) { - Content headContent = getResource("doclet.Deprecated_API"); - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, - HtmlStyle.title, headContent); - Content div = HtmlTree.DIV(HtmlStyle.header, heading); - Content headingContent = getResource("doclet.Contents"); - div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true, - headingContent)); - Content ul = new HtmlTree(HtmlTag.UL); - for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { - addIndexLink(deprapi, i, ul); - } - div.addContent(ul); - return div; - } - - /** - * Add the anchor. - * - * @param builder the deprecated list builder - * @param type the type of list being documented - * @param htmlTree the content tree to which the anchor will be added - */ - private void addAnchor(DeprecatedAPIListBuilder builder, int type, Content htmlTree) { - if (builder.hasDocumentation(type)) { - htmlTree.addContent(getMarkerAnchor(ANCHORS[type])); - } - } - - /** - * Get the header for the deprecated API Listing. - * - * @return a content tree for the header - */ - public HtmlTree getHeader() { - String title = configuration.getText("doclet.Window_Deprecated_List"); - HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - return bodyTree; - } - - /** - * Get the deprecated label. - * - * @return a content tree for the deprecated label - */ - protected Content getNavLinkDeprecated() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, deprecatedLabel); - return li; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Writes enum constant documentation in HTML format. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class EnumConstantWriterImpl extends AbstractMemberWriter - implements EnumConstantWriter, MemberSummaryWriter { - - public EnumConstantWriterImpl(SubWriterHolderWriter writer, - ClassDoc classdoc) { - super(writer, classdoc); - } - - public EnumConstantWriterImpl(SubWriterHolderWriter writer) { - super(writer); - } - - /** - * {@inheritDoc} - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree) { - memberSummaryTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_SUMMARY); - Content memberTree = writer.getMemberTreeHeader(); - writer.addSummaryHeader(this, classDoc, memberTree); - return memberTree; - } - - /** - * {@inheritDoc} - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - writer.addMemberTree(memberSummaryTree, memberTree); - } - - /** - * {@inheritDoc} - */ - public Content getEnumConstantsDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree) { - memberDetailsTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_DETAILS); - Content enumConstantsDetailsTree = writer.getMemberTreeHeader(); - enumConstantsDetailsTree.addContent(writer.getMarkerAnchor( - SectionName.ENUM_CONSTANT_DETAIL)); - Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, - writer.enumConstantsDetailsLabel); - enumConstantsDetailsTree.addContent(heading); - return enumConstantsDetailsTree; - } - - /** - * {@inheritDoc} - */ - public Content getEnumConstantsTreeHeader(FieldDoc enumConstant, - Content enumConstantsDetailsTree) { - enumConstantsDetailsTree.addContent( - writer.getMarkerAnchor(enumConstant.name())); - Content enumConstantsTree = writer.getMemberTreeHeader(); - Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); - heading.addContent(enumConstant.name()); - enumConstantsTree.addContent(heading); - return enumConstantsTree; - } - - /** - * {@inheritDoc} - */ - public Content getSignature(FieldDoc enumConstant) { - Content pre = new HtmlTree(HtmlTag.PRE); - writer.addAnnotationInfo(enumConstant, pre); - addModifiers(enumConstant, pre); - Content enumConstantLink = writer.getLink(new LinkInfoImpl( - configuration, LinkInfoImpl.Kind.MEMBER, enumConstant.type())); - pre.addContent(enumConstantLink); - pre.addContent(" "); - if (configuration.linksource) { - Content enumConstantName = new StringContent(enumConstant.name()); - writer.addSrcLink(enumConstant, enumConstantName, pre); - } else { - addName(enumConstant.name(), pre); - } - return pre; - } - - /** - * {@inheritDoc} - */ - public void addDeprecated(FieldDoc enumConstant, Content enumConstantsTree) { - addDeprecatedInfo(enumConstant, enumConstantsTree); - } - - /** - * {@inheritDoc} - */ - public void addComments(FieldDoc enumConstant, Content enumConstantsTree) { - addComment(enumConstant, enumConstantsTree); - } - - /** - * {@inheritDoc} - */ - public void addTags(FieldDoc enumConstant, Content enumConstantsTree) { - writer.addTagsInfo(enumConstant, enumConstantsTree); - } - - /** - * {@inheritDoc} - */ - public Content getEnumConstantsDetails(Content enumConstantsDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(enumConstantsDetailsTree)); - return htmlTree; - } - return getMemberTree(enumConstantsDetailsTree); - } - - /** - * {@inheritDoc} - */ - public Content getEnumConstants(Content enumConstantsTree, - boolean isLastContent) { - return getMemberTree(enumConstantsTree, isLastContent); - } - - /** - * {@inheritDoc} - */ - public void close() throws IOException { - writer.close(); - } - - public int getMemberKind() { - return VisibleMemberMap.ENUM_CONSTANTS; - } - - /** - * {@inheritDoc} - */ - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - writer.getResource("doclet.Enum_Constant_Summary")); - memberTree.addContent(label); - } - - /** - * {@inheritDoc} - */ - public String getTableSummary() { - return configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Enum_Constant_Summary"), - configuration.getText("doclet.enum_constants")); - } - - /** - * {@inheritDoc} - */ - public Content getCaption() { - return configuration.getResource("doclet.Enum_Constants"); - } - - /** - * {@inheritDoc} - */ - public String[] getSummaryTableHeader(ProgramElementDoc member) { - String[] header = new String[] { - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Enum_Constant"), - configuration.getText("doclet.Description")) - }; - return header; - } - - /** - * {@inheritDoc} - */ - public void addSummaryAnchor(ClassDoc cd, Content memberTree) { - memberTree.addContent(writer.getMarkerAnchor( - SectionName.ENUM_CONSTANT_SUMMARY)); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { - } - - /** - * {@inheritDoc} - */ - protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member, - Content tdSummary) { - Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, - writer.getDocLink(context, (MemberDoc) member, member.name(), false)); - Content code = HtmlTree.CODE(memberLink); - tdSummary.addContent(code); - } - - /** - * {@inheritDoc} - */ - @Override - public void setSummaryColumnStyle(HtmlTree tdTree) { - tdTree.addStyle(HtmlStyle.colOne); - } - - /** - * {@inheritDoc} - */ - protected void addInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member, Content linksTree) { - } - - /** - * {@inheritDoc} - */ - protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { - //Not applicable. - } - - /** - * {@inheritDoc} - */ - protected Content getDeprecatedLink(ProgramElementDoc member) { - return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, - (MemberDoc) member, ((FieldDoc)member).qualifiedName()); - } - - /** - * {@inheritDoc} - */ - protected Content getNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - if (cd == null) { - return writer.getHyperLink(SectionName.ENUM_CONSTANT_SUMMARY, - writer.getResource("doclet.navEnum")); - } else { - return writer.getHyperLink( - SectionName.ENUM_CONSTANTS_INHERITANCE, - configuration.getClassName(cd), writer.getResource("doclet.navEnum")); - } - } else { - return writer.getResource("doclet.navEnum"); - } - } - - /** - * {@inheritDoc} - */ - protected void addNavDetailLink(boolean link, Content liNav) { - if (link) { - liNav.addContent(writer.getHyperLink( - SectionName.ENUM_CONSTANT_DETAIL, - writer.getResource("doclet.navEnum"))); - } else { - liNav.addContent(writer.getResource("doclet.navEnum")); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Writes field documentation in HTML format. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert Field - * @author Atul M Dambalkar - * @author Jamie Ho (rewrite) - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class FieldWriterImpl extends AbstractMemberWriter - implements FieldWriter, MemberSummaryWriter { - - public FieldWriterImpl(SubWriterHolderWriter writer, ClassDoc classdoc) { - super(writer, classdoc); - } - - public FieldWriterImpl(SubWriterHolderWriter writer) { - super(writer); - } - - /** - * {@inheritDoc} - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree) { - memberSummaryTree.addContent(HtmlConstants.START_OF_FIELD_SUMMARY); - Content memberTree = writer.getMemberTreeHeader(); - writer.addSummaryHeader(this, classDoc, memberTree); - return memberTree; - } - - /** - * {@inheritDoc} - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - writer.addMemberTree(memberSummaryTree, memberTree); - } - - /** - * {@inheritDoc} - */ - public Content getFieldDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree) { - memberDetailsTree.addContent(HtmlConstants.START_OF_FIELD_DETAILS); - Content fieldDetailsTree = writer.getMemberTreeHeader(); - fieldDetailsTree.addContent(writer.getMarkerAnchor( - SectionName.FIELD_DETAIL)); - Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, - writer.fieldDetailsLabel); - fieldDetailsTree.addContent(heading); - return fieldDetailsTree; - } - - /** - * {@inheritDoc} - */ - public Content getFieldDocTreeHeader(FieldDoc field, - Content fieldDetailsTree) { - fieldDetailsTree.addContent( - writer.getMarkerAnchor(field.name())); - Content fieldDocTree = writer.getMemberTreeHeader(); - Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); - heading.addContent(field.name()); - fieldDocTree.addContent(heading); - return fieldDocTree; - } - - /** - * {@inheritDoc} - */ - public Content getSignature(FieldDoc field) { - Content pre = new HtmlTree(HtmlTag.PRE); - writer.addAnnotationInfo(field, pre); - addModifiers(field, pre); - Content fieldlink = writer.getLink(new LinkInfoImpl( - configuration, LinkInfoImpl.Kind.MEMBER, field.type())); - pre.addContent(fieldlink); - pre.addContent(" "); - if (configuration.linksource) { - Content fieldName = new StringContent(field.name()); - writer.addSrcLink(field, fieldName, pre); - } else { - addName(field.name(), pre); - } - return pre; - } - - /** - * {@inheritDoc} - */ - public void addDeprecated(FieldDoc field, Content fieldDocTree) { - addDeprecatedInfo(field, fieldDocTree); - } - - /** - * {@inheritDoc} - */ - public void addComments(FieldDoc field, Content fieldDocTree) { - ClassDoc holder = field.containingClass(); - if (field.inlineTags().length > 0) { - if (holder.equals(classdoc) || - (! (holder.isPublic() || utils.isLinkable(holder, configuration)))) { - writer.addInlineComment(field, fieldDocTree); - } else { - Content link = - writer.getDocLink(LinkInfoImpl.Kind.FIELD_DOC_COPY, - holder, field, - holder.isIncluded() ? - holder.typeName() : holder.qualifiedTypeName(), - false); - Content codeLink = HtmlTree.CODE(link); - Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.isClass()? - writer.descfrmClassLabel : writer.descfrmInterfaceLabel); - descfrmLabel.addContent(writer.getSpace()); - descfrmLabel.addContent(codeLink); - fieldDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); - writer.addInlineComment(field, fieldDocTree); - } - } - } - - /** - * {@inheritDoc} - */ - public void addTags(FieldDoc field, Content fieldDocTree) { - writer.addTagsInfo(field, fieldDocTree); - } - - /** - * {@inheritDoc} - */ - public Content getFieldDetails(Content fieldDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(fieldDetailsTree)); - return htmlTree; - } - return getMemberTree(fieldDetailsTree); - } - - /** - * {@inheritDoc} - */ - public Content getFieldDoc(Content fieldDocTree, - boolean isLastContent) { - return getMemberTree(fieldDocTree, isLastContent); - } - - /** - * Close the writer. - */ - public void close() throws IOException { - writer.close(); - } - - public int getMemberKind() { - return VisibleMemberMap.FIELDS; - } - - /** - * {@inheritDoc} - */ - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - writer.getResource("doclet.Field_Summary")); - memberTree.addContent(label); - } - - /** - * {@inheritDoc} - */ - public String getTableSummary() { - return configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Field_Summary"), - configuration.getText("doclet.fields")); - } - - /** - * {@inheritDoc} - */ - public Content getCaption() { - return configuration.getResource("doclet.Fields"); - } - - /** - * {@inheritDoc} - */ - public String[] getSummaryTableHeader(ProgramElementDoc member) { - String[] header = new String[] { - writer.getModifierTypeHeader(), - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Field"), - configuration.getText("doclet.Description")) - }; - return header; - } - - /** - * {@inheritDoc} - */ - public void addSummaryAnchor(ClassDoc cd, Content memberTree) { - memberTree.addContent(writer.getMarkerAnchor( - SectionName.FIELD_SUMMARY)); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { - inheritedTree.addContent(writer.getMarkerAnchor( - SectionName.FIELDS_INHERITANCE, configuration.getClassName(cd))); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { - Content classLink = writer.getPreQualifiedClassLink( - LinkInfoImpl.Kind.MEMBER, cd, false); - Content label = new StringContent(cd.isClass() ? - configuration.getText("doclet.Fields_Inherited_From_Class") : - configuration.getText("doclet.Fields_Inherited_From_Interface")); - Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, - label); - labelHeading.addContent(writer.getSpace()); - labelHeading.addContent(classLink); - inheritedTree.addContent(labelHeading); - } - - /** - * {@inheritDoc} - */ - protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member, - Content tdSummary) { - Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, - writer.getDocLink(context, cd , (MemberDoc) member, member.name(), false)); - Content code = HtmlTree.CODE(memberLink); - tdSummary.addContent(code); - } - - /** - * {@inheritDoc} - */ - protected void addInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member, Content linksTree) { - linksTree.addContent( - writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc)member, - member.name(), false)); - } - - /** - * {@inheritDoc} - */ - protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { - FieldDoc field = (FieldDoc)member; - addModifierAndType(field, field.type(), tdSummaryType); - } - - /** - * {@inheritDoc} - */ - protected Content getDeprecatedLink(ProgramElementDoc member) { - return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, - (MemberDoc) member, ((FieldDoc)member).qualifiedName()); - } - - /** - * {@inheritDoc} - */ - protected Content getNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - if (cd == null) { - return writer.getHyperLink( - SectionName.FIELD_SUMMARY, - writer.getResource("doclet.navField")); - } else { - return writer.getHyperLink( - SectionName.FIELDS_INHERITANCE, - configuration.getClassName(cd), writer.getResource("doclet.navField")); - } - } else { - return writer.getResource("doclet.navField"); - } - } - - /** - * {@inheritDoc} - */ - protected void addNavDetailLink(boolean link, Content liNav) { - if (link) { - liNav.addContent(writer.getHyperLink( - SectionName.FIELD_DETAIL, - writer.getResource("doclet.navField"))); - } else { - liNav.addContent(writer.getResource("doclet.navField")); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate the documentation in the Html "frame" format in the browser. The - * generated documentation will have two or three frames depending upon the - * number of packages on the command line. In general there will be three frames - * in the output, a left-hand top frame will have a list of all packages with - * links to target left-hand bottom frame. The left-hand bottom frame will have - * the particular package contents or the all-classes list, where as the single - * right-hand frame will have overview or package summary or class file. Also - * take care of browsers which do not support Html frames. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - */ -@Deprecated -public class FrameOutputWriter extends HtmlDocletWriter { - - /** - * Number of packages specified on the command line. - */ - int noOfPackages; - - /** - * Constructor to construct FrameOutputWriter object. - * - * @param filename File to be generated. - */ - public FrameOutputWriter(ConfigurationImpl configuration, - DocPath filename) throws IOException { - super(configuration, filename); - noOfPackages = configuration.packages.size(); - } - - /** - * Construct FrameOutputWriter object and then use it to generate the Html - * file which will have the description of all the frames in the - * documentation. The name of the generated file is "index.html" which is - * the default first file for Html documents. - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration) { - FrameOutputWriter framegen; - DocPath filename = DocPath.empty; - try { - filename = DocPaths.INDEX; - framegen = new FrameOutputWriter(configuration, filename); - framegen.generateFrameFile(); - framegen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(exc); - } - } - - /** - * Generate the constants in the "index.html" file. Print the frame details - * as well as warning if browser is not supporting the Html frames. - */ - protected void generateFrameFile() throws IOException { - Content frame = getFrameDetails(); - HtmlTree body = new HtmlTree(HtmlTag.BODY); - body.addAttr(HtmlAttr.ONLOAD, "loadFrames()"); - if (configuration.allowTag(HtmlTag.MAIN)) { - HtmlTree main = HtmlTree.MAIN(frame); - body.addContent(main); - } else { - body.addContent(frame); - } - if (configuration.windowtitle.length() > 0) { - printFramesDocument(configuration.windowtitle, configuration, - body); - } else { - printFramesDocument(configuration.getText("doclet.Generated_Docs_Untitled"), - configuration, body); - } - } - - /** - * Get the frame sizes and their contents. - * - * @return a content tree for the frame details - */ - protected Content getFrameDetails() { - HtmlTree leftContainerDiv = new HtmlTree(HtmlTag.DIV); - HtmlTree rightContainerDiv = new HtmlTree(HtmlTag.DIV); - leftContainerDiv.addStyle(HtmlStyle.leftContainer); - rightContainerDiv.addStyle(HtmlStyle.rightContainer); - if (noOfPackages <= 1) { - addAllClassesFrameTag(leftContainerDiv); - } else if (noOfPackages > 1) { - addAllPackagesFrameTag(leftContainerDiv); - addAllClassesFrameTag(leftContainerDiv); - } - addClassFrameTag(rightContainerDiv); - HtmlTree mainContainer = HtmlTree.DIV(HtmlStyle.mainContainer, leftContainerDiv); - mainContainer.addContent(rightContainerDiv); - return mainContainer; - } - - /** - * Add the IFRAME tag for the frame that lists all packages. - * - * @param contentTree the content tree to which the information will be added - */ - private void addAllPackagesFrameTag(Content contentTree) { - HtmlTree frame = HtmlTree.IFRAME(DocPaths.OVERVIEW_FRAME.getPath(), - "packageListFrame", configuration.getText("doclet.All_Packages")); - HtmlTree leftTop = HtmlTree.DIV(HtmlStyle.leftTop, frame); - contentTree.addContent(leftTop); - } - - /** - * Add the IFRAME tag for the frame that lists all classes. - * - * @param contentTree the content tree to which the information will be added - */ - private void addAllClassesFrameTag(Content contentTree) { - HtmlTree frame = HtmlTree.IFRAME(DocPaths.ALLCLASSES_FRAME.getPath(), - "packageFrame", configuration.getText("doclet.All_classes_and_interfaces")); - HtmlTree leftBottom = HtmlTree.DIV(HtmlStyle.leftBottom, frame); - contentTree.addContent(leftBottom); - } - - /** - * Add the IFRAME tag for the frame that describes the class in detail. - * - * @param contentTree the content tree to which the information will be added - */ - private void addClassFrameTag(Content contentTree) { - HtmlTree frame = HtmlTree.IFRAME(configuration.topFile.getPath(), "classFrame", - configuration.getText("doclet.Package_class_and_interface_descriptions")); - frame.addStyle(HtmlStyle.rightIframe); - contentTree.addContent(frame); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate the Help File for the generated API documentation. The help file - * contents are helpful for browsing the generated documentation. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - */ -@Deprecated -public class HelpWriter extends HtmlDocletWriter { - - HtmlTree mainTree = HtmlTree.MAIN(); - - /** - * Constructor to construct HelpWriter object. - * @param filename File to be generated. - */ - public HelpWriter(ConfigurationImpl configuration, - DocPath filename) throws IOException { - super(configuration, filename); - } - - /** - * Construct the HelpWriter object and then use it to generate the help - * file. The name of the generated file is "help-doc.html". The help file - * will get generated if and only if "-helpfile" and "-nohelp" is not used - * on the command line. - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration) { - HelpWriter helpgen; - DocPath filename = DocPath.empty; - try { - filename = DocPaths.HELP_DOC; - helpgen = new HelpWriter(configuration, filename); - helpgen.generateHelpFile(); - helpgen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(exc); - } - } - - /** - * Generate the help file contents. - */ - protected void generateHelpFile() throws IOException { - String title = configuration.getText("doclet.Window_Help_title"); - HtmlTree body = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : body; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - body.addContent(htmlTree); - } - addHelpFileContents(body); - if (configuration.allowTag(HtmlTag.FOOTER)) { - htmlTree = HtmlTree.FOOTER(); - } - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } - printHtmlDocument(null, true, body); - } - - /** - * Add the help file contents from the resource file to the content tree. While adding the - * help file contents it also keeps track of user options. If "-notree" - * is used, then the "overview-tree.html" will not get added and hence - * help information also will not get added. - * - * @param contentTree the content tree to which the help file contents will be added - */ - protected void addHelpFileContents(Content contentTree) { - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title, - getResource("doclet.Help_line_1")); - Content div = HtmlTree.DIV(HtmlStyle.header, heading); - Content line2 = HtmlTree.DIV(HtmlStyle.subTitle, - getResource("doclet.Help_line_2")); - div.addContent(line2); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - contentTree.addContent(div); - } - HtmlTree htmlTree; - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - if (configuration.createoverview) { - Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Overview")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(overviewHeading) - : HtmlTree.LI(HtmlStyle.blockList, overviewHeading); - Content line3 = getResource("doclet.Help_line_3", - getHyperLink(DocPaths.OVERVIEW_SUMMARY, - configuration.getText("doclet.Overview"))); - Content overviewPara = HtmlTree.P(line3); - htmlTree.addContent(overviewPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - } - Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Package")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(packageHead) - : HtmlTree.LI(HtmlStyle.blockList, packageHead); - Content line4 = getResource("doclet.Help_line_4"); - Content packagePara = HtmlTree.P(line4); - htmlTree.addContent(packagePara); - HtmlTree ulPackage = new HtmlTree(HtmlTag.UL); - ulPackage.addContent(HtmlTree.LI( - getResource("doclet.Interfaces_Italic"))); - ulPackage.addContent(HtmlTree.LI( - getResource("doclet.Classes"))); - ulPackage.addContent(HtmlTree.LI( - getResource("doclet.Enums"))); - ulPackage.addContent(HtmlTree.LI( - getResource("doclet.Exceptions"))); - ulPackage.addContent(HtmlTree.LI( - getResource("doclet.Errors"))); - ulPackage.addContent(HtmlTree.LI( - getResource("doclet.AnnotationTypes"))); - htmlTree.addContent(ulPackage); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Help_line_5")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(classHead) - : HtmlTree.LI(HtmlStyle.blockList, classHead); - Content line6 = getResource("doclet.Help_line_6"); - Content classPara = HtmlTree.P(line6); - htmlTree.addContent(classPara); - HtmlTree ul1 = new HtmlTree(HtmlTag.UL); - ul1.addContent(HtmlTree.LI( - getResource("doclet.Help_line_7"))); - ul1.addContent(HtmlTree.LI( - getResource("doclet.Help_line_8"))); - ul1.addContent(HtmlTree.LI( - getResource("doclet.Help_line_9"))); - ul1.addContent(HtmlTree.LI( - getResource("doclet.Help_line_10"))); - ul1.addContent(HtmlTree.LI( - getResource("doclet.Help_line_11"))); - ul1.addContent(HtmlTree.LI( - getResource("doclet.Help_line_12"))); - htmlTree.addContent(ul1); - HtmlTree ul2 = new HtmlTree(HtmlTag.UL); - ul2.addContent(HtmlTree.LI( - getResource("doclet.Nested_Class_Summary"))); - ul2.addContent(HtmlTree.LI( - getResource("doclet.Field_Summary"))); - ul2.addContent(HtmlTree.LI( - getResource("doclet.Constructor_Summary"))); - ul2.addContent(HtmlTree.LI( - getResource("doclet.Method_Summary"))); - htmlTree.addContent(ul2); - HtmlTree ul3 = new HtmlTree(HtmlTag.UL); - ul3.addContent(HtmlTree.LI( - getResource("doclet.Field_Detail"))); - ul3.addContent(HtmlTree.LI( - getResource("doclet.Constructor_Detail"))); - ul3.addContent(HtmlTree.LI( - getResource("doclet.Method_Detail"))); - htmlTree.addContent(ul3); - Content line13 = getResource("doclet.Help_line_13"); - Content para = HtmlTree.P(line13); - htmlTree.addContent(para); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - //Annotation Types - Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.AnnotationType")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(aHead) - : HtmlTree.LI(HtmlStyle.blockList, aHead); - Content aline1 = getResource("doclet.Help_annotation_type_line_1"); - Content aPara = HtmlTree.P(aline1); - htmlTree.addContent(aPara); - HtmlTree aul = new HtmlTree(HtmlTag.UL); - aul.addContent(HtmlTree.LI( - getResource("doclet.Help_annotation_type_line_2"))); - aul.addContent(HtmlTree.LI( - getResource("doclet.Help_annotation_type_line_3"))); - aul.addContent(HtmlTree.LI( - getResource("doclet.Annotation_Type_Required_Member_Summary"))); - aul.addContent(HtmlTree.LI( - getResource("doclet.Annotation_Type_Optional_Member_Summary"))); - aul.addContent(HtmlTree.LI( - getResource("doclet.Annotation_Type_Member_Detail"))); - htmlTree.addContent(aul); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - //Enums - Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Enum")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(enumHead) - : HtmlTree.LI(HtmlStyle.blockList, enumHead); - Content eline1 = getResource("doclet.Help_enum_line_1"); - Content enumPara = HtmlTree.P(eline1); - htmlTree.addContent(enumPara); - HtmlTree eul = new HtmlTree(HtmlTag.UL); - eul.addContent(HtmlTree.LI( - getResource("doclet.Help_enum_line_2"))); - eul.addContent(HtmlTree.LI( - getResource("doclet.Help_enum_line_3"))); - eul.addContent(HtmlTree.LI( - getResource("doclet.Enum_Constant_Summary"))); - eul.addContent(HtmlTree.LI( - getResource("doclet.Enum_Constant_Detail"))); - htmlTree.addContent(eul); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - if (configuration.classuse) { - Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Help_line_14")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(useHead) - : HtmlTree.LI(HtmlStyle.blockList, useHead); - Content line15 = getResource("doclet.Help_line_15"); - Content usePara = HtmlTree.P(line15); - htmlTree.addContent(usePara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - } - if (configuration.createtree) { - Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Help_line_16")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(treeHead) - : HtmlTree.LI(HtmlStyle.blockList, treeHead); - Content line17 = getResource("doclet.Help_line_17_with_tree_link", - getHyperLink(DocPaths.OVERVIEW_TREE, - configuration.getText("doclet.Class_Hierarchy")), - HtmlTree.CODE(new StringContent("java.lang.Object"))); - Content treePara = HtmlTree.P(line17); - htmlTree.addContent(treePara); - HtmlTree tul = new HtmlTree(HtmlTag.UL); - tul.addContent(HtmlTree.LI( - getResource("doclet.Help_line_18"))); - tul.addContent(HtmlTree.LI( - getResource("doclet.Help_line_19"))); - htmlTree.addContent(tul); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - } - if (!(configuration.nodeprecatedlist || - configuration.nodeprecated)) { - Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Deprecated_API")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(dHead) - : HtmlTree.LI(HtmlStyle.blockList, dHead); - Content line20 = getResource("doclet.Help_line_20_with_deprecated_api_link", - getHyperLink(DocPaths.DEPRECATED_LIST, - configuration.getText("doclet.Deprecated_API"))); - Content dPara = HtmlTree.P(line20); - htmlTree.addContent(dPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - } - if (configuration.createindex) { - Content indexlink; - if (configuration.splitindex) { - indexlink = getHyperLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)), - configuration.getText("doclet.Index")); - } else { - indexlink = getHyperLink(DocPaths.INDEX_ALL, - configuration.getText("doclet.Index")); - } - Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Help_line_21")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(indexHead) - : HtmlTree.LI(HtmlStyle.blockList, indexHead); - Content line22 = getResource("doclet.Help_line_22", indexlink); - Content indexPara = HtmlTree.P(line22); - htmlTree.addContent(indexPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - } - Content prevHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Help_line_23")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(prevHead) - : HtmlTree.LI(HtmlStyle.blockList, prevHead); - Content line24 = getResource("doclet.Help_line_24"); - Content prevPara = HtmlTree.P(line24); - htmlTree.addContent(prevPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Help_line_25")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(frameHead) - : HtmlTree.LI(HtmlStyle.blockList, frameHead); - Content line26 = getResource("doclet.Help_line_26"); - Content framePara = HtmlTree.P(line26); - htmlTree.addContent(framePara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - Content allclassesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.All_Classes")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(allclassesHead) - : HtmlTree.LI(HtmlStyle.blockList, allclassesHead); - Content line27 = getResource("doclet.Help_line_27", - getHyperLink(DocPaths.ALLCLASSES_NOFRAME, - configuration.getText("doclet.All_Classes"))); - Content allclassesPara = HtmlTree.P(line27); - htmlTree.addContent(allclassesPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Serialized_Form")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(sHead) - : HtmlTree.LI(HtmlStyle.blockList, sHead); - Content line28 = getResource("doclet.Help_line_28"); - Content serialPara = HtmlTree.P(line28); - htmlTree.addContent(serialPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - getResource("doclet.Constants_Summary")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(constHead) - : HtmlTree.LI(HtmlStyle.blockList, constHead); - Content line29 = getResource("doclet.Help_line_29", - getHyperLink(DocPaths.CONSTANT_VALUES, - configuration.getText("doclet.Constants_Summary"))); - Content constPara = HtmlTree.P(line29); - htmlTree.addContent(constPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul); - Content line30 = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, getResource("doclet.Help_line_30")); - divContent.addContent(line30); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(divContent); - contentTree.addContent(mainTree); - } else { - contentTree.addContent(divContent); - } - } - - /** - * Get the help label. - * - * @return a content tree for the help label - */ - @Override - protected Content getNavLinkHelp() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, helpLabel); - return li; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.builders.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * The class with "start" method, calls individual Writers. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - * @author Robert Field - * @author Jamie Ho - * - */ -@Deprecated -public class HtmlDoclet extends AbstractDoclet { - // An instance will be created by validOptions, and used by start. - private static HtmlDoclet docletToStart = null; - - public HtmlDoclet() { - configuration = new ConfigurationImpl(); - } - - /** - * The global configuration information for this run. - */ - public final ConfigurationImpl configuration; - - /** - * The "start" method as required by Javadoc. - * - * @param root the root of the documentation tree. - * @see com.sun.javadoc.RootDoc - * @return true if the doclet ran without encountering any errors. - */ - public static boolean start(RootDoc root) { - // In typical use, options will have been set up by calling validOptions, - // which will create an HtmlDoclet for use here. - HtmlDoclet doclet; - if (docletToStart != null) { - doclet = docletToStart; - docletToStart = null; - } else { - doclet = new HtmlDoclet(); - } - return doclet.startDoclet(root); - } - - /** - * Create the configuration instance. - * Override this method to use a different - * configuration. - */ - public Configuration configuration() { - return configuration; - } - - /** - * Start the generation of files. Call generate methods in the individual - * writers, which will in turn genrate the documentation files. Call the - * TreeWriter generation first to ensure the Class Hierarchy is built - * first and then can be used in the later generation. - * - * For new format. - * - * @see com.sun.javadoc.RootDoc - */ - protected void generateOtherFiles(RootDoc root, ClassTree classtree) - throws Exception { - super.generateOtherFiles(root, classtree); - if (configuration.linksource) { - SourceToHTMLConverter.convertRoot(configuration, - root, DocPaths.SOURCE_OUTPUT); - } - - if (configuration.topFile.isEmpty()) { - configuration.standardmessage. - error("doclet.No_Non_Deprecated_Classes_To_Document"); - return; - } - boolean nodeprecated = configuration.nodeprecated; - performCopy(configuration.helpfile); - performCopy(configuration.stylesheetfile); - // do early to reduce memory footprint - if (configuration.classuse) { - ClassUseWriter.generate(configuration, classtree); - } - IndexBuilder indexbuilder = new IndexBuilder(configuration, nodeprecated); - - if (configuration.createtree) { - TreeWriter.generate(configuration, classtree); - } - if (configuration.createindex) { - configuration.buildSearchTagIndex(); - if (configuration.splitindex) { - SplitIndexWriter.generate(configuration, indexbuilder); - } else { - SingleIndexWriter.generate(configuration, indexbuilder); - } - } - - if (!(configuration.nodeprecatedlist || nodeprecated)) { - DeprecatedListWriter.generate(configuration); - } - - AllClassesFrameWriter.generate(configuration, - new IndexBuilder(configuration, nodeprecated, true)); - - FrameOutputWriter.generate(configuration); - - if (configuration.createoverview) { - PackageIndexWriter.generate(configuration); - } - if (configuration.helpfile.length() == 0 && - !configuration.nohelp) { - HelpWriter.generate(configuration); - } - // If a stylesheet file is not specified, copy the default stylesheet - // and replace newline with platform-specific newline. - DocFile f; - if (configuration.stylesheetfile.length() == 0) { - f = DocFile.createFileForOutput(configuration, DocPaths.STYLESHEET); - f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.STYLESHEET), false, true); - } - f = DocFile.createFileForOutput(configuration, DocPaths.JAVASCRIPT); - f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.JAVASCRIPT), true, true); - if (configuration.createindex) { - f = DocFile.createFileForOutput(configuration, DocPaths.SEARCH_JS); - f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.SEARCH_JS), true, true); - f = DocFile.createFileForOutput(configuration, DocPaths.RESOURCES.resolve(DocPaths.GLASS_IMG)); - f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.GLASS_IMG), true, false); - f = DocFile.createFileForOutput(configuration, DocPaths.RESOURCES.resolve(DocPaths.X_IMG)); - f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.X_IMG), true, false); - copyJqueryFiles(); - } - } - - protected void copyJqueryFiles() { - List files = Arrays.asList( - "jquery-1.10.2.js", - "jquery-ui.js", - "jquery-ui.css", - "jquery-ui.min.js", - "jquery-ui.min.css", - "jquery-ui.structure.min.css", - "jquery-ui.structure.css", - "external/jquery/jquery.js", - "jszip/dist/jszip.js", - "jszip/dist/jszip.min.js", - "jszip-utils/dist/jszip-utils.js", - "jszip-utils/dist/jszip-utils.min.js", - "jszip-utils/dist/jszip-utils-ie.js", - "jszip-utils/dist/jszip-utils-ie.min.js", - "images/ui-bg_flat_0_aaaaaa_40x100.png", - "images/ui-icons_454545_256x240.png", - "images/ui-bg_glass_95_fef1ec_1x400.png", - "images/ui-bg_glass_75_dadada_1x400.png", - "images/ui-bg_highlight-soft_75_cccccc_1x100.png", - "images/ui-icons_888888_256x240.png", - "images/ui-icons_2e83ff_256x240.png", - "images/ui-bg_glass_65_ffffff_1x400.png", - "images/ui-icons_cd0a0a_256x240.png", - "images/ui-bg_glass_55_fbf9ee_1x400.png", - "images/ui-icons_222222_256x240.png", - "images/ui-bg_glass_75_e6e6e6_1x400.png", - "images/ui-bg_flat_75_ffffff_40x100.png"); - DocFile f; - for (String file : files) { - DocPath filePath = DocPaths.JQUERY_FILES.resolve(file); - f = DocFile.createFileForOutput(configuration, filePath); - f.copyResource(DocPaths.RESOURCES.resolve(filePath), true, false); - } - } - - /** - * {@inheritDoc} - */ - protected void generateClassFiles(ClassDoc[] arr, ClassTree classtree) { - Arrays.sort(arr); - for(int i = 0; i < arr.length; i++) { - if (!(configuration.isGeneratedDoc(arr[i]) && arr[i].isIncluded())) { - continue; - } - ClassDoc prev = (i == 0)? - null: - arr[i-1]; - ClassDoc curr = arr[i]; - ClassDoc next = (i+1 == arr.length)? - null: - arr[i+1]; - try { - if (curr.isAnnotationType()) { - AbstractBuilder annotationTypeBuilder = - configuration.getBuilderFactory() - .getAnnotationTypeBuilder((AnnotationTypeDoc) curr, - prev, next); - annotationTypeBuilder.build(); - } else { - AbstractBuilder classBuilder = - configuration.getBuilderFactory() - .getClassBuilder(curr, prev, next, classtree); - classBuilder.build(); - } - } catch (IOException e) { - throw new DocletAbortException(e); - } catch (FatalError fe) { - throw fe; - } catch (DocletAbortException de) { - de.printStackTrace(); - throw de; - } catch (Exception e) { - e.printStackTrace(); - throw new DocletAbortException(e); - } - } - } - - PackageDoc getNamedPackage(List list, int idx) { - if (idx < list.size()) { - PackageDoc pkg = list.get(idx); - if (!pkg.name().isEmpty()) { - return pkg; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - protected void generatePackageFiles(ClassTree classtree) throws Exception { - Set packages = configuration.packages; - if (packages.size() > 1) { - PackageIndexFrameWriter.generate(configuration); - } - List pList = new ArrayList<>(configuration.packages); - PackageDoc prev = null, next; - for (int i = 0; i < pList.size(); i++) { - // if -nodeprecated option is set and the package is marked as - // deprecated, do not generate the package-summary.html, package-frame.html - // and package-tree.html pages for that package. - PackageDoc pkg = pList.get(i); - if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) { - PackageFrameWriter.generate(configuration, pkg); - next = getNamedPackage(pList, i + 1); - //If the next package is unnamed package, skip 2 ahead if possible - if (next == null) - next = getNamedPackage(pList, i + 2); - AbstractBuilder packageSummaryBuilder = - configuration.getBuilderFactory().getPackageSummaryBuilder( - pkg, prev, next); - packageSummaryBuilder.build(); - if (configuration.createtree) { - PackageTreeWriter.generate(configuration, - pkg, prev, next, - configuration.nodeprecated); - } - prev = pkg; - } - } - } - - public static final ConfigurationImpl sharedInstanceForOptions = - new ConfigurationImpl(); - - /** - * Check for doclet added options here. - * - * @return number of arguments to option. Zero return means - * option not known. Negative value means error occurred. - */ - public static int optionLength(String option) { - // Construct temporary configuration for check - return sharedInstanceForOptions.optionLength(option); - } - - /** - * Check that options have the correct arguments here. - *

- * This method is not required and will default gracefully - * (to true) if absent. - *

- * Printing option related error messages (using the provided - * DocErrorReporter) is the responsibility of this method. - * - * @return true if the options are valid. - */ - public static boolean validOptions(String options[][], - DocErrorReporter reporter) { - docletToStart = new HtmlDoclet(); - return docletToStart.configuration.validOptions(options, reporter); - } - - private void performCopy(String filename) { - if (filename.isEmpty()) - return; - - try { - DocFile fromfile = DocFile.createFileForInput(configuration, filename); - DocPath path = DocPath.create(fromfile.getName()); - DocFile toFile = DocFile.createFileForOutput(configuration, path); - if (toFile.isSameFile(fromfile)) - return; - - configuration.message.notice((SourcePosition) null, - "doclet.Copying_File_0_To_File_1", - fromfile.toString(), path.getPath()); - toFile.copyFile(fromfile); - } catch (IOException exc) { - configuration.message.error((SourcePosition) null, - "doclet.perform_copy_exception_encountered", - exc.toString()); - throw new DocletAbortException(exc); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java +++ /dev/null @@ -1,2148 +0,0 @@ -/* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.taglets.*; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.javac.util.StringUtils; - -/** - * Class for the Html Format Code Generation specific to JavaDoc. - * This Class contains methods related to the Html Code Generation which - * are used extensively while generating the entire documentation. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @since 1.2 - * @author Atul M Dambalkar - * @author Robert Field - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class HtmlDocletWriter extends HtmlDocWriter { - - /** - * Relative path from the file getting generated to the destination - * directory. For example, if the file getting generated is - * "java/lang/Object.html", then the path to the root is "../..". - * This string can be empty if the file getting generated is in - * the destination directory. - */ - public final DocPath pathToRoot; - - /** - * Platform-independent path from the current or the - * destination directory to the file getting generated. - * Used when creating the file. - */ - public final DocPath path; - - /** - * Name of the file getting generated. If the file getting generated is - * "java/lang/Object.html", then the filename is "Object.html". - */ - public final DocPath filename; - - /** - * The global configuration information for this run. - */ - public final ConfigurationImpl configuration; - - protected final Utils utils; - - /** - * To check whether annotation heading is printed or not. - */ - protected boolean printedAnnotationHeading = false; - - /** - * To check whether annotation field heading is printed or not. - */ - protected boolean printedAnnotationFieldHeading = false; - - /** - * To check whether the repeated annotations is documented or not. - */ - private boolean isAnnotationDocumented = false; - - /** - * To check whether the container annotations is documented or not. - */ - private boolean isContainerDocumented = false; - - HtmlTree fixedNavDiv = new HtmlTree(HtmlTag.DIV); - - /** - * Constructor to construct the HtmlStandardWriter object. - * - * @param path File to be generated. - */ - public HtmlDocletWriter(ConfigurationImpl configuration, DocPath path) - throws IOException { - super(configuration, path); - this.configuration = configuration; - this.utils = configuration.utils; - this.path = path; - this.pathToRoot = path.parent().invert(); - this.filename = path.basename(); - } - - /** - * Replace {@docRoot} tag used in options that accept HTML text, such - * as -header, -footer, -top and -bottom, and when converting a relative - * HREF where commentTagsToString inserts a {@docRoot} where one was - * missing. (Also see DocRootTaglet for {@docRoot} tags in doc - * comments.) - *

- * Replace {@docRoot} tag in htmlstr with the relative path to the - * destination directory from the directory where the file is being - * written, looping to handle all such tags in htmlstr. - *

- * For example, for "-d docs" and -header containing {@docRoot}, when - * the HTML page for source file p/C1.java is being generated, the - * {@docRoot} tag would be inserted into the header as "../", - * the relative path from docs/p/ to docs/ (the document root). - *

- * Note: This doc comment was written with '&#064;' representing '@' - * to prevent the inline tag from being interpreted. - */ - public String replaceDocRootDir(String htmlstr) { - // Return if no inline tags exist - int index = htmlstr.indexOf("{@"); - if (index < 0) { - return htmlstr; - } - Matcher docrootMatcher = docrootPattern.matcher(htmlstr); - if (!docrootMatcher.find()) { - return htmlstr; - } - StringBuilder buf = new StringBuilder(); - int prevEnd = 0; - do { - int match = docrootMatcher.start(); - // append htmlstr up to start of next {@docroot} - buf.append(htmlstr.substring(prevEnd, match)); - prevEnd = docrootMatcher.end(); - if (configuration.docrootparent.length() > 0 && htmlstr.startsWith("/..", prevEnd)) { - // Insert the absolute link if {@docRoot} is followed by "/..". - buf.append(configuration.docrootparent); - prevEnd += 3; - } else { - // Insert relative path where {@docRoot} was located - buf.append(pathToRoot.isEmpty() ? "." : pathToRoot.getPath()); - } - // Append slash if next character is not a slash - if (prevEnd < htmlstr.length() && htmlstr.charAt(prevEnd) != '/') { - buf.append('/'); - } - } while (docrootMatcher.find()); - buf.append(htmlstr.substring(prevEnd)); - return buf.toString(); - } - //where: - // Note: {@docRoot} is not case sensitive when passed in w/command line option: - private static final Pattern docrootPattern = - Pattern.compile(Pattern.quote("{@docroot}"), Pattern.CASE_INSENSITIVE); - - /** - * Get the script to show or hide the All classes link. - * - * @param id id of the element to show or hide - * @return a content tree for the script - */ - public Content getAllClassesLinkScript(String id) { - HtmlTree script = HtmlTree.SCRIPT(); - String scriptCode = "" + DocletConstants.NL; - Content scriptContent = new RawHtml(scriptCode); - script.addContent(scriptContent); - Content div = HtmlTree.DIV(script); - Content div_noscript = HtmlTree.DIV(getResource("doclet.No_Script_Message")); - Content noScript = HtmlTree.NOSCRIPT(div_noscript); - div.addContent(noScript); - return div; - } - - /** - * Add method information. - * - * @param method the method to be documented - * @param dl the content tree to which the method information will be added - */ - private void addMethodInfo(MethodDoc method, Content dl) { - ClassDoc[] intfacs = method.containingClass().interfaces(); - MethodDoc overriddenMethod = method.overriddenMethod(); - // Check whether there is any implementation or overridden info to be - // printed. If no overridden or implementation info needs to be - // printed, do not print this section. - if ((intfacs.length > 0 && - new ImplementedMethods(method, this.configuration).build().length > 0) || - overriddenMethod != null) { - MethodWriterImpl.addImplementsInfo(this, method, dl); - if (overriddenMethod != null) { - MethodWriterImpl.addOverridden(this, - method.overriddenType(), overriddenMethod, dl); - } - } - } - - /** - * Adds the tags information. - * - * @param doc the doc for which the tags will be generated - * @param htmltree the documentation tree to which the tags will be added - */ - protected void addTagsInfo(Doc doc, Content htmltree) { - if (configuration.nocomment) { - return; - } - Content dl = new HtmlTree(HtmlTag.DL); - if (doc instanceof MethodDoc) { - addMethodInfo((MethodDoc) doc, dl); - } - Content output = new ContentBuilder(); - TagletWriter.genTagOuput(configuration.tagletManager, doc, - configuration.tagletManager.getCustomTaglets(doc), - getTagletWriterInstance(false), output); - dl.addContent(output); - htmltree.addContent(dl); - } - - /** - * Check whether there are any tags for Serialization Overview - * section to be printed. - * - * @param field the FieldDoc object to check for tags. - * @return true if there are tags to be printed else return false. - */ - protected boolean hasSerializationOverviewTags(FieldDoc field) { - Content output = new ContentBuilder(); - TagletWriter.genTagOuput(configuration.tagletManager, field, - configuration.tagletManager.getCustomTaglets(field), - getTagletWriterInstance(false), output); - return !output.isEmpty(); - } - - /** - * Returns a TagletWriter that knows how to write HTML. - * - * @return a TagletWriter that knows how to write HTML. - */ - public TagletWriter getTagletWriterInstance(boolean isFirstSentence) { - return new TagletWriterImpl(this, isFirstSentence); - } - - /** - * Get Package link, with target frame. - * - * @param pd The link will be to the "package-summary.html" page for this package - * @param target name of the target frame - * @param label tag for the link - * @return a content for the target package link - */ - public Content getTargetPackageLink(PackageDoc pd, String target, - Content label) { - return getHyperLink(pathString(pd, DocPaths.PACKAGE_SUMMARY), label, "", target); - } - - /** - * Generates the HTML document tree and prints it out. - * - * @param metakeywords Array of String keywords for META tag. Each element - * of the array is assigned to a separate META tag. - * Pass in null for no array - * @param includeScript true if printing windowtitle script - * false for files that appear in the left-hand frames - * @param body the body htmltree to be included in the document - */ - public void printHtmlDocument(String[] metakeywords, boolean includeScript, - Content body) throws IOException { - Content htmlDocType = configuration.isOutputHtml5() - ? DocType.HTML5 - : DocType.TRANSITIONAL; - Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); - Content head = new HtmlTree(HtmlTag.HEAD); - head.addContent(getGeneratedBy(!configuration.notimestamp)); - head.addContent(getTitle()); - Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE, - (configuration.charset.length() > 0) ? - configuration.charset : HtmlConstants.HTML_DEFAULT_CHARSET); - head.addContent(meta); - if (!configuration.notimestamp) { - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); - meta = HtmlTree.META(configuration.isOutputHtml5() - ? "dc.created" - : "date", dateFormat.format(new Date())); - head.addContent(meta); - } - if (metakeywords != null) { - for (String metakeyword : metakeywords) { - meta = HtmlTree.META("keywords", metakeyword); - head.addContent(meta); - } - } - addStyleSheetProperties(head); - addScriptProperties(head); - Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), - head, body); - Content htmlDocument = new HtmlDocument(htmlDocType, - htmlComment, htmlTree); - write(htmlDocument); - } - - /** - * Get the window title. - * - * @param title the title string to construct the complete window title - * @return the window title string - */ - public String getWindowTitle(String title) { - if (configuration.windowtitle.length() > 0) { - title += " (" + configuration.windowtitle + ")"; - } - return title; - } - - /** - * Get user specified header and the footer. - * - * @param header if true print the user provided header else print the - * user provided footer. - */ - public Content getUserHeaderFooter(boolean header) { - String content; - if (header) { - content = replaceDocRootDir(configuration.header); - } else { - if (configuration.footer.length() != 0) { - content = replaceDocRootDir(configuration.footer); - } else { - content = replaceDocRootDir(configuration.header); - } - } - Content rawContent = new RawHtml(content); - return rawContent; - } - - /** - * Adds the user specified top. - * - * @param htmlTree the content tree to which user specified top will be added - */ - public void addTop(Content htmlTree) { - Content top = new RawHtml(replaceDocRootDir(configuration.top)); - fixedNavDiv.addContent(top); - } - - /** - * Adds the user specified bottom. - * - * @param htmlTree the content tree to which user specified bottom will be added - */ - public void addBottom(Content htmlTree) { - Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom)); - Content small = HtmlTree.SMALL(bottom); - Content p = HtmlTree.P(HtmlStyle.legalCopy, small); - htmlTree.addContent(p); - } - - /** - * Adds the navigation bar for the Html page at the top and and the bottom. - * - * @param header If true print navigation bar at the top of the page else - * @param htmlTree the HtmlTree to which the nav links will be added - */ - protected void addNavLinks(boolean header, Content htmlTree) { - if (!configuration.nonavbar) { - Content tree = (configuration.allowTag(HtmlTag.NAV)) - ? HtmlTree.NAV() - : htmlTree; - String allClassesId = "allclasses_"; - HtmlTree navDiv = new HtmlTree(HtmlTag.DIV); - fixedNavDiv.addStyle(HtmlStyle.fixedNav); - Content skipNavLinks = configuration.getResource("doclet.Skip_navigation_links"); - if (header) { - fixedNavDiv.addContent(HtmlConstants.START_OF_TOP_NAVBAR); - navDiv.addStyle(HtmlStyle.topNav); - allClassesId += "navbar_top"; - Content a = getMarkerAnchor(SectionName.NAVBAR_TOP); - //WCAG - Hyperlinks should contain text or an image with alt text - for AT tools - navDiv.addContent(a); - Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink( - getDocLink(SectionName.SKIP_NAVBAR_TOP), skipNavLinks, - skipNavLinks.toString(), "")); - navDiv.addContent(skipLinkContent); - } else { - tree.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR); - navDiv.addStyle(HtmlStyle.bottomNav); - allClassesId += "navbar_bottom"; - Content a = getMarkerAnchor(SectionName.NAVBAR_BOTTOM); - navDiv.addContent(a); - Content skipLinkContent = HtmlTree.DIV(HtmlStyle.skipNav, getHyperLink( - getDocLink(SectionName.SKIP_NAVBAR_BOTTOM), skipNavLinks, - skipNavLinks.toString(), "")); - navDiv.addContent(skipLinkContent); - } - if (header) { - navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_TOP_FIRSTROW)); - } else { - navDiv.addContent(getMarkerAnchor(SectionName.NAVBAR_BOTTOM_FIRSTROW)); - } - HtmlTree navList = new HtmlTree(HtmlTag.UL); - navList.addStyle(HtmlStyle.navList); - navList.addAttr(HtmlAttr.TITLE, - configuration.getText("doclet.Navigation")); - if (configuration.createoverview) { - navList.addContent(getNavLinkContents()); - } - if (configuration.packages.size() == 1) { - navList.addContent(getNavLinkPackage(configuration.packages.first())); - } else if (configuration.packages.size() > 1) { - navList.addContent(getNavLinkPackage()); - } - navList.addContent(getNavLinkClass()); - if(configuration.classuse) { - navList.addContent(getNavLinkClassUse()); - } - if(configuration.createtree) { - navList.addContent(getNavLinkTree()); - } - if(!(configuration.nodeprecated || - configuration.nodeprecatedlist)) { - navList.addContent(getNavLinkDeprecated()); - } - if(configuration.createindex) { - navList.addContent(getNavLinkIndex()); - } - if (!configuration.nohelp) { - navList.addContent(getNavLinkHelp()); - } - navDiv.addContent(navList); - Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, getUserHeaderFooter(header)); - navDiv.addContent(aboutDiv); - if (header) { - fixedNavDiv.addContent(navDiv); - } else { - tree.addContent(navDiv); - } - Content ulNav = HtmlTree.UL(HtmlStyle.navList, getNavLinkPrevious()); - ulNav.addContent(getNavLinkNext()); - Content subDiv = HtmlTree.DIV(HtmlStyle.subNav, ulNav); - Content ulFrames = HtmlTree.UL(HtmlStyle.navList, getNavShowLists()); - ulFrames.addContent(getNavHideLists(filename)); - subDiv.addContent(ulFrames); - HtmlTree ulAllClasses = HtmlTree.UL(HtmlStyle.navList, getNavLinkClassIndex()); - ulAllClasses.addAttr(HtmlAttr.ID, allClassesId.toString()); - subDiv.addContent(ulAllClasses); - if (header && configuration.createindex) { - HtmlTree inputText = HtmlTree.INPUT("text", "search"); - HtmlTree inputReset = HtmlTree.INPUT("reset", "reset"); - Content searchTxt = configuration.getResource("doclet.search"); - searchTxt.addContent(getSpace()); - HtmlTree liInput = HtmlTree.LI(HtmlTree.SPAN(searchTxt)); - liInput.addContent(inputText); - liInput.addContent(inputReset); - HtmlTree ulSearch = HtmlTree.UL(HtmlStyle.navListSearch, liInput); - subDiv.addContent(ulSearch); - } - subDiv.addContent(getAllClassesLinkScript(allClassesId.toString())); - addSummaryDetailLinks(subDiv); - if (header) { - subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_TOP)); - fixedNavDiv.addContent(subDiv); - fixedNavDiv.addContent(HtmlConstants.END_OF_TOP_NAVBAR); - tree.addContent(fixedNavDiv); - HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, getSpace()); - tree.addContent(paddingDiv); - } else { - subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_BOTTOM)); - tree.addContent(subDiv); - tree.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR); - } - if (configuration.allowTag(HtmlTag.NAV)) { - htmlTree.addContent(tree); - } - } - } - - /** - * Get the word "NEXT" to indicate that no link is available. Override - * this method to customize next link. - * - * @return a content tree for the link - */ - protected Content getNavLinkNext() { - return getNavLinkNext(null); - } - - /** - * Get the word "PREV" to indicate that no link is available. Override - * this method to customize prev link. - * - * @return a content tree for the link - */ - protected Content getNavLinkPrevious() { - return getNavLinkPrevious(null); - } - - /** - * Do nothing. This is the default method. - */ - protected void addSummaryDetailLinks(Content navDiv) { - } - - /** - * Get link to the "overview-summary.html" page. - * - * @return a content tree for the link - */ - protected Content getNavLinkContents() { - Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_SUMMARY), - overviewLabel, "", ""); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get link to the "package-summary.html" page for the package passed. - * - * @param pkg Package to which link will be generated - * @return a content tree for the link - */ - protected Content getNavLinkPackage(PackageDoc pkg) { - Content linkContent = getPackageLink(pkg, - packageLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get the word "Package" , to indicate that link is not available here. - * - * @return a content tree for the link - */ - protected Content getNavLinkPackage() { - Content li = HtmlTree.LI(packageLabel); - return li; - } - - /** - * Get the word "Use", to indicate that link is not available. - * - * @return a content tree for the link - */ - protected Content getNavLinkClassUse() { - Content li = HtmlTree.LI(useLabel); - return li; - } - - /** - * Get link for previous file. - * - * @param prev File name for the prev link - * @return a content tree for the link - */ - public Content getNavLinkPrevious(DocPath prev) { - Content li; - if (prev != null) { - li = HtmlTree.LI(getHyperLink(prev, prevLabel, "", "")); - } - else - li = HtmlTree.LI(prevLabel); - return li; - } - - /** - * Get link for next file. If next is null, just print the label - * without linking it anywhere. - * - * @param next File name for the next link - * @return a content tree for the link - */ - public Content getNavLinkNext(DocPath next) { - Content li; - if (next != null) { - li = HtmlTree.LI(getHyperLink(next, nextLabel, "", "")); - } - else - li = HtmlTree.LI(nextLabel); - return li; - } - - /** - * Get "FRAMES" link, to switch to the frame version of the output. - * - * @param link File to be linked, "index.html" - * @return a content tree for the link - */ - protected Content getNavShowLists(DocPath link) { - DocLink dl = new DocLink(link, path.getPath(), null); - Content framesContent = getHyperLink(dl, framesLabel, "", "_top"); - Content li = HtmlTree.LI(framesContent); - return li; - } - - /** - * Get "FRAMES" link, to switch to the frame version of the output. - * - * @return a content tree for the link - */ - protected Content getNavShowLists() { - return getNavShowLists(pathToRoot.resolve(DocPaths.INDEX)); - } - - /** - * Get "NO FRAMES" link, to switch to the non-frame version of the output. - * - * @param link File to be linked - * @return a content tree for the link - */ - protected Content getNavHideLists(DocPath link) { - Content noFramesContent = getHyperLink(link, noframesLabel, "", "_top"); - Content li = HtmlTree.LI(noFramesContent); - return li; - } - - /** - * Get "Tree" link in the navigation bar. If there is only one package - * specified on the command line, then the "Tree" link will be to the - * only "package-tree.html" file otherwise it will be to the - * "overview-tree.html" file. - * - * @return a content tree for the link - */ - protected Content getNavLinkTree() { - Content treeLinkContent; - PackageDoc[] packages = configuration.root.specifiedPackages(); - if (packages.length == 1 && configuration.root.specifiedClasses().length == 0) { - treeLinkContent = getHyperLink(pathString(packages[0], - DocPaths.PACKAGE_TREE), treeLabel, - "", ""); - } else { - treeLinkContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), - treeLabel, "", ""); - } - Content li = HtmlTree.LI(treeLinkContent); - return li; - } - - /** - * Get the overview tree link for the main tree. - * - * @param label the label for the link - * @return a content tree for the link - */ - protected Content getNavLinkMainTree(String label) { - Content mainTreeContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), - new StringContent(label)); - Content li = HtmlTree.LI(mainTreeContent); - return li; - } - - /** - * Get the word "Class", to indicate that class link is not available. - * - * @return a content tree for the link - */ - protected Content getNavLinkClass() { - Content li = HtmlTree.LI(classLabel); - return li; - } - - /** - * Get "Deprecated" API link in the navigation bar. - * - * @return a content tree for the link - */ - protected Content getNavLinkDeprecated() { - Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST), - deprecatedLabel, "", ""); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get link for generated index. If the user has used "-splitindex" - * command line option, then link to file "index-files/index-1.html" is - * generated otherwise link to file "index-all.html" is generated. - * - * @return a content tree for the link - */ - protected Content getNavLinkClassIndex() { - Content allClassesContent = getHyperLink(pathToRoot.resolve( - DocPaths.ALLCLASSES_NOFRAME), - allclassesLabel, "", ""); - Content li = HtmlTree.LI(allClassesContent); - return li; - } - - /** - * Get link for generated class index. - * - * @return a content tree for the link - */ - protected Content getNavLinkIndex() { - Content linkContent = getHyperLink(pathToRoot.resolve( - (configuration.splitindex - ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)) - : DocPaths.INDEX_ALL)), - indexLabel, "", ""); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get help file link. If user has provided a help file, then generate a - * link to the user given file, which is already copied to current or - * destination directory. - * - * @return a content tree for the link - */ - protected Content getNavLinkHelp() { - String helpfile = configuration.helpfile; - DocPath helpfilenm; - if (helpfile.isEmpty()) { - helpfilenm = DocPaths.HELP_DOC; - } else { - DocFile file = DocFile.createFileForInput(configuration, helpfile); - helpfilenm = DocPath.create(file.getName()); - } - Content linkContent = getHyperLink(pathToRoot.resolve(helpfilenm), - helpLabel, "", ""); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get summary table header. - * - * @param header the header for the table - * @param scope the scope of the headers - * @return a content tree for the header - */ - public Content getSummaryTableHeader(String[] header, String scope) { - Content tr = new HtmlTree(HtmlTag.TR); - int size = header.length; - Content tableHeader; - if (size == 1) { - tableHeader = new StringContent(header[0]); - tr.addContent(HtmlTree.TH(HtmlStyle.colOne, scope, tableHeader)); - return tr; - } - for (int i = 0; i < size; i++) { - tableHeader = new StringContent(header[i]); - if(i == 0) - tr.addContent(HtmlTree.TH(HtmlStyle.colFirst, scope, tableHeader)); - else if(i == (size - 1)) - tr.addContent(HtmlTree.TH(HtmlStyle.colLast, scope, tableHeader)); - else - tr.addContent(HtmlTree.TH(scope, tableHeader)); - } - return tr; - } - - /** - * Get table caption. - * - * @param rawText the caption for the table which could be raw Html - * @return a content tree for the caption - */ - public Content getTableCaption(Content title) { - Content captionSpan = HtmlTree.SPAN(title); - Content space = getSpace(); - Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, space); - Content caption = HtmlTree.CAPTION(captionSpan); - caption.addContent(tabSpan); - return caption; - } - - /** - * Get the marker anchor which will be added to the documentation tree. - * - * @param anchorName the anchor name attribute - * @return a content tree for the marker anchor - */ - public Content getMarkerAnchor(String anchorName) { - return getMarkerAnchor(getName(anchorName), null); - } - - /** - * Get the marker anchor which will be added to the documentation tree. - * - * @param sectionName the section name anchor attribute for page - * @return a content tree for the marker anchor - */ - public Content getMarkerAnchor(SectionName sectionName) { - return getMarkerAnchor(sectionName.getName(), null); - } - - /** - * Get the marker anchor which will be added to the documentation tree. - * - * @param sectionName the section name anchor attribute for page - * @param anchorName the anchor name combined with section name attribute for the page - * @return a content tree for the marker anchor - */ - public Content getMarkerAnchor(SectionName sectionName, String anchorName) { - return getMarkerAnchor(sectionName.getName() + getName(anchorName), null); - } - - /** - * Get the marker anchor which will be added to the documentation tree. - * - * @param anchorName the anchor name or id attribute - * @param anchorContent the content that should be added to the anchor - * @return a content tree for the marker anchor - */ - public Content getMarkerAnchor(String anchorName, Content anchorContent) { - if (anchorContent == null) - anchorContent = new Comment(" "); - Content markerAnchor = HtmlTree.A(configuration.htmlVersion, anchorName, anchorContent); - return markerAnchor; - } - - /** - * Returns a packagename content. - * - * @param packageDoc the package to check - * @return package name content - */ - public Content getPackageName(PackageDoc packageDoc) { - return packageDoc == null || packageDoc.name().isEmpty() ? - defaultPackageLabel : - getPackageLabel(packageDoc.name()); - } - - /** - * Returns a package name label. - * - * @param packageName the package name - * @return the package name content - */ - public Content getPackageLabel(String packageName) { - return new StringContent(packageName); - } - - /** - * Add package deprecation information to the documentation tree - * - * @param deprPkgs list of deprecated packages - * @param headingKey the caption for the deprecated package table - * @param tableSummary the summary for the deprecated package table - * @param tableHeader table headers for the deprecated package table - * @param contentTree the content tree to which the deprecated package table will be added - */ - protected void addPackageDeprecatedAPI(List deprPkgs, String headingKey, - String tableSummary, String[] tableHeader, Content contentTree) { - if (deprPkgs.size() > 0) { - Content caption = getTableCaption(configuration.getResource(headingKey)); - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption) - : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption); - table.addContent(getSummaryTableHeader(tableHeader, "col")); - Content tbody = new HtmlTree(HtmlTag.TBODY); - for (int i = 0; i < deprPkgs.size(); i++) { - PackageDoc pkg = (PackageDoc) deprPkgs.get(i); - HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, - getPackageLink(pkg, getPackageName(pkg))); - if (pkg.tags("deprecated").length > 0) { - addInlineDeprecatedComment(pkg, pkg.tags("deprecated")[0], td); - } - HtmlTree tr = HtmlTree.TR(td); - if (i % 2 == 0) { - tr.addStyle(HtmlStyle.altColor); - } else { - tr.addStyle(HtmlStyle.rowColor); - } - tbody.addContent(tr); - } - table.addContent(tbody); - Content li = HtmlTree.LI(HtmlStyle.blockList, table); - Content ul = HtmlTree.UL(HtmlStyle.blockList, li); - contentTree.addContent(ul); - } - } - - /** - * Return the path to the class page for a classdoc. - * - * @param cd Class to which the path is requested. - * @param name Name of the file(doesn't include path). - */ - protected DocPath pathString(ClassDoc cd, DocPath name) { - return pathString(cd.containingPackage(), name); - } - - /** - * Return path to the given file name in the given package. So if the name - * passed is "Object.html" and the name of the package is "java.lang", and - * if the relative path is "../.." then returned string will be - * "../../java/lang/Object.html" - * - * @param pd Package in which the file name is assumed to be. - * @param name File name, to which path string is. - */ - protected DocPath pathString(PackageDoc pd, DocPath name) { - return pathToRoot.resolve(DocPath.forPackage(pd).resolve(name)); - } - - /** - * Given a package, return the name to be used in HTML anchor tag. - * @param packageDoc the package. - * @return the name to be used in HTML anchor tag. - */ - public String getPackageAnchorName(PackageDoc packageDoc) { - return packageDoc == null || packageDoc.name().length() == 0 ? - SectionName.UNNAMED_PACKAGE_ANCHOR.getName() : packageDoc.name(); - } - - /** - * Return the link to the given package. - * - * @param pkg the package to link to. - * @param label the label for the link. - * @return a content tree for the package link. - */ - public Content getPackageLink(PackageDoc pkg, String label) { - return getPackageLink(pkg, new StringContent(label)); - } - - /** - * Return the link to the given package. - * - * @param pkg the package to link to. - * @param label the label for the link. - * @return a content tree for the package link. - */ - public Content getPackageLink(PackageDoc pkg, Content label) { - boolean included = pkg != null && pkg.isIncluded(); - if (! included) { - for (PackageDoc p : configuration.packages) { - if (p.equals(pkg)) { - included = true; - break; - } - } - } - if (included || pkg == null) { - return getHyperLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY), - label); - } else { - DocLink crossPkgLink = getCrossPackageLink(utils.getPackageName(pkg)); - if (crossPkgLink != null) { - return getHyperLink(crossPkgLink, label); - } else { - return label; - } - } - } - - public Content italicsClassName(ClassDoc cd, boolean qual) { - Content name = new StringContent((qual)? cd.qualifiedName(): cd.name()); - return (cd.isInterface())? HtmlTree.SPAN(HtmlStyle.interfaceName, name): name; - } - - /** - * Add the link to the content tree. - * - * @param doc program element doc for which the link will be added - * @param label label for the link - * @param htmltree the content tree to which the link will be added - */ - public void addSrcLink(ProgramElementDoc doc, Content label, Content htmltree) { - if (doc == null) { - return; - } - ClassDoc cd = doc.containingClass(); - if (cd == null) { - //d must be a class doc since in has no containing class. - cd = (ClassDoc) doc; - } - DocPath href = pathToRoot - .resolve(DocPaths.SOURCE_OUTPUT) - .resolve(DocPath.forClass(cd)); - Content linkContent = getHyperLink(href.fragment(SourceToHTMLConverter.getAnchorName(doc)), label, "", ""); - htmltree.addContent(linkContent); - } - - /** - * Return the link to the given class. - * - * @param linkInfo the information about the link. - * - * @return the link for the given class. - */ - public Content getLink(LinkInfoImpl linkInfo) { - LinkFactoryImpl factory = new LinkFactoryImpl(this); - return factory.getLink(linkInfo); - } - - /** - * Return the type parameters for the given class. - * - * @param linkInfo the information about the link. - * @return the type for the given class. - */ - public Content getTypeParameterLinks(LinkInfoImpl linkInfo) { - LinkFactoryImpl factory = new LinkFactoryImpl(this); - return factory.getTypeParameterLinks(linkInfo, false); - } - - /************************************************************* - * Return a class cross link to external class documentation. - * The name must be fully qualified to determine which package - * the class is in. The -link option does not allow users to - * link to external classes in the "default" package. - * - * @param qualifiedClassName the qualified name of the external class. - * @param refMemName the name of the member being referenced. This should - * be null or empty string if no member is being referenced. - * @param label the label for the external link. - * @param strong true if the link should be strong. - * @param style the style of the link. - * @param code true if the label should be code font. - */ - public Content getCrossClassLink(String qualifiedClassName, String refMemName, - Content label, boolean strong, String style, - boolean code) { - String className = ""; - String packageName = qualifiedClassName == null ? "" : qualifiedClassName; - int periodIndex; - while ((periodIndex = packageName.lastIndexOf('.')) != -1) { - className = packageName.substring(periodIndex + 1, packageName.length()) + - (className.length() > 0 ? "." + className : ""); - Content defaultLabel = new StringContent(className); - if (code) - defaultLabel = HtmlTree.CODE(defaultLabel); - packageName = packageName.substring(0, periodIndex); - if (getCrossPackageLink(packageName) != null) { - //The package exists in external documentation, so link to the external - //class (assuming that it exists). This is definitely a limitation of - //the -link option. There are ways to determine if an external package - //exists, but no way to determine if the external class exists. We just - //have to assume that it does. - DocLink link = configuration.extern.getExternalLink(packageName, pathToRoot, - className + ".html", refMemName); - return getHyperLink(link, - (label == null) || label.isEmpty() ? defaultLabel : label, - strong, style, - configuration.getText("doclet.Href_Class_Or_Interface_Title", packageName), - ""); - } - } - return null; - } - - public boolean isClassLinkable(ClassDoc cd) { - if (cd.isIncluded()) { - return configuration.isGeneratedDoc(cd); - } - return configuration.extern.isExternal(cd); - } - - public DocLink getCrossPackageLink(String pkgName) { - return configuration.extern.getExternalLink(pkgName, pathToRoot, - DocPaths.PACKAGE_SUMMARY.getPath()); - } - - /** - * Get the class link. - * - * @param context the id of the context where the link will be added - * @param cd the class doc to link to - * @return a content tree for the link - */ - public Content getQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd) { - return getLink(new LinkInfoImpl(configuration, context, cd) - .label(configuration.getClassName(cd))); - } - - /** - * Add the class link. - * - * @param context the id of the context where the link will be added - * @param cd the class doc to link to - * @param contentTree the content tree to which the link will be added - */ - public void addPreQualifiedClassLink(LinkInfoImpl.Kind context, ClassDoc cd, Content contentTree) { - addPreQualifiedClassLink(context, cd, false, contentTree); - } - - /** - * Retrieve the class link with the package portion of the label in - * plain text. If the qualifier is excluded, it will not be included in the - * link label. - * - * @param cd the class to link to. - * @param isStrong true if the link should be strong. - * @return the link with the package portion of the label in plain text. - */ - public Content getPreQualifiedClassLink(LinkInfoImpl.Kind context, - ClassDoc cd, boolean isStrong) { - ContentBuilder classlink = new ContentBuilder(); - PackageDoc pd = cd.containingPackage(); - if (pd != null && ! configuration.shouldExcludeQualifier(pd.name())) { - classlink.addContent(getPkgName(cd)); - } - classlink.addContent(getLink(new LinkInfoImpl(configuration, - context, cd).label(cd.name()).strong(isStrong))); - return classlink; - } - - /** - * Add the class link with the package portion of the label in - * plain text. If the qualifier is excluded, it will not be included in the - * link label. - * - * @param context the id of the context where the link will be added - * @param cd the class to link to - * @param isStrong true if the link should be strong - * @param contentTree the content tree to which the link with be added - */ - public void addPreQualifiedClassLink(LinkInfoImpl.Kind context, - ClassDoc cd, boolean isStrong, Content contentTree) { - PackageDoc pd = cd.containingPackage(); - if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) { - contentTree.addContent(getPkgName(cd)); - } - contentTree.addContent(getLink(new LinkInfoImpl(configuration, - context, cd).label(cd.name()).strong(isStrong))); - } - - /** - * Add the class link, with only class name as the strong link and prefixing - * plain package name. - * - * @param context the id of the context where the link will be added - * @param cd the class to link to - * @param contentTree the content tree to which the link with be added - */ - public void addPreQualifiedStrongClassLink(LinkInfoImpl.Kind context, ClassDoc cd, Content contentTree) { - addPreQualifiedClassLink(context, cd, true, contentTree); - } - - /** - * Get the link for the given member. - * - * @param context the id of the context where the link will be added - * @param doc the member being linked to - * @param label the label for the link - * @return a content tree for the doc link - */ - public Content getDocLink(LinkInfoImpl.Kind context, MemberDoc doc, String label) { - return getDocLink(context, doc.containingClass(), doc, - new StringContent(label)); - } - - /** - * Return the link for the given member. - * - * @param context the id of the context where the link will be printed. - * @param doc the member being linked to. - * @param label the label for the link. - * @param strong true if the link should be strong. - * @return the link for the given member. - */ - public Content getDocLink(LinkInfoImpl.Kind context, MemberDoc doc, String label, - boolean strong) { - return getDocLink(context, doc.containingClass(), doc, label, strong); - } - - /** - * Return the link for the given member. - * - * @param context the id of the context where the link will be printed. - * @param classDoc the classDoc that we should link to. This is not - * necessarily equal to doc.containingClass(). We may be - * inheriting comments. - * @param doc the member being linked to. - * @param label the label for the link. - * @param strong true if the link should be strong. - * @return the link for the given member. - */ - public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, - String label, boolean strong) { - return getDocLink(context, classDoc, doc, label, strong, false); - } - public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, - Content label, boolean strong) { - return getDocLink(context, classDoc, doc, label, strong, false); - } - - /** - * Return the link for the given member. - * - * @param context the id of the context where the link will be printed. - * @param classDoc the classDoc that we should link to. This is not - * necessarily equal to doc.containingClass(). We may be - * inheriting comments. - * @param doc the member being linked to. - * @param label the label for the link. - * @param strong true if the link should be strong. - * @param isProperty true if the doc parameter is a JavaFX property. - * @return the link for the given member. - */ - public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, - String label, boolean strong, boolean isProperty) { - return getDocLink(context, classDoc, doc, new StringContent(check(label)), strong, isProperty); - } - - String check(String s) { - if (s.matches(".*[&<>].*"))throw new IllegalArgumentException(s); - return s; - } - - public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, - Content label, boolean strong, boolean isProperty) { - if (! (doc.isIncluded() || - utils.isLinkable(classDoc, configuration))) { - return label; - } else if (doc instanceof ExecutableMemberDoc) { - ExecutableMemberDoc emd = (ExecutableMemberDoc)doc; - return getLink(new LinkInfoImpl(configuration, context, classDoc) - .label(label).where(getName(getAnchor(emd, isProperty))).strong(strong)); - } else if (doc instanceof MemberDoc) { - return getLink(new LinkInfoImpl(configuration, context, classDoc) - .label(label).where(getName(doc.name())).strong(strong)); - } else { - return label; - } - } - - /** - * Return the link for the given member. - * - * @param context the id of the context where the link will be added - * @param classDoc the classDoc that we should link to. This is not - * necessarily equal to doc.containingClass(). We may be - * inheriting comments - * @param doc the member being linked to - * @param label the label for the link - * @return the link for the given member - */ - public Content getDocLink(LinkInfoImpl.Kind context, ClassDoc classDoc, MemberDoc doc, - Content label) { - if (! (doc.isIncluded() || - utils.isLinkable(classDoc, configuration))) { - return label; - } else if (doc instanceof ExecutableMemberDoc) { - ExecutableMemberDoc emd = (ExecutableMemberDoc) doc; - return getLink(new LinkInfoImpl(configuration, context, classDoc) - .label(label).where(getName(getAnchor(emd)))); - } else if (doc instanceof MemberDoc) { - return getLink(new LinkInfoImpl(configuration, context, classDoc) - .label(label).where(getName(doc.name()))); - } else { - return label; - } - } - - public String getAnchor(ExecutableMemberDoc emd) { - return getAnchor(emd, false); - } - - public String getAnchor(ExecutableMemberDoc emd, boolean isProperty) { - if (isProperty) { - return emd.name(); - } - StringBuilder signature = new StringBuilder(emd.signature()); - StringBuilder signatureParsed = new StringBuilder(); - int counter = 0; - for (int i = 0; i < signature.length(); i++) { - char c = signature.charAt(i); - if (c == '<') { - counter++; - } else if (c == '>') { - counter--; - } else if (counter == 0) { - signatureParsed.append(c); - } - } - return emd.name() + signatureParsed.toString(); - } - - public Content seeTagToContent(SeeTag see) { - String tagName = see.name(); - if (! (tagName.startsWith("@link") || tagName.equals("@see"))) { - return new ContentBuilder(); - } - - String seetext = replaceDocRootDir(utils.normalizeNewlines(see.text())); - - //Check if @see is an href or "string" - if (seetext.startsWith("<") || seetext.startsWith("\"")) { - return new RawHtml(seetext); - } - - boolean plain = tagName.equalsIgnoreCase("@linkplain"); - Content label = plainOrCode(plain, new RawHtml(see.label())); - - //The text from the @see tag. We will output this text when a label is not specified. - Content text = plainOrCode(plain, new RawHtml(seetext)); - - ClassDoc refClass = see.referencedClass(); - String refClassName = see.referencedClassName(); - MemberDoc refMem = see.referencedMember(); - String refMemName = see.referencedMemberName(); - - if (refClass == null) { - //@see is not referencing an included class - PackageDoc refPackage = see.referencedPackage(); - if (refPackage != null && refPackage.isIncluded()) { - //@see is referencing an included package - if (label.isEmpty()) - label = plainOrCode(plain, new StringContent(refPackage.name())); - return getPackageLink(refPackage, label); - } else { - //@see is not referencing an included class or package. Check for cross links. - Content classCrossLink; - DocLink packageCrossLink = getCrossPackageLink(refClassName); - if (packageCrossLink != null) { - //Package cross link found - return getHyperLink(packageCrossLink, - (label.isEmpty() ? text : label)); - } else if ((classCrossLink = getCrossClassLink(refClassName, - refMemName, label, false, "", !plain)) != null) { - //Class cross link found (possibly to a member in the class) - return classCrossLink; - } else { - //No cross link found so print warning - configuration.getDocletSpecificMsg().warning(see.position(), "doclet.see.class_or_package_not_found", - tagName, seetext); - return (label.isEmpty() ? text: label); - } - } - } else if (refMemName == null) { - // Must be a class reference since refClass is not null and refMemName is null. - if (label.isEmpty()) { - label = plainOrCode(plain, new StringContent(refClass.name())); - } - return getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, refClass) - .label(label)); - } else if (refMem == null) { - // Must be a member reference since refClass is not null and refMemName is not null. - // However, refMem is null, so this referenced member does not exist. - return (label.isEmpty() ? text: label); - } else { - // Must be a member reference since refClass is not null and refMemName is not null. - // refMem is not null, so this @see tag must be referencing a valid member. - ClassDoc containing = refMem.containingClass(); - if (see.text().trim().startsWith("#") && - ! (containing.isPublic() || - utils.isLinkable(containing, configuration))) { - // Since the link is relative and the holder is not even being - // documented, this must be an inherited link. Redirect it. - // The current class either overrides the referenced member or - // inherits it automatically. - if (this instanceof ClassWriterImpl) { - containing = ((ClassWriterImpl) this).getClassDoc(); - } else if (!containing.isPublic()){ - configuration.getDocletSpecificMsg().warning( - see.position(), "doclet.see.class_or_package_not_accessible", - tagName, containing.qualifiedName()); - } else { - configuration.getDocletSpecificMsg().warning( - see.position(), "doclet.see.class_or_package_not_found", - tagName, seetext); - } - } - if (configuration.currentcd != containing) { - refMemName = (refMem instanceof ConstructorDoc) ? - refMemName : containing.name() + "." + refMemName; - } - if (refMem instanceof ExecutableMemberDoc) { - if (refMemName.indexOf('(') < 0) { - refMemName += ((ExecutableMemberDoc)refMem).signature(); - } - } - - text = plainOrCode(plain, new StringContent(refMemName)); - - return getDocLink(LinkInfoImpl.Kind.SEE_TAG, containing, - refMem, (label.isEmpty() ? text: label), false); - } - } - - private Content plainOrCode(boolean plain, Content body) { - return (plain || body.isEmpty()) ? body : HtmlTree.CODE(body); - } - - /** - * Add the inline comment. - * - * @param doc the doc for which the inline comment will be added - * @param tag the inline tag to be added - * @param htmltree the content tree to which the comment will be added - */ - public void addInlineComment(Doc doc, Tag tag, Content htmltree) { - addCommentTags(doc, tag, tag.inlineTags(), false, false, htmltree); - } - - /** - * Add the inline deprecated comment. - * - * @param doc the doc for which the inline deprecated comment will be added - * @param tag the inline tag to be added - * @param htmltree the content tree to which the comment will be added - */ - public void addInlineDeprecatedComment(Doc doc, Tag tag, Content htmltree) { - addCommentTags(doc, tag.inlineTags(), true, false, htmltree); - } - - /** - * Adds the summary content. - * - * @param doc the doc for which the summary will be generated - * @param htmltree the documentation tree to which the summary will be added - */ - public void addSummaryComment(Doc doc, Content htmltree) { - addSummaryComment(doc, doc.firstSentenceTags(), htmltree); - } - - /** - * Adds the summary content. - * - * @param doc the doc for which the summary will be generated - * @param firstSentenceTags the first sentence tags for the doc - * @param htmltree the documentation tree to which the summary will be added - */ - public void addSummaryComment(Doc doc, Tag[] firstSentenceTags, Content htmltree) { - addCommentTags(doc, firstSentenceTags, false, true, htmltree); - } - - public void addSummaryDeprecatedComment(Doc doc, Tag tag, Content htmltree) { - addCommentTags(doc, tag.firstSentenceTags(), true, true, htmltree); - } - - /** - * Adds the inline comment. - * - * @param doc the doc for which the inline comments will be generated - * @param htmltree the documentation tree to which the inline comments will be added - */ - public void addInlineComment(Doc doc, Content htmltree) { - addCommentTags(doc, doc.inlineTags(), false, false, htmltree); - } - - /** - * Adds the comment tags. - * - * @param doc the doc for which the comment tags will be generated - * @param tags the first sentence tags for the doc - * @param depr true if it is deprecated - * @param first true if the first sentence tags should be added - * @param htmltree the documentation tree to which the comment tags will be added - */ - private void addCommentTags(Doc doc, Tag[] tags, boolean depr, - boolean first, Content htmltree) { - addCommentTags(doc, null, tags, depr, first, htmltree); - } - - /** - * Adds the comment tags. - * - * @param doc the doc for which the comment tags will be generated - * @param holderTag the block tag context for the inline tags - * @param tags the first sentence tags for the doc - * @param depr true if it is deprecated - * @param first true if the first sentence tags should be added - * @param htmltree the documentation tree to which the comment tags will be added - */ - private void addCommentTags(Doc doc, Tag holderTag, Tag[] tags, boolean depr, - boolean first, Content htmltree) { - if(configuration.nocomment){ - return; - } - Content div; - Content result = commentTagsToContent(null, doc, tags, first); - if (depr) { - Content italic = HtmlTree.SPAN(HtmlStyle.deprecationComment, result); - div = HtmlTree.DIV(HtmlStyle.block, italic); - htmltree.addContent(div); - } - else { - div = HtmlTree.DIV(HtmlStyle.block, result); - htmltree.addContent(div); - } - if (tags.length == 0) { - htmltree.addContent(getSpace()); - } - } - - /** - * Converts inline tags and text to text strings, expanding the - * inline tags along the way. Called wherever text can contain - * an inline tag, such as in comments or in free-form text arguments - * to non-inline tags. - * - * @param holderTag specific tag where comment resides - * @param doc specific doc where comment resides - * @param tags array of text tags and inline tags (often alternating) - * present in the text of interest for this doc - * @param isFirstSentence true if text is first sentence - */ - public Content commentTagsToContent(Tag holderTag, Doc doc, Tag[] tags, - boolean isFirstSentence) { - Content result = new ContentBuilder(); - boolean textTagChange = false; - // Array of all possible inline tags for this javadoc run - configuration.tagletManager.checkTags(doc, tags, true); - for (int i = 0; i < tags.length; i++) { - Tag tagelem = tags[i]; - String tagName = tagelem.name(); - if (tagelem instanceof SeeTag) { - result.addContent(seeTagToContent((SeeTag) tagelem)); - } else if (! tagName.equals("Text")) { - boolean wasEmpty = result.isEmpty(); - Content output; - if (configuration.docrootparent.length() > 0 - && tagelem.name().equals("@docRoot") - && ((tags[i + 1]).text()).startsWith("/..")) { - // If Xdocrootparent switch ON, set the flag to remove the /.. occurrence after - // {@docRoot} tag in the very next Text tag. - textTagChange = true; - // Replace the occurrence of {@docRoot}/.. with the absolute link. - output = new StringContent(configuration.docrootparent); - } else { - output = TagletWriter.getInlineTagOuput( - configuration.tagletManager, holderTag, - tagelem, getTagletWriterInstance(isFirstSentence)); - } - if (output != null) - result.addContent(output); - if (wasEmpty && isFirstSentence && tagelem.name().equals("@inheritDoc") && !result.isEmpty()) { - break; - } else { - continue; - } - } else { - String text = tagelem.text(); - //If Xdocrootparent switch ON, remove the /.. occurrence after {@docRoot} tag. - if (textTagChange) { - text = text.replaceFirst("/..", ""); - textTagChange = false; - } - //This is just a regular text tag. The text may contain html links () - //or inline tag {@docRoot}, which will be handled as special cases. - text = redirectRelativeLinks(tagelem.holder(), text); - - // Replace @docRoot only if not represented by an instance of DocRootTaglet, - // that is, only if it was not present in a source file doc comment. - // This happens when inserted by the doclet (a few lines - // above in this method). [It might also happen when passed in on the command - // line as a text argument to an option (like -header).] - text = replaceDocRootDir(text); - if (isFirstSentence) { - text = removeNonInlineHtmlTags(text); - } - text = utils.replaceTabs(configuration, text); - text = utils.normalizeNewlines(text); - result.addContent(new RawHtml(text)); - } - } - return result; - } - - /** - * Return true if relative links should not be redirected. - * - * @return Return true if a relative link should not be redirected. - */ - private boolean shouldNotRedirectRelativeLinks() { - return this instanceof AnnotationTypeWriter || - this instanceof ClassWriter || - this instanceof PackageSummaryWriter; - } - - /** - * Suppose a piece of documentation has a relative link. When you copy - * that documentation to another place such as the index or class-use page, - * that relative link will no longer work. We should redirect those links - * so that they will work again. - *

- * Here is the algorithm used to fix the link: - *

- * {@literal => docRoot + + } - *

- * For example, suppose com.sun.javadoc.RootDoc has this link: - * {@literal The package Page } - *

- * If this link appeared in the index, we would redirect - * the link like this: - * - * {@literal The package Page} - * - * @param doc the Doc object whose documentation is being written. - * @param text the text being written. - * - * @return the text, with all the relative links redirected to work. - */ - private String redirectRelativeLinks(Doc doc, String text) { - if (doc == null || shouldNotRedirectRelativeLinks()) { - return text; - } - - DocPath redirectPathFromRoot; - if (doc instanceof ClassDoc) { - redirectPathFromRoot = DocPath.forPackage(((ClassDoc) doc).containingPackage()); - } else if (doc instanceof MemberDoc) { - redirectPathFromRoot = DocPath.forPackage(((MemberDoc) doc).containingPackage()); - } else if (doc instanceof PackageDoc) { - redirectPathFromRoot = DocPath.forPackage((PackageDoc) doc); - } else { - return text; - } - - //Redirect all relative links. - int end, begin = StringUtils.indexOfIgnoreCase(text, "= 0){ - StringBuilder textBuff = new StringBuilder(text); - - while(begin >=0){ - if (textBuff.length() > begin + 2 && ! Character.isWhitespace(textBuff.charAt(begin+2))) { - begin = StringUtils.indexOfIgnoreCase(textBuff.toString(), "", begin +1); - if(begin == 0){ - //Link has no equal symbol. - configuration.root.printWarning( - doc.position(), - configuration.getText("doclet.malformed_html_link_tag", text)); - break; - } - if (end == -1) { - //Break without warning. This tag is not necessarily malformed. The text - //might be missing '>' character because the href has an inline tag. - break; - } - - String quote = textBuff.substring(begin, end); - quote = quote.contains("\"") ? "\"" : - quote.contains("\'") ? "\'" : null; - if (quote != null) { - begin = textBuff.indexOf(quote, begin) + 1; - end = textBuff.indexOf(quote, begin +1); - if (begin == 0 || end == -1){ - //Link is missing a quote. - break; - } - } - String relativeLink = textBuff.substring(begin, end); - String relativeLinkLowerCase = StringUtils.toLowerCase(relativeLink); - if (!(relativeLinkLowerCase.startsWith("mailto:") || - relativeLinkLowerCase.startsWith("http:") || - relativeLinkLowerCase.startsWith("https:") || - relativeLinkLowerCase.startsWith("file:"))) { - relativeLink = "{@"+(new DocRootTaglet()).getName() + "}/" - + redirectPathFromRoot.resolve(relativeLink).getPath(); - textBuff.replace(begin, end, relativeLink); - } - begin = StringUtils.indexOfIgnoreCase(textBuff.toString(), " blockTags = new HashSet<>(); - static { - for (HtmlTag t: HtmlTag.values()) { - if (t.blockType == HtmlTag.BlockType.BLOCK) - blockTags.add(t.value); - } - } - - public static String removeNonInlineHtmlTags(String text) { - final int len = text.length(); - - int startPos = 0; // start of text to copy - int lessThanPos = text.indexOf('<'); // position of latest '<' - if (lessThanPos < 0) { - return text; - } - StringBuilder result = new StringBuilder(); - main: while (lessThanPos != -1) { - int currPos = lessThanPos + 1; - if (currPos == len) - break; - char ch = text.charAt(currPos); - if (ch == '/') { - if (++currPos == len) - break; - ch = text.charAt(currPos); - } - int tagPos = currPos; - while (isHtmlTagLetterOrDigit(ch)) { - if (++currPos == len) - break main; - ch = text.charAt(currPos); - } - String tagFound = StringUtils.toLowerCase(text.substring(tagPos, currPos)); - if (blockTags.contains(tagFound)) { - result.append(text, startPos, lessThanPos); - currPos = tagPos + tagFound.length(); - boolean foundGT = false; - Character quoteKind = null; - while (!foundGT) { - if (ch == '\"' || ch == '\'') { - if (quoteKind == null) { - quoteKind = ch; - } else if (quoteKind == ch) { - quoteKind = null; - } - } - if (ch == '>' && quoteKind == null) { - foundGT = true; - } - if (++currPos == len) { - break; - } - ch = text.charAt(currPos); - } - startPos = currPos; - } - lessThanPos = text.indexOf('<', currPos); - } - result.append(text.substring(startPos)); - return result.toString(); - } - - private static boolean isHtmlTagLetterOrDigit(char ch) { - return ('a' <= ch && ch <= 'z') || - ('A' <= ch && ch <= 'Z') || - ('1' <= ch && ch <= '6'); - } - - /** - * Add a link to the stylesheet file. - * - * @param head the content tree to which the files will be added - */ - public void addStyleSheetProperties(Content head) { - String stylesheetfile = configuration.stylesheetfile; - DocPath stylesheet; - if (stylesheetfile.isEmpty()) { - stylesheet = DocPaths.STYLESHEET; - } else { - DocFile file = DocFile.createFileForInput(configuration, stylesheetfile); - stylesheet = DocPath.create(file.getName()); - } - HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", - pathToRoot.resolve(stylesheet).getPath(), - "Style"); - head.addContent(link); - if (configuration.createindex) { - HtmlTree jq_link = HtmlTree.LINK("stylesheet", "text/css", - pathToRoot.resolve(DocPaths.JQUERY_FILES.resolve(DocPaths.JQUERY_STYLESHEET_FILE)).getPath(), - "Style"); - head.addContent(jq_link); - } - } - - /** - * Add a link to the JavaScript file. - * - * @param head the content tree to which the files will be added - */ - public void addScriptProperties(Content head) { - HtmlTree javascript = HtmlTree.SCRIPT(pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath()); - head.addContent(javascript); - if (configuration.createindex) { - if (pathToRoot != null && script != null) { - String path = pathToRoot.isEmpty() ? "." : pathToRoot.getPath(); - script.addContent(new RawHtml("var pathtoroot = \"" + path + "/\";loadScripts(document, \'script\');")); - } - addJQueryFile(head, DocPaths.JSZIP_MIN); - addJQueryFile(head, DocPaths.JSZIPUTILS_MIN); - head.addContent(new RawHtml("")); - addJQueryFile(head, DocPaths.JQUERY_JS_1_10); - addJQueryFile(head, DocPaths.JQUERY_JS); - } - } - - /** - * Add a link to the JQuery javascript file. - * - * @param head the content tree to which the files will be added - * @param filePath the DocPath of the file that needs to be added - */ - private void addJQueryFile(Content head, DocPath filePath) { - HtmlTree jqyeryScriptFile = HtmlTree.SCRIPT( - pathToRoot.resolve(DocPaths.JQUERY_FILES.resolve(filePath)).getPath()); - head.addContent(jqyeryScriptFile); - } - - /** - * According to - * The Java™ Language Specification, - * all the outer classes and static nested classes are core classes. - */ - public boolean isCoreClass(ClassDoc cd) { - return cd.containingClass() == null || cd.isStatic(); - } - - /** - * Adds the annotatation types for the given packageDoc. - * - * @param packageDoc the package to write annotations for. - * @param htmltree the documentation tree to which the annotation info will be - * added - */ - public void addAnnotationInfo(PackageDoc packageDoc, Content htmltree) { - addAnnotationInfo(packageDoc, packageDoc.annotations(), htmltree); - } - - /** - * Add the annotation types of the executable receiver. - * - * @param method the executable to write the receiver annotations for. - * @param descList list of annotation description. - * @param htmltree the documentation tree to which the annotation info will be - * added - */ - public void addReceiverAnnotationInfo(ExecutableMemberDoc method, AnnotationDesc[] descList, - Content htmltree) { - addAnnotationInfo(0, method, descList, false, htmltree); - } - - /** - * Adds the annotatation types for the given doc. - * - * @param doc the package to write annotations for - * @param htmltree the content tree to which the annotation types will be added - */ - public void addAnnotationInfo(ProgramElementDoc doc, Content htmltree) { - addAnnotationInfo(doc, doc.annotations(), htmltree); - } - - /** - * Add the annotatation types for the given doc and parameter. - * - * @param indent the number of spaces to indent the parameters. - * @param doc the doc to write annotations for. - * @param param the parameter to write annotations for. - * @param tree the content tree to which the annotation types will be added - */ - public boolean addAnnotationInfo(int indent, Doc doc, Parameter param, - Content tree) { - return addAnnotationInfo(indent, doc, param.annotations(), false, tree); - } - - /** - * Adds the annotatation types for the given doc. - * - * @param doc the doc to write annotations for. - * @param descList the array of {@link AnnotationDesc}. - * @param htmltree the documentation tree to which the annotation info will be - * added - */ - private void addAnnotationInfo(Doc doc, AnnotationDesc[] descList, - Content htmltree) { - addAnnotationInfo(0, doc, descList, true, htmltree); - } - - /** - * Adds the annotation types for the given doc. - * - * @param indent the number of extra spaces to indent the annotations. - * @param doc the doc to write annotations for. - * @param descList the array of {@link AnnotationDesc}. - * @param htmltree the documentation tree to which the annotation info will be - * added - */ - private boolean addAnnotationInfo(int indent, Doc doc, - AnnotationDesc[] descList, boolean lineBreak, Content htmltree) { - List annotations = getAnnotations(indent, descList, lineBreak); - String sep =""; - if (annotations.isEmpty()) { - return false; - } - for (Content annotation: annotations) { - htmltree.addContent(sep); - htmltree.addContent(annotation); - if (!lineBreak) { - sep = " "; - } - } - return true; - } - - /** - * Return the string representations of the annotation types for - * the given doc. - * - * @param indent the number of extra spaces to indent the annotations. - * @param descList the array of {@link AnnotationDesc}. - * @param linkBreak if true, add new line between each member value. - * @return an array of strings representing the annotations being - * documented. - */ - private List getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) { - return getAnnotations(indent, descList, linkBreak, true); - } - - /** - * Return the string representations of the annotation types for - * the given doc. - * - * A {@code null} {@code elementType} indicates that all the - * annotations should be returned without any filtering. - * - * @param indent the number of extra spaces to indent the annotations. - * @param descList the array of {@link AnnotationDesc}. - * @param linkBreak if true, add new line between each member value. - * @param elementType the type of targeted element (used for filtering - * type annotations from declaration annotations) - * @return an array of strings representing the annotations being - * documented. - */ - public List getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak, - boolean isJava5DeclarationLocation) { - List results = new ArrayList<>(); - ContentBuilder annotation; - for (AnnotationDesc aDesc : descList) { - AnnotationTypeDoc annotationDoc = aDesc.annotationType(); - // If an annotation is not documented, do not add it to the list. If - // the annotation is of a repeatable type, and if it is not documented - // and also if its container annotation is not documented, do not add it - // to the list. If an annotation of a repeatable type is not documented - // but its container is documented, it will be added to the list. - if (!utils.isDocumentedAnnotation(annotationDoc) && - (!isAnnotationDocumented && !isContainerDocumented)) { - continue; - } - /* TODO: check logic here to correctly handle declaration - * and type annotations. - if (util.isDeclarationAnnotation(annotationDoc, isJava5DeclarationLocation)) { - continue; - }*/ - annotation = new ContentBuilder(); - isAnnotationDocumented = false; - LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.ANNOTATION, annotationDoc); - AnnotationDesc.ElementValuePair[] pairs = aDesc.elementValues(); - // If the annotation is synthesized, do not print the container. - if (aDesc.isSynthesized()) { - for (AnnotationDesc.ElementValuePair pair : pairs) { - AnnotationValue annotationValue = pair.value(); - List annotationTypeValues = new ArrayList<>(); - if (annotationValue.value() instanceof AnnotationValue[]) { - AnnotationValue[] annotationArray = - (AnnotationValue[]) annotationValue.value(); - annotationTypeValues.addAll(Arrays.asList(annotationArray)); - } else { - annotationTypeValues.add(annotationValue); - } - String sep = ""; - for (AnnotationValue av : annotationTypeValues) { - annotation.addContent(sep); - annotation.addContent(annotationValueToContent(av)); - sep = " "; - } - } - } - else if (isAnnotationArray(pairs)) { - // If the container has 1 or more value defined and if the - // repeatable type annotation is not documented, do not print - // the container. - if (pairs.length == 1 && isAnnotationDocumented) { - AnnotationValue[] annotationArray = - (AnnotationValue[]) (pairs[0].value()).value(); - List annotationTypeValues = new ArrayList<>(); - annotationTypeValues.addAll(Arrays.asList(annotationArray)); - String sep = ""; - for (AnnotationValue av : annotationTypeValues) { - annotation.addContent(sep); - annotation.addContent(annotationValueToContent(av)); - sep = " "; - } - } - // If the container has 1 or more value defined and if the - // repeatable type annotation is not documented, print the container. - else { - addAnnotations(annotationDoc, linkInfo, annotation, pairs, - indent, false); - } - } - else { - addAnnotations(annotationDoc, linkInfo, annotation, pairs, - indent, linkBreak); - } - annotation.addContent(linkBreak ? DocletConstants.NL : ""); - results.add(annotation); - } - return results; - } - - /** - * Add annotation to the annotation string. - * - * @param annotationDoc the annotation being documented - * @param linkInfo the information about the link - * @param annotation the annotation string to which the annotation will be added - * @param pairs annotation type element and value pairs - * @param indent the number of extra spaces to indent the annotations. - * @param linkBreak if true, add new line between each member value - */ - private void addAnnotations(AnnotationTypeDoc annotationDoc, LinkInfoImpl linkInfo, - ContentBuilder annotation, AnnotationDesc.ElementValuePair[] pairs, - int indent, boolean linkBreak) { - linkInfo.label = new StringContent("@" + annotationDoc.name()); - annotation.addContent(getLink(linkInfo)); - if (pairs.length > 0) { - annotation.addContent("("); - for (int j = 0; j < pairs.length; j++) { - if (j > 0) { - annotation.addContent(","); - if (linkBreak) { - annotation.addContent(DocletConstants.NL); - int spaces = annotationDoc.name().length() + 2; - for (int k = 0; k < (spaces + indent); k++) { - annotation.addContent(" "); - } - } - } - annotation.addContent(getDocLink(LinkInfoImpl.Kind.ANNOTATION, - pairs[j].element(), pairs[j].element().name(), false)); - annotation.addContent("="); - AnnotationValue annotationValue = pairs[j].value(); - List annotationTypeValues = new ArrayList<>(); - if (annotationValue.value() instanceof AnnotationValue[]) { - AnnotationValue[] annotationArray = - (AnnotationValue[]) annotationValue.value(); - annotationTypeValues.addAll(Arrays.asList(annotationArray)); - } else { - annotationTypeValues.add(annotationValue); - } - annotation.addContent(annotationTypeValues.size() == 1 ? "" : "{"); - String sep = ""; - for (AnnotationValue av : annotationTypeValues) { - annotation.addContent(sep); - annotation.addContent(annotationValueToContent(av)); - sep = ","; - } - annotation.addContent(annotationTypeValues.size() == 1 ? "" : "}"); - isContainerDocumented = false; - } - annotation.addContent(")"); - } - } - - /** - * Check if the annotation contains an array of annotation as a value. This - * check is to verify if a repeatable type annotation is present or not. - * - * @param pairs annotation type element and value pairs - * - * @return true if the annotation contains an array of annotation as a value. - */ - private boolean isAnnotationArray(AnnotationDesc.ElementValuePair[] pairs) { - AnnotationValue annotationValue; - for (AnnotationDesc.ElementValuePair pair : pairs) { - annotationValue = pair.value(); - if (annotationValue.value() instanceof AnnotationValue[]) { - AnnotationValue[] annotationArray = - (AnnotationValue[]) annotationValue.value(); - if (annotationArray.length > 1) { - if (annotationArray[0].value() instanceof AnnotationDesc) { - AnnotationTypeDoc annotationDoc = - ((AnnotationDesc) annotationArray[0].value()).annotationType(); - isContainerDocumented = true; - if (utils.isDocumentedAnnotation(annotationDoc)) { - isAnnotationDocumented = true; - } - return true; - } - } - } - } - return false; - } - - private Content annotationValueToContent(AnnotationValue annotationValue) { - if (annotationValue.value() instanceof Type) { - Type type = (Type) annotationValue.value(); - if (type.asClassDoc() != null) { - LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.ANNOTATION, type); - linkInfo.label = new StringContent((type.asClassDoc().isIncluded() ? - type.typeName() : - type.qualifiedTypeName()) + type.dimension() + ".class"); - return getLink(linkInfo); - } else { - return new StringContent(type.typeName() + type.dimension() + ".class"); - } - } else if (annotationValue.value() instanceof AnnotationDesc) { - List list = getAnnotations(0, - new AnnotationDesc[]{(AnnotationDesc) annotationValue.value()}, - false); - ContentBuilder buf = new ContentBuilder(); - for (Content c: list) { - buf.addContent(c); - } - return buf; - } else if (annotationValue.value() instanceof MemberDoc) { - return getDocLink(LinkInfoImpl.Kind.ANNOTATION, - (MemberDoc) annotationValue.value(), - ((MemberDoc) annotationValue.value()).name(), false); - } else { - return new StringContent(annotationValue.toString()); - } - } - - /** - * Return the configuation for this doclet. - * - * @return the configuration for this doclet. - */ - public Configuration configuration() { - return configuration; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.taglets.*; - -/** - * Generate serialized form for serializable fields. - * Documentation denoted by the tags serial and - * serialField is processed. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Joe Fialli - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class HtmlSerialFieldWriter extends FieldWriterImpl - implements SerializedFormWriter.SerialFieldWriter { - ProgramElementDoc[] members = null; - - public HtmlSerialFieldWriter(SubWriterHolderWriter writer, - ClassDoc classdoc) { - super(writer, classdoc); - } - - public List members(ClassDoc cd) { - return Arrays.asList(cd.serializableFields()); - } - - /** - * Return the header for serializable fields section. - * - * @return a content tree for the header - */ - public Content getSerializableFieldsHeader() { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - return ul; - } - - /** - * Return the header for serializable fields content section. - * - * @param isLastContent true if the cotent being documented is the last content. - * @return a content tree for the header - */ - public Content getFieldsContentHeader(boolean isLastContent) { - HtmlTree li = new HtmlTree(HtmlTag.LI); - if (isLastContent) - li.addStyle(HtmlStyle.blockListLast); - else - li.addStyle(HtmlStyle.blockList); - return li; - } - - /** - * Add serializable fields. - * - * @param heading the heading for the section - * @param serializableFieldsTree the tree to be added to the serializable fileds - * content tree - * @return a content tree for the serializable fields content - */ - public Content getSerializableFields(String heading, Content serializableFieldsTree) { - HtmlTree li = new HtmlTree(HtmlTag.LI); - li.addStyle(HtmlStyle.blockList); - if (serializableFieldsTree.isValid()) { - Content headingContent = new StringContent(heading); - Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, - headingContent); - li.addContent(serialHeading); - li.addContent(serializableFieldsTree); - } - return li; - } - - /** - * Add the member header. - * - * @param fieldType the class document to be listed - * @param fieldTypeStr the string for the field type to be documented - * @param fieldDimensions the dimensions of the field string to be added - * @param fieldName name of the field to be added - * @param contentTree the content tree to which the member header will be added - */ - public void addMemberHeader(ClassDoc fieldType, String fieldTypeStr, - String fieldDimensions, String fieldName, Content contentTree) { - Content nameContent = new RawHtml(fieldName); - Content heading = HtmlTree.HEADING(HtmlConstants.MEMBER_HEADING, nameContent); - contentTree.addContent(heading); - Content pre = new HtmlTree(HtmlTag.PRE); - if (fieldType == null) { - pre.addContent(fieldTypeStr); - } else { - Content fieldContent = writer.getLink(new LinkInfoImpl( - configuration, LinkInfoImpl.Kind.SERIAL_MEMBER, fieldType)); - pre.addContent(fieldContent); - } - pre.addContent(fieldDimensions + " "); - pre.addContent(fieldName); - contentTree.addContent(pre); - } - - /** - * Add the deprecated information for this member. - * - * @param field the field to document. - * @param contentTree the tree to which the deprecated info will be added - */ - public void addMemberDeprecatedInfo(FieldDoc field, Content contentTree) { - addDeprecatedInfo(field, contentTree); - } - - /** - * Add the description text for this member. - * - * @param field the field to document. - * @param contentTree the tree to which the deprecated info will be added - */ - public void addMemberDescription(FieldDoc field, Content contentTree) { - if (field.inlineTags().length > 0) { - writer.addInlineComment(field, contentTree); - } - Tag[] tags = field.tags("serial"); - if (tags.length > 0) { - writer.addInlineComment(field, tags[0], contentTree); - } - } - - /** - * Add the description text for this member represented by the tag. - * - * @param serialFieldTag the field to document (represented by tag) - * @param contentTree the tree to which the deprecated info will be added - */ - public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree) { - String serialFieldTagDesc = serialFieldTag.description().trim(); - if (!serialFieldTagDesc.isEmpty()) { - Content serialFieldContent = new RawHtml(serialFieldTagDesc); - Content div = HtmlTree.DIV(HtmlStyle.block, serialFieldContent); - contentTree.addContent(div); - } - } - - /** - * Add the tag information for this member. - * - * @param field the field to document. - * @param contentTree the tree to which the member tags info will be added - */ - public void addMemberTags(FieldDoc field, Content contentTree) { - Content tagContent = new ContentBuilder(); - TagletWriter.genTagOuput(configuration.tagletManager, field, - configuration.tagletManager.getCustomTaglets(field), - writer.getTagletWriterInstance(false), tagContent); - Content dlTags = new HtmlTree(HtmlTag.DL); - dlTags.addContent(tagContent); - contentTree.addContent(dlTags); // TODO: what if empty? - } - - /** - * Check to see if overview details should be printed. If - * nocomment option set or if there is no text to be printed - * for deprecation info, comment or tags, do not print overview details. - * - * @param field the field to check overview details for. - * @return true if overview details need to be printed - */ - public boolean shouldPrintOverview(FieldDoc field) { - if (!configuration.nocomment) { - if(!field.commentText().isEmpty() || - writer.hasSerializationOverviewTags(field)) - return true; - } - if (field.tags("deprecated").length > 0) - return true; - return false; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.taglets.*; - -/** - * Generate serialized form for Serializable/Externalizable methods. - * Documentation denoted by the serialData tag is processed. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Joe Fialli - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class HtmlSerialMethodWriter extends MethodWriterImpl implements - SerializedFormWriter.SerialMethodWriter{ - - public HtmlSerialMethodWriter(SubWriterHolderWriter writer, - ClassDoc classdoc) { - super(writer, classdoc); - } - - /** - * Return the header for serializable methods section. - * - * @return a content tree for the header - */ - public Content getSerializableMethodsHeader() { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - return ul; - } - - /** - * Return the header for serializable methods content section. - * - * @param isLastContent true if the cotent being documented is the last content. - * @return a content tree for the header - */ - public Content getMethodsContentHeader(boolean isLastContent) { - HtmlTree li = new HtmlTree(HtmlTag.LI); - if (isLastContent) - li.addStyle(HtmlStyle.blockListLast); - else - li.addStyle(HtmlStyle.blockList); - return li; - } - - /** - * Add serializable methods. - * - * @param heading the heading for the section - * @param serializableMethodContent the tree to be added to the serializable methods - * content tree - * @return a content tree for the serializable methods content - */ - public Content getSerializableMethods(String heading, Content serializableMethodContent) { - Content headingContent = new StringContent(heading); - Content serialHeading = HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, - headingContent); - Content li = HtmlTree.LI(HtmlStyle.blockList, serialHeading); - li.addContent(serializableMethodContent); - return li; - } - - /** - * Return the no customization message. - * - * @param msg the message to be displayed - * @return no customization message content - */ - public Content getNoCustomizationMsg(String msg) { - Content noCustomizationMsg = new StringContent(msg); - return noCustomizationMsg; - } - - /** - * Add the member header. - * - * @param member the method document to be listed - * @param methodsContentTree the content tree to which the member header will be added - */ - public void addMemberHeader(MethodDoc member, Content methodsContentTree) { - methodsContentTree.addContent(getHead(member)); - methodsContentTree.addContent(getSignature(member)); - } - - /** - * Add the deprecated information for this member. - * - * @param member the method to document. - * @param methodsContentTree the tree to which the deprecated info will be added - */ - public void addDeprecatedMemberInfo(MethodDoc member, Content methodsContentTree) { - addDeprecatedInfo(member, methodsContentTree); - } - - /** - * Add the description text for this member. - * - * @param member the method to document. - * @param methodsContentTree the tree to which the deprecated info will be added - */ - public void addMemberDescription(MethodDoc member, Content methodsContentTree) { - addComment(member, methodsContentTree); - } - - /** - * Add the tag information for this member. - * - * @param member the method to document. - * @param methodsContentTree the tree to which the member tags info will be added - */ - public void addMemberTags(MethodDoc member, Content methodsContentTree) { - Content tagContent = new ContentBuilder(); - TagletManager tagletManager = - configuration.tagletManager; - TagletWriter.genTagOuput(tagletManager, member, - tagletManager.getSerializedFormTaglets(), - writer.getTagletWriterInstance(false), tagContent); - Content dlTags = new HtmlTree(HtmlTag.DL); - dlTags.addContent(tagContent); - methodsContentTree.addContent(dlTags); - MethodDoc method = member; - if (method.name().compareTo("writeExternal") == 0 - && method.tags("serialData").length == 0) { - serialWarning(member.position(), "doclet.MissingSerialDataTag", - method.containingClass().qualifiedName(), method.name()); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.util.List; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.ContentBuilder; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.doclets.internal.toolkit.util.links.*; - -/** - * A factory that returns a link given the information about it. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @since 1.5 - */ -@Deprecated -public class LinkFactoryImpl extends LinkFactory { - - private HtmlDocletWriter m_writer; - - public LinkFactoryImpl(HtmlDocletWriter writer) { - m_writer = writer; - } - - /** - * {@inheritDoc} - */ - protected Content newContent() { - return new ContentBuilder(); - } - - /** - * {@inheritDoc} - */ - protected Content getClassLink(LinkInfo linkInfo) { - LinkInfoImpl classLinkInfo = (LinkInfoImpl) linkInfo; - boolean noLabel = linkInfo.label == null || linkInfo.label.isEmpty(); - ClassDoc classDoc = classLinkInfo.classDoc; - //Create a tool tip if we are linking to a class or interface. Don't - //create one if we are linking to a member. - String title = - (classLinkInfo.where == null || classLinkInfo.where.length() == 0) ? - getClassToolTip(classDoc, - classLinkInfo.type != null && - !classDoc.qualifiedTypeName().equals(classLinkInfo.type.qualifiedTypeName())) : - ""; - Content label = classLinkInfo.getClassLinkLabel(m_writer.configuration); - Configuration configuration = m_writer.configuration; - Content link = new ContentBuilder(); - if (classDoc.isIncluded()) { - if (configuration.isGeneratedDoc(classDoc)) { - DocPath filename = getPath(classLinkInfo); - if (linkInfo.linkToSelf || - !(DocPath.forName(classDoc)).equals(m_writer.filename)) { - link.addContent(m_writer.getHyperLink( - filename.fragment(classLinkInfo.where), - label, - classLinkInfo.isStrong, classLinkInfo.styleName, - title, classLinkInfo.target)); - if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { - link.addContent(getTypeParameterLinks(linkInfo)); - } - return link; - } - } - } else { - Content crossLink = m_writer.getCrossClassLink( - classDoc.qualifiedName(), classLinkInfo.where, - label, classLinkInfo.isStrong, classLinkInfo.styleName, - true); - if (crossLink != null) { - link.addContent(crossLink); - if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { - link.addContent(getTypeParameterLinks(linkInfo)); - } - return link; - } - } - // Can't link so just write label. - link.addContent(label); - if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { - link.addContent(getTypeParameterLinks(linkInfo)); - } - return link; - } - - /** - * {@inheritDoc} - */ - protected Content getTypeParameterLink(LinkInfo linkInfo, - Type typeParam) { - LinkInfoImpl typeLinkInfo = new LinkInfoImpl(m_writer.configuration, - ((LinkInfoImpl) linkInfo).getContext(), typeParam); - typeLinkInfo.excludeTypeBounds = linkInfo.excludeTypeBounds; - typeLinkInfo.excludeTypeParameterLinks = linkInfo.excludeTypeParameterLinks; - typeLinkInfo.linkToSelf = linkInfo.linkToSelf; - typeLinkInfo.isJava5DeclarationLocation = false; - return getLink(typeLinkInfo); - } - - protected Content getTypeAnnotationLink(LinkInfo linkInfo, - AnnotationDesc annotation) { - throw new RuntimeException("Not implemented yet!"); - } - - public Content getTypeAnnotationLinks(LinkInfo linkInfo) { - ContentBuilder links = new ContentBuilder(); - AnnotationDesc[] annotations; - if (linkInfo.type instanceof AnnotatedType) { - annotations = linkInfo.type.asAnnotatedType().annotations(); - } else if (linkInfo.type instanceof TypeVariable) { - annotations = linkInfo.type.asTypeVariable().annotations(); - } else { - return links; - } - - if (annotations.length == 0) - return links; - - List annos = m_writer.getAnnotations(0, annotations, false, linkInfo.isJava5DeclarationLocation); - - boolean isFirst = true; - for (Content anno : annos) { - if (!isFirst) { - links.addContent(" "); - } - links.addContent(anno); - isFirst = false; - } - if (!annos.isEmpty()) { - links.addContent(" "); - } - - return links; - } - - /** - * Given a class, return the appropriate tool tip. - * - * @param classDoc the class to get the tool tip for. - * @return the tool tip for the appropriate class. - */ - private String getClassToolTip(ClassDoc classDoc, boolean isTypeLink) { - Configuration configuration = m_writer.configuration; - Utils utils = configuration.utils; - if (isTypeLink) { - return configuration.getText("doclet.Href_Type_Param_Title", - classDoc.name()); - } else if (classDoc.isInterface()){ - return configuration.getText("doclet.Href_Interface_Title", - utils.getPackageName(classDoc.containingPackage())); - } else if (classDoc.isAnnotationType()) { - return configuration.getText("doclet.Href_Annotation_Title", - utils.getPackageName(classDoc.containingPackage())); - } else if (classDoc.isEnum()) { - return configuration.getText("doclet.Href_Enum_Title", - utils.getPackageName(classDoc.containingPackage())); - } else { - return configuration.getText("doclet.Href_Class_Title", - utils.getPackageName(classDoc.containingPackage())); - } - } - - /** - * Return path to the given file name in the given package. So if the name - * passed is "Object.html" and the name of the package is "java.lang", and - * if the relative path is "../.." then returned string will be - * "../../java/lang/Object.html" - * - * @param linkInfo the information about the link. - */ - private DocPath getPath(LinkInfoImpl linkInfo) { - if (linkInfo.context == LinkInfoImpl.Kind.PACKAGE_FRAME) { - //Not really necessary to do this but we want to be consistent - //with 1.4.2 output. - return DocPath.forName(linkInfo.classDoc); - } - return m_writer.pathToRoot.resolve(DocPath.forClass(linkInfo.classDoc)); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.ContentBuilder; -import com.sun.tools.doclets.formats.html.markup.StringContent; -import com.sun.tools.doclets.internal.toolkit.Content; -import com.sun.tools.doclets.internal.toolkit.util.links.*; - -/** - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ -@Deprecated -public class LinkInfoImpl extends LinkInfo { - - public enum Kind { - DEFAULT, - - /** - * Indicate that the link appears in a class list. - */ - ALL_CLASSES_FRAME, - - /** - * Indicate that the link appears in a class documentation. - */ - CLASS, - - /** - * Indicate that the link appears in member documentation. - */ - MEMBER, - - /** - * Indicate that the link appears in class use documentation. - */ - CLASS_USE, - - /** - * Indicate that the link appears in index documentation. - */ - INDEX, - - /** - * Indicate that the link appears in constant value summary. - */ - CONSTANT_SUMMARY, - - /** - * Indicate that the link appears in serialized form documentation. - */ - SERIALIZED_FORM, - - /** - * Indicate that the link appears in serial member documentation. - */ - SERIAL_MEMBER, - - /** - * Indicate that the link appears in package documentation. - */ - PACKAGE, - - /** - * Indicate that the link appears in see tag documentation. - */ - SEE_TAG, - - /** - * Indicate that the link appears in value tag documentation. - */ - VALUE_TAG, - - /** - * Indicate that the link appears in tree documentation. - */ - TREE, - - /** - * Indicate that the link appears in a class list. - */ - PACKAGE_FRAME, - - /** - * The header in the class documentation. - */ - CLASS_HEADER, - - /** - * The signature in the class documentation. - */ - CLASS_SIGNATURE, - - /** - * The return type of a method. - */ - RETURN_TYPE, - - /** - * The return type of a method in a member summary. - */ - SUMMARY_RETURN_TYPE, - - /** - * The type of a method/constructor parameter. - */ - EXECUTABLE_MEMBER_PARAM, - - /** - * Super interface links. - */ - SUPER_INTERFACES, - - /** - * Implemented interface links. - */ - IMPLEMENTED_INTERFACES, - - /** - * Implemented class links. - */ - IMPLEMENTED_CLASSES, - - /** - * Subinterface links. - */ - SUBINTERFACES, - - /** - * Subclasses links. - */ - SUBCLASSES, - - /** - * The signature in the class documentation (implements/extends portion). - */ - CLASS_SIGNATURE_PARENT_NAME, - - /** - * The header for method documentation copied from parent. - */ - METHOD_DOC_COPY, - - /** - * Method "specified by" link. - */ - METHOD_SPECIFIED_BY, - - /** - * Method "overrides" link. - */ - METHOD_OVERRIDES, - - /** - * Annotation link. - */ - ANNOTATION, - - /** - * The header for field documentation copied from parent. - */ - FIELD_DOC_COPY, - - /** - * The parent nodes in the class tree. - */ - CLASS_TREE_PARENT, - - /** - * The type parameters of a method or constructor. - */ - MEMBER_TYPE_PARAMS, - - /** - * Indicate that the link appears in class use documentation. - */ - CLASS_USE_HEADER, - - /** - * The header for property documentation copied from parent. - */ - PROPERTY_DOC_COPY - } - - public final ConfigurationImpl configuration; - - /** - * The location of the link. - */ - public Kind context = Kind.DEFAULT; - - /** - * The value of the marker #. - */ - public String where = ""; - - /** - * String style of text defined in style sheet. - */ - public String styleName = ""; - - /** - * The value of the target. - */ - public String target = ""; - - /** - * Construct a LinkInfo object. - * - * @param configuration the configuration data for the doclet - * @param context the context of the link. - * @param context the context of the link. - * @param executableMemberDoc the member to link to. - */ - public LinkInfoImpl(ConfigurationImpl configuration, - Kind context, ExecutableMemberDoc executableMemberDoc) { - this.configuration = configuration; - this.executableMemberDoc = executableMemberDoc; - setContext(context); - } - - /** - * {@inheritDoc} - */ - protected Content newContent() { - return new ContentBuilder(); - } - - /** - * Construct a LinkInfo object. - * - * @param configuration the configuration data for the doclet - * @param context the context of the link. - * @param classDoc the class to link to. - */ - public LinkInfoImpl(ConfigurationImpl configuration, - Kind context, ClassDoc classDoc) { - this.configuration = configuration; - this.classDoc = classDoc; - setContext(context); - } - - /** - * Construct a LinkInfo object. - * - * @param configuration the configuration data for the doclet - * @param context the context of the link. - * @param type the class to link to. - */ - public LinkInfoImpl(ConfigurationImpl configuration, - Kind context, Type type) { - this.configuration = configuration; - this.type = type; - setContext(context); - } - - - /** - * Set the label for the link. - * @param label plain-text label for the link - */ - public LinkInfoImpl label(String label) { - this.label = new StringContent(label); - return this; - } - - /** - * Set the label for the link. - */ - public LinkInfoImpl label(Content label) { - this.label = label; - return this; - } - - /** - * Set whether or not the link should be strong. - */ - public LinkInfoImpl strong(boolean strong) { - this.isStrong = strong; - return this; - } - - /** - * Set the style to be used for the link. - * @param styleName String style of text defined in style sheet. - */ - public LinkInfoImpl styleName(String styleName) { - this.styleName = styleName; - return this; - } - - /** - * Set the target to be used for the link. - * @param styleName String style of text defined in style sheet. - */ - public LinkInfoImpl target(String target) { - this.target = target; - return this; - } - - /** - * Set whether or not this is a link to a varargs parameter. - */ - public LinkInfoImpl varargs(boolean varargs) { - this.isVarArg = varargs; - return this; - } - - /** - * Set the fragment specifier for the link. - */ - public LinkInfoImpl where(String where) { - this.where = where; - return this; - } - - /** - * {@inheritDoc} - */ - public Kind getContext() { - return context; - } - - /** - * {@inheritDoc} - * - * This method sets the link attributes to the appropriate values - * based on the context. - * - * @param c the context id to set. - */ - public final void setContext(Kind c) { - //NOTE: Put context specific link code here. - switch (c) { - case ALL_CLASSES_FRAME: - case PACKAGE_FRAME: - case IMPLEMENTED_CLASSES: - case SUBCLASSES: - case METHOD_DOC_COPY: - case FIELD_DOC_COPY: - case PROPERTY_DOC_COPY: - case CLASS_USE_HEADER: - includeTypeInClassLinkLabel = false; - break; - - case ANNOTATION: - excludeTypeParameterLinks = true; - excludeTypeBounds = true; - break; - - case IMPLEMENTED_INTERFACES: - case SUPER_INTERFACES: - case SUBINTERFACES: - case CLASS_TREE_PARENT: - case TREE: - case CLASS_SIGNATURE_PARENT_NAME: - excludeTypeParameterLinks = true; - excludeTypeBounds = true; - includeTypeInClassLinkLabel = false; - includeTypeAsSepLink = true; - break; - - case PACKAGE: - case CLASS_USE: - case CLASS_HEADER: - case CLASS_SIGNATURE: - excludeTypeParameterLinks = true; - includeTypeAsSepLink = true; - includeTypeInClassLinkLabel = false; - break; - - case MEMBER_TYPE_PARAMS: - includeTypeAsSepLink = true; - includeTypeInClassLinkLabel = false; - break; - - case RETURN_TYPE: - case SUMMARY_RETURN_TYPE: - excludeTypeBounds = true; - break; - case EXECUTABLE_MEMBER_PARAM: - excludeTypeBounds = true; - break; - } - context = c; - if (type != null && - type.asTypeVariable()!= null && - type.asTypeVariable().owner() instanceof ExecutableMemberDoc) { - excludeTypeParameterLinks = true; - } - } - - /** - * Return true if this link is linkable and false if we can't link to the - * desired place. - * - * @return true if this link is linkable and false if we can't link to the - * desired place. - */ - public boolean isLinkable() { - return configuration.utils.isLinkable(classDoc, configuration); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import com.sun.tools.doclets.internal.toolkit.util.links.*; - -/** - * Stores output of a link. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @since 1.5 - */ -@Deprecated -public class LinkOutputImpl implements LinkOutput { - - /** - * The output of the link. - */ - public StringBuilder output; - - /** - * Construct a new LinkOutputImpl. - */ - public LinkOutputImpl() { - output = new StringBuilder(); - } - - /** - * {@inheritDoc} - */ - public void append(Object o) { - output.append(o instanceof String ? - (String) o : ((LinkOutputImpl)o).toString()); - } - - /** - * {@inheritDoc} - */ - public void insert(int offset, Object o) { - output.insert(offset, o.toString()); - } - - /** - * {@inheritDoc} - */ - public String toString() { - return output.toString(); - } - -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java +++ /dev/null @@ -1,424 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.javac.util.StringUtils; - -/** - * Writes method documentation in HTML format. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert Field - * @author Atul M Dambalkar - * @author Jamie Ho (rewrite) - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class MethodWriterImpl extends AbstractExecutableMemberWriter - implements MethodWriter, MemberSummaryWriter { - - /** - * Construct a new MethodWriterImpl. - * - * @param writer the writer for the class that the methods belong to. - * @param classDoc the class being documented. - */ - public MethodWriterImpl(SubWriterHolderWriter writer, ClassDoc classDoc) { - super(writer, classDoc); - } - - /** - * Construct a new MethodWriterImpl. - * - * @param writer The writer for the class that the methods belong to. - */ - public MethodWriterImpl(SubWriterHolderWriter writer) { - super(writer); - } - - /** - * {@inheritDoc} - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree) { - memberSummaryTree.addContent(HtmlConstants.START_OF_METHOD_SUMMARY); - Content memberTree = writer.getMemberTreeHeader(); - writer.addSummaryHeader(this, classDoc, memberTree); - return memberTree; - } - - /** - * {@inheritDoc} - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - writer.addMemberTree(memberSummaryTree, memberTree); - } - - /** - * {@inheritDoc} - */ - public Content getMethodDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree) { - memberDetailsTree.addContent(HtmlConstants.START_OF_METHOD_DETAILS); - Content methodDetailsTree = writer.getMemberTreeHeader(); - methodDetailsTree.addContent(writer.getMarkerAnchor( - SectionName.METHOD_DETAIL)); - Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, - writer.methodDetailsLabel); - methodDetailsTree.addContent(heading); - return methodDetailsTree; - } - - /** - * {@inheritDoc} - */ - public Content getMethodDocTreeHeader(MethodDoc method, - Content methodDetailsTree) { - String erasureAnchor; - if ((erasureAnchor = getErasureAnchor(method)) != null) { - methodDetailsTree.addContent(writer.getMarkerAnchor((erasureAnchor))); - } - methodDetailsTree.addContent( - writer.getMarkerAnchor(writer.getAnchor(method))); - Content methodDocTree = writer.getMemberTreeHeader(); - Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); - heading.addContent(method.name()); - methodDocTree.addContent(heading); - return methodDocTree; - } - - /** - * Get the signature for the given method. - * - * @param method the method being documented. - * @return a content object for the signature - */ - public Content getSignature(MethodDoc method) { - Content pre = new HtmlTree(HtmlTag.PRE); - writer.addAnnotationInfo(method, pre); - int annotationLength = pre.charCount(); - addModifiers(method, pre); - addTypeParameters(method, pre); - addReturnType(method, pre); - if (configuration.linksource) { - Content methodName = new StringContent(method.name()); - writer.addSrcLink(method, methodName, pre); - } else { - addName(method.name(), pre); - } - int indent = pre.charCount() - annotationLength; - addParameters(method, pre, indent); - addExceptions(method, pre, indent); - return pre; - } - - /** - * {@inheritDoc} - */ - public void addDeprecated(MethodDoc method, Content methodDocTree) { - addDeprecatedInfo(method, methodDocTree); - } - - /** - * {@inheritDoc} - */ - public void addComments(Type holder, MethodDoc method, Content methodDocTree) { - ClassDoc holderClassDoc = holder.asClassDoc(); - if (method.inlineTags().length > 0) { - if (holder.asClassDoc().equals(classdoc) || - (! (holderClassDoc.isPublic() || - utils.isLinkable(holderClassDoc, configuration)))) { - writer.addInlineComment(method, methodDocTree); - } else { - Content link = - writer.getDocLink(LinkInfoImpl.Kind.METHOD_DOC_COPY, - holder.asClassDoc(), method, - holder.asClassDoc().isIncluded() ? - holder.typeName() : holder.qualifiedTypeName(), - false); - Content codelLink = HtmlTree.CODE(link); - Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.asClassDoc().isClass()? - writer.descfrmClassLabel : writer.descfrmInterfaceLabel); - descfrmLabel.addContent(writer.getSpace()); - descfrmLabel.addContent(codelLink); - methodDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); - writer.addInlineComment(method, methodDocTree); - } - } - } - - /** - * {@inheritDoc} - */ - public void addTags(MethodDoc method, Content methodDocTree) { - writer.addTagsInfo(method, methodDocTree); - } - - /** - * {@inheritDoc} - */ - public Content getMethodDetails(Content methodDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(methodDetailsTree)); - return htmlTree; - } - return getMemberTree(methodDetailsTree); - } - - /** - * {@inheritDoc} - */ - public Content getMethodDoc(Content methodDocTree, - boolean isLastContent) { - return getMemberTree(methodDocTree, isLastContent); - } - - /** - * Close the writer. - */ - public void close() throws IOException { - writer.close(); - } - - public int getMemberKind() { - return VisibleMemberMap.METHODS; - } - - /** - * {@inheritDoc} - */ - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - writer.getResource("doclet.Method_Summary")); - memberTree.addContent(label); - } - - /** - * {@inheritDoc} - */ - public String getTableSummary() { - return configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Method_Summary"), - configuration.getText("doclet.methods")); - } - - /** - * {@inheritDoc} - */ - public Content getCaption() { - return configuration.getResource("doclet.Methods"); - } - - /** - * {@inheritDoc} - */ - public String[] getSummaryTableHeader(ProgramElementDoc member) { - String[] header = new String[] { - writer.getModifierTypeHeader(), - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Method"), - configuration.getText("doclet.Description")) - }; - return header; - } - - /** - * {@inheritDoc} - */ - public void addSummaryAnchor(ClassDoc cd, Content memberTree) { - memberTree.addContent(writer.getMarkerAnchor( - SectionName.METHOD_SUMMARY)); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { - inheritedTree.addContent(writer.getMarkerAnchor( - SectionName.METHODS_INHERITANCE, configuration.getClassName(cd))); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { - Content classLink = writer.getPreQualifiedClassLink( - LinkInfoImpl.Kind.MEMBER, cd, false); - Content label = new StringContent(cd.isClass() ? - configuration.getText("doclet.Methods_Inherited_From_Class") : - configuration.getText("doclet.Methods_Inherited_From_Interface")); - Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, - label); - labelHeading.addContent(writer.getSpace()); - labelHeading.addContent(classLink); - inheritedTree.addContent(labelHeading); - } - - /** - * {@inheritDoc} - */ - protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { - MethodDoc meth = (MethodDoc)member; - addModifierAndType(meth, meth.returnType(), tdSummaryType); - } - - /** - * {@inheritDoc} - */ - protected static void addOverridden(HtmlDocletWriter writer, - Type overriddenType, MethodDoc method, Content dl) { - if (writer.configuration.nocomment) { - return; - } - ClassDoc holderClassDoc = overriddenType.asClassDoc(); - if (! (holderClassDoc.isPublic() || - writer.configuration.utils.isLinkable(holderClassDoc, writer.configuration))) { - //This is an implementation detail that should not be documented. - return; - } - if (overriddenType.asClassDoc().isIncluded() && ! method.isIncluded()) { - //The class is included but the method is not. That means that it - //is not visible so don't document this. - return; - } - Content label = writer.overridesLabel; - LinkInfoImpl.Kind context = LinkInfoImpl.Kind.METHOD_OVERRIDES; - - if (method != null) { - if (overriddenType.asClassDoc().isAbstract() && method.isAbstract()){ - //Abstract method is implemented from abstract class, - //not overridden - label = writer.specifiedByLabel; - context = LinkInfoImpl.Kind.METHOD_SPECIFIED_BY; - } - Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, label)); - dl.addContent(dt); - Content overriddenTypeLink = - writer.getLink(new LinkInfoImpl(writer.configuration, context, overriddenType)); - Content codeOverridenTypeLink = HtmlTree.CODE(overriddenTypeLink); - String name = method.name(); - Content methlink = writer.getLink( - new LinkInfoImpl(writer.configuration, LinkInfoImpl.Kind.MEMBER, - overriddenType.asClassDoc()) - .where(writer.getName(writer.getAnchor(method))).label(name)); - Content codeMethLink = HtmlTree.CODE(methlink); - Content dd = HtmlTree.DD(codeMethLink); - dd.addContent(writer.getSpace()); - dd.addContent(writer.getResource("doclet.in_class")); - dd.addContent(writer.getSpace()); - dd.addContent(codeOverridenTypeLink); - dl.addContent(dd); - } - } - - /** - * {@inheritDoc} - */ - protected static void addImplementsInfo(HtmlDocletWriter writer, - MethodDoc method, Content dl) { - if(writer.configuration.nocomment){ - return; - } - ImplementedMethods implementedMethodsFinder = - new ImplementedMethods(method, writer.configuration); - MethodDoc[] implementedMethods = implementedMethodsFinder.build(); - for (MethodDoc implementedMeth : implementedMethods) { - Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth); - Content intfaclink = writer.getLink(new LinkInfoImpl( - writer.configuration, LinkInfoImpl.Kind.METHOD_SPECIFIED_BY, intfac)); - Content codeIntfacLink = HtmlTree.CODE(intfaclink); - Content dt = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.overrideSpecifyLabel, writer.specifiedByLabel)); - dl.addContent(dt); - Content methlink = writer.getDocLink( - LinkInfoImpl.Kind.MEMBER, implementedMeth, - implementedMeth.name(), false); - Content codeMethLink = HtmlTree.CODE(methlink); - Content dd = HtmlTree.DD(codeMethLink); - dd.addContent(writer.getSpace()); - dd.addContent(writer.getResource("doclet.in_interface")); - dd.addContent(writer.getSpace()); - dd.addContent(codeIntfacLink); - dl.addContent(dd); - } - } - - /** - * Add the return type. - * - * @param method the method being documented. - * @param htmltree the content tree to which the return type will be added - */ - protected void addReturnType(MethodDoc method, Content htmltree) { - Type type = method.returnType(); - if (type != null) { - Content linkContent = writer.getLink( - new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type)); - htmltree.addContent(linkContent); - htmltree.addContent(writer.getSpace()); - } - } - - /** - * {@inheritDoc} - */ - protected Content getNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - if (cd == null) { - return writer.getHyperLink( - SectionName.METHOD_SUMMARY, - writer.getResource("doclet.navMethod")); - } else { - return writer.getHyperLink( - SectionName.METHODS_INHERITANCE, - configuration.getClassName(cd), writer.getResource("doclet.navMethod")); - } - } else { - return writer.getResource("doclet.navMethod"); - } - } - - /** - * {@inheritDoc} - */ - protected void addNavDetailLink(boolean link, Content liNav) { - if (link) { - liNav.addContent(writer.getHyperLink( - SectionName.METHOD_DETAIL, writer.getResource("doclet.navMethod"))); - } else { - liNav.addContent(writer.getResource("doclet.navMethod")); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Writes nested class documentation in HTML format. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert Field - * @author Atul M Dambalkar - * @author Jamie Ho (rewrite) - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class NestedClassWriterImpl extends AbstractMemberWriter - implements MemberSummaryWriter { - - public NestedClassWriterImpl(SubWriterHolderWriter writer, - ClassDoc classdoc) { - super(writer, classdoc); - } - - public NestedClassWriterImpl(SubWriterHolderWriter writer) { - super(writer); - } - - /** - * {@inheritDoc} - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree) { - memberSummaryTree.addContent(HtmlConstants.START_OF_NESTED_CLASS_SUMMARY); - Content memberTree = writer.getMemberTreeHeader(); - writer.addSummaryHeader(this, classDoc, memberTree); - return memberTree; - } - - /** - * {@inheritDoc} - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - writer.addMemberTree(memberSummaryTree, memberTree); - } - - /** - * Close the writer. - */ - public void close() throws IOException { - writer.close(); - } - - public int getMemberKind() { - return VisibleMemberMap.INNERCLASSES; - } - - /** - * {@inheritDoc} - */ - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - writer.getResource("doclet.Nested_Class_Summary")); - memberTree.addContent(label); - } - - /** - * {@inheritDoc} - */ - public String getTableSummary() { - return configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Nested_Class_Summary"), - configuration.getText("doclet.nested_classes")); - } - - /** - * {@inheritDoc} - */ - public Content getCaption() { - return configuration.getResource("doclet.Nested_Classes"); - } - - /** - * {@inheritDoc} - */ - public String[] getSummaryTableHeader(ProgramElementDoc member) { - String[] header; - if (member.isInterface()) { - header = new String[] { - writer.getModifierTypeHeader(), - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Interface"), - configuration.getText("doclet.Description")) - }; - } - else { - header = new String[] { - writer.getModifierTypeHeader(), - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Class"), - configuration.getText("doclet.Description")) - }; - } - return header; - } - - /** - * {@inheritDoc} - */ - public void addSummaryAnchor(ClassDoc cd, Content memberTree) { - memberTree.addContent(writer.getMarkerAnchor( - SectionName.NESTED_CLASS_SUMMARY)); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { - inheritedTree.addContent(writer.getMarkerAnchor( - SectionName.NESTED_CLASSES_INHERITANCE, - cd.qualifiedName())); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { - Content classLink = writer.getPreQualifiedClassLink( - LinkInfoImpl.Kind.MEMBER, cd, false); - Content label = new StringContent(cd.isInterface() ? - configuration.getText("doclet.Nested_Classes_Interface_Inherited_From_Interface") : - configuration.getText("doclet.Nested_Classes_Interfaces_Inherited_From_Class")); - Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, - label); - labelHeading.addContent(writer.getSpace()); - labelHeading.addContent(classLink); - inheritedTree.addContent(labelHeading); - } - - /** - * {@inheritDoc} - */ - protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member, - Content tdSummary) { - Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, - writer.getLink(new LinkInfoImpl(configuration, context, (ClassDoc)member))); - Content code = HtmlTree.CODE(memberLink); - tdSummary.addContent(code); - } - - /** - * {@inheritDoc} - */ - protected void addInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member, Content linksTree) { - linksTree.addContent( - writer.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, - (ClassDoc)member))); - } - - /** - * {@inheritDoc} - */ - protected void addSummaryType(ProgramElementDoc member, - Content tdSummaryType) { - ClassDoc cd = (ClassDoc)member; - addModifierAndType(cd, null, tdSummaryType); - } - - /** - * {@inheritDoc} - */ - protected Content getDeprecatedLink(ProgramElementDoc member) { - return writer.getQualifiedClassLink(LinkInfoImpl.Kind.MEMBER, - (ClassDoc)member); - } - - /** - * {@inheritDoc} - */ - protected Content getNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - if (cd == null) { - return writer.getHyperLink( - SectionName.NESTED_CLASS_SUMMARY, - writer.getResource("doclet.navNested")); - } else { - return writer.getHyperLink( - SectionName.NESTED_CLASSES_INHERITANCE, - cd.qualifiedName(), writer.getResource("doclet.navNested")); - } - } else { - return writer.getResource("doclet.navNested"); - } - } - - /** - * {@inheritDoc} - */ - protected void addNavDetailLink(boolean link, Content liNav) { - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Class to generate file for each package contents in the left-hand bottom - * frame. This will list all the Class Kinds in the package. A click on any - * class-kind will update the right-hand frame with the clicked class-kind page. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class PackageFrameWriter extends HtmlDocletWriter { - - /** - * The package being documented. - */ - private PackageDoc packageDoc; - - /** - * The classes to be documented. Use this to filter out classes - * that will not be documented. - */ - private Set documentedClasses; - - /** - * Constructor to construct PackageFrameWriter object and to generate - * "package-frame.html" file in the respective package directory. - * For example for package "java.lang" this will generate file - * "package-frame.html" file in the "java/lang" directory. It will also - * create "java/lang" directory in the current or the destination directory - * if it doesn't exist. - * - * @param configuration the configuration of the doclet. - * @param packageDoc PackageDoc under consideration. - */ - public PackageFrameWriter(ConfigurationImpl configuration, - PackageDoc packageDoc) - throws IOException { - super(configuration, DocPath.forPackage(packageDoc).resolve(DocPaths.PACKAGE_FRAME)); - this.packageDoc = packageDoc; - if (configuration.root.specifiedPackages().length == 0) { - documentedClasses = new HashSet<>(Arrays.asList(configuration.root.classes())); - } - } - - /** - * Generate a package summary page for the left-hand bottom frame. Construct - * the PackageFrameWriter object and then uses it generate the file. - * - * @param configuration the current configuration of the doclet. - * @param packageDoc The package for which "pacakge-frame.html" is to be generated. - */ - public static void generate(ConfigurationImpl configuration, - PackageDoc packageDoc) { - PackageFrameWriter packgen; - try { - packgen = new PackageFrameWriter(configuration, packageDoc); - String pkgName = configuration.utils.getPackageName(packageDoc); - HtmlTree body = packgen.getBody(false, packgen.getWindowTitle(pkgName)); - Content pkgNameContent = new StringContent(pkgName); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN() - : body; - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar, - packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent)); - htmlTree.addContent(heading); - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.indexContainer); - packgen.addClassListing(div); - htmlTree.addContent(div); - if (configuration.allowTag(HtmlTag.MAIN)) { - body.addContent(htmlTree); - } - packgen.printHtmlDocument( - configuration.metakeywords.getMetaKeywords(packageDoc), false, body); - packgen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), DocPaths.PACKAGE_FRAME.getPath()); - throw new DocletAbortException(exc); - } - } - - /** - * Add class listing for all the classes in this package. Divide class - * listing as per the class kind and generate separate listing for - * Classes, Interfaces, Exceptions and Errors. - * - * @param contentTree the content tree to which the listing will be added - */ - protected void addClassListing(HtmlTree contentTree) { - Configuration config = configuration; - if (packageDoc.isIncluded()) { - addClassKindListing(packageDoc.interfaces(), - getResource("doclet.Interfaces"), contentTree); - addClassKindListing(packageDoc.ordinaryClasses(), - getResource("doclet.Classes"), contentTree); - addClassKindListing(packageDoc.enums(), - getResource("doclet.Enums"), contentTree); - addClassKindListing(packageDoc.exceptions(), - getResource("doclet.Exceptions"), contentTree); - addClassKindListing(packageDoc.errors(), - getResource("doclet.Errors"), contentTree); - addClassKindListing(packageDoc.annotationTypes(), - getResource("doclet.AnnotationTypes"), contentTree); - } else { - String name = utils.getPackageName(packageDoc); - addClassKindListing(config.classDocCatalog.interfaces(name), - getResource("doclet.Interfaces"), contentTree); - addClassKindListing(config.classDocCatalog.ordinaryClasses(name), - getResource("doclet.Classes"), contentTree); - addClassKindListing(config.classDocCatalog.enums(name), - getResource("doclet.Enums"), contentTree); - addClassKindListing(config.classDocCatalog.exceptions(name), - getResource("doclet.Exceptions"), contentTree); - addClassKindListing(config.classDocCatalog.errors(name), - getResource("doclet.Errors"), contentTree); - addClassKindListing(config.classDocCatalog.annotationTypes(name), - getResource("doclet.AnnotationTypes"), contentTree); - } - } - - /** - * Add specific class kind listing. Also add label to the listing. - * - * @param arr Array of specific class kinds, namely Class or Interface or Exception or Error - * @param labelContent content tree of the label to be added - * @param contentTree the content tree to which the class kind listing will be added - */ - protected void addClassKindListing(ClassDoc[] arr, Content labelContent, - HtmlTree contentTree) { - arr = utils.filterOutPrivateClasses(arr, configuration.javafx); - if(arr.length > 0) { - Arrays.sort(arr); - boolean printedHeader = false; - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION() - : contentTree; - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.setTitle(labelContent); - for (ClassDoc classDoc : arr) { - if (documentedClasses != null && !documentedClasses.contains(classDoc)) { - continue; - } - if (!utils.isCoreClass(classDoc) || !configuration.isGeneratedDoc(classDoc)) { - continue; - } - if (!printedHeader) { - Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - true, labelContent); - htmlTree.addContent(heading); - printedHeader = true; - } - Content arr_i_name = new StringContent(classDoc.name()); - if (classDoc.isInterface()) - arr_i_name = HtmlTree.SPAN(HtmlStyle.interfaceName, arr_i_name); - Content link = getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.PACKAGE_FRAME, classDoc).label(arr_i_name).target("classFrame")); - Content li = HtmlTree.LI(link); - ul.addContent(li); - } - htmlTree.addContent(ul); - if (configuration.allowTag(HtmlTag.SECTION)) { - contentTree.addContent(htmlTree); - } - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.IOException; -import java.util.Collection; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate the package index for the left-hand frame in the generated output. - * A click on the package name in this frame will update the page in the bottom - * left hand frame with the listing of contents of the clicked package. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - */ -@Deprecated -public class PackageIndexFrameWriter extends AbstractPackageIndexWriter { - - /** - * Construct the PackageIndexFrameWriter object. - * - * @param filename Name of the package index file to be generated. - */ - public PackageIndexFrameWriter(ConfigurationImpl configuration, - DocPath filename) throws IOException { - super(configuration, filename); - } - - /** - * Generate the package index file named "overview-frame.html". - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration) { - PackageIndexFrameWriter packgen; - DocPath filename = DocPaths.OVERVIEW_FRAME; - try { - packgen = new PackageIndexFrameWriter(configuration, filename); - packgen.buildPackageIndexFile("doclet.Window_Overview", false); - packgen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(exc); - } - } - - /** - * {@inheritDoc} - */ - protected void addPackagesList(Collection packages, String text, - String tableSummary, Content body) { - Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, - packagesLabel); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN(HtmlStyle.indexContainer, heading) - : HtmlTree.DIV(HtmlStyle.indexContainer, heading); - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.setTitle(packagesLabel); - for (PackageDoc aPackage : packages) { - // Do not list the package if -nodeprecated option is set and the - // package is marked as deprecated. - if (aPackage != null && - (!(configuration.nodeprecated && utils.isDeprecated(aPackage)))) { - ul.addContent(getPackage(aPackage)); - } - } - htmlTree.addContent(ul); - body.addContent(htmlTree); - } - - /** - * Returns each package name as a separate link. - * - * @param pd PackageDoc - * @return content for the package link - */ - protected Content getPackage(PackageDoc pd) { - Content packageLinkContent; - Content packageLabel; - if (!pd.name().isEmpty()) { - packageLabel = getPackageLabel(pd.name()); - packageLinkContent = getHyperLink(pathString(pd, - DocPaths.PACKAGE_FRAME), packageLabel, "", - "packageFrame"); - } else { - packageLabel = new StringContent(""); - packageLinkContent = getHyperLink(DocPaths.PACKAGE_FRAME, - packageLabel, "", "packageFrame"); - } - Content li = HtmlTree.LI(packageLinkContent); - return li; - } - - /** - * {@inheritDoc} - */ - protected void addNavigationBarHeader(Content body) { - Content headerContent; - if (configuration.packagesheader.length() > 0) { - headerContent = new RawHtml(replaceDocRootDir(configuration.packagesheader)); - } else { - headerContent = new RawHtml(replaceDocRootDir(configuration.header)); - } - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, - HtmlStyle.bar, headerContent); - body.addContent(heading); - } - - /** - * Do nothing as there is no overview information in this page. - */ - protected void addOverviewHeader(Content body) { - } - - /** - * Adds "All Classes" link for the top of the left-hand frame page to the - * documentation tree. - * - * @param ul the Content object to which the "All Classes" link should be added - */ - protected void addAllClassesLink(Content ul) { - Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME, - allclassesLabel, "", "packageFrame"); - Content li = HtmlTree.LI(linkContent); - ul.addContent(li); - } - - /** - * {@inheritDoc} - */ - protected void addNavigationBarFooter(Content body) { - Content p = HtmlTree.P(getSpace()); - body.addContent(p); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate the package index page "overview-summary.html" for the right-hand - * frame. A click on the package name on this page will update the same frame - * with the "package-summary.html" file for the clicked package. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class PackageIndexWriter extends AbstractPackageIndexWriter { - - /** - * Root of the program structure. Used for "overview" documentation. - */ - private RootDoc root; - - /** - * Map representing the group of packages as specified on the command line. - * - * @see Group - */ - private Map> groupPackageMap; - - /** - * List to store the order groups as specified on the command line. - */ - private List groupList; - - /** - * HTML tree for main tag. - */ - private HtmlTree htmlTree = HtmlTree.MAIN(); - - /** - * Construct the PackageIndexWriter. Also constructs the grouping - * information as provided on the command line by "-group" option. Stores - * the order of groups specified by the user. - * - * @see Group - */ - public PackageIndexWriter(ConfigurationImpl configuration, - DocPath filename) - throws IOException { - super(configuration, filename); - this.root = configuration.root; - groupPackageMap = configuration.group.groupPackages(packages); - groupList = configuration.group.getGroupList(); - } - - /** - * Generate the package index page for the right-hand frame. - * - * @param configuration the current configuration of the doclet. - */ - public static void generate(ConfigurationImpl configuration) { - PackageIndexWriter packgen; - DocPath filename = DocPaths.OVERVIEW_SUMMARY; - try { - packgen = new PackageIndexWriter(configuration, filename); - packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", true); - packgen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(exc); - } - } - - /** - * Depending upon the grouping information and their titles, add - * separate table indices for each package group. - * - * @param body the documentation tree to which the index will be added - */ - protected void addIndex(Content body) { - for (String groupname : groupList) { - List list = groupPackageMap.get(groupname); - if (list != null && !list.isEmpty()) { - addIndexContents(list, - groupname, configuration.getText("doclet.Member_Table_Summary", - groupname, configuration.getText("doclet.packages")), body); - } - } - } - - /** - * {@inheritDoc} - */ - protected void addPackagesList(Collection packages, String text, - String tableSummary, Content body) { - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text))) - : HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text))); - table.addContent(getSummaryTableHeader(packageTableHeader, "col")); - Content tbody = new HtmlTree(HtmlTag.TBODY); - addPackagesList(packages, tbody); - table.addContent(tbody); - Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table); - if (configuration.allowTag(HtmlTag.MAIN)) { - htmlTree.addContent(div); - } else { - body.addContent(div); - } - } - - /** - * Adds list of packages in the index table. Generate link to each package. - * - * @param packages Packages to which link is to be generated - * @param tbody the documentation tree to which the list will be added - */ - protected void addPackagesList(Collection packages, Content tbody) { - boolean altColor = true; - for (PackageDoc pkg : packages) { - if (pkg != null && !pkg.name().isEmpty()) { - if (!(configuration.nodeprecated && utils.isDeprecated(pkg))) { - Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg)); - Content tdPackage = HtmlTree.TD(HtmlStyle.colFirst, packageLinkContent); - HtmlTree tdSummary = new HtmlTree(HtmlTag.TD); - tdSummary.addStyle(HtmlStyle.colLast); - addSummaryComment(pkg, tdSummary); - HtmlTree tr = HtmlTree.TR(tdPackage); - tr.addContent(tdSummary); - tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor); - tbody.addContent(tr); - } - } - altColor = !altColor; - } - } - - /** - * Adds the overview summary comment for this documentation. Add one line - * summary at the top of the page and generate a link to the description, - * which is added at the end of this page. - * - * @param body the documentation tree to which the overview header will be added - */ - protected void addOverviewHeader(Content body) { - addConfigurationTitle(body); - if (root.inlineTags().length > 0) { - HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV); - subTitleDiv.addStyle(HtmlStyle.subTitle); - addSummaryComment(root, subTitleDiv); - Content div = HtmlTree.DIV(HtmlStyle.header, subTitleDiv); - Content see = seeLabel; - see.addContent(" "); - Content descPara = HtmlTree.P(see); - Content descLink = getHyperLink(getDocLink( - SectionName.OVERVIEW_DESCRIPTION), - descriptionLabel, "", ""); - descPara.addContent(descLink); - div.addContent(descPara); - if (configuration.allowTag(HtmlTag.MAIN)) { - htmlTree.addContent(div); - } else { - body.addContent(div); - } - } - } - - /** - * Adds the overview comment as provided in the file specified by the - * "-overview" option on the command line. - * - * @param htmltree the documentation tree to which the overview comment will - * be added - */ - protected void addOverviewComment(Content htmltree) { - if (root.inlineTags().length > 0) { - htmltree.addContent( - getMarkerAnchor(SectionName.OVERVIEW_DESCRIPTION)); - addInlineComment(root, htmltree); - } - } - - /** - * Adds the tag information as provided in the file specified by the - * "-overview" option on the command line. - * - * @param body the documentation tree to which the overview will be added - */ - protected void addOverview(Content body) throws IOException { - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.contentContainer); - addOverviewComment(div); - addTagsInfo(root, div); - if (configuration.allowTag(HtmlTag.MAIN)) { - htmlTree.addContent(div); - body.addContent(htmlTree); - } else { - body.addContent(div); - } - } - - /** - * Adds the top text (from the -top option), the upper - * navigation bar, and then the title (from the"-title" - * option), at the top of page. - * - * @param body the documentation tree to which the navigation bar header will be added - */ - protected void addNavigationBarHeader(Content body) { - Content htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : body; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - body.addContent(htmlTree); - } - } - - /** - * Adds the lower navigation bar and the bottom text - * (from the -bottom option) at the bottom of page. - * - * @param body the documentation tree to which the navigation bar footer will be added - */ - protected void addNavigationBarFooter(Content body) { - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : body; - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Class to generate Tree page for a package. The name of the file generated is - * "package-tree.html" and it is generated in the respective package directory. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class PackageTreeWriter extends AbstractTreeWriter { - - /** - * Package for which tree is to be generated. - */ - protected PackageDoc packagedoc; - - /** - * The previous package name in the alpha-order list. - */ - protected PackageDoc prev; - - /** - * The next package name in the alpha-order list. - */ - protected PackageDoc next; - - /** - * Constructor. - * @throws IOException - * @throws DocletAbortException - */ - public PackageTreeWriter(ConfigurationImpl configuration, - DocPath path, - PackageDoc packagedoc, - PackageDoc prev, PackageDoc next) - throws IOException { - super(configuration, path, - new ClassTree( - configuration.classDocCatalog.allClasses(packagedoc), - configuration)); - this.packagedoc = packagedoc; - this.prev = prev; - this.next = next; - } - - /** - * Construct a PackageTreeWriter object and then use it to generate the - * package tree page. - * - * @param pkg Package for which tree file is to be generated. - * @param prev Previous package in the alpha-ordered list. - * @param next Next package in the alpha-ordered list. - * @param noDeprecated If true, do not generate any information for - * deprecated classe or interfaces. - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration, - PackageDoc pkg, PackageDoc prev, - PackageDoc next, boolean noDeprecated) { - PackageTreeWriter packgen; - DocPath path = DocPath.forPackage(pkg).resolve(DocPaths.PACKAGE_TREE); - try { - packgen = new PackageTreeWriter(configuration, path, pkg, - prev, next); - packgen.generatePackageTreeFile(); - packgen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), path.getPath()); - throw new DocletAbortException(exc); - } - } - - /** - * Generate a separate tree file for each package. - */ - protected void generatePackageTreeFile() throws IOException { - HtmlTree body = getPackageTreeHeader(); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN() - : body; - Content headContent = getResource("doclet.Hierarchy_For_Package", - utils.getPackageName(packagedoc)); - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, - HtmlStyle.title, headContent); - Content div = HtmlTree.DIV(HtmlStyle.header, heading); - if (configuration.packages.size() > 1) { - addLinkToMainTree(div); - } - htmlTree.addContent(div); - HtmlTree divTree = new HtmlTree(HtmlTag.DIV); - divTree.addStyle(HtmlStyle.contentContainer); - addTree(classtree.baseclasses(), "doclet.Class_Hierarchy", divTree); - addTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy", divTree); - addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); - addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree); - htmlTree.addContent(divTree); - if (configuration.allowTag(HtmlTag.MAIN)) { - body.addContent(htmlTree); - } - HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : body; - addNavLinks(false, tree); - addBottom(tree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(tree); - } - printHtmlDocument(null, true, body); - } - - /** - * Get the package tree header. - * - * @return a content tree for the header - */ - protected HtmlTree getPackageTreeHeader() { - String title = packagedoc.name() + " " + - configuration.getText("doclet.Window_Class_Hierarchy"); - HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - return bodyTree; - } - - /** - * Add a link to the tree for all the packages. - * - * @param div the content tree to which the link will be added - */ - protected void addLinkToMainTree(Content div) { - Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel, - getResource("doclet.Package_Hierarchies")); - div.addContent(span); - HtmlTree ul = new HtmlTree (HtmlTag.UL); - ul.addStyle(HtmlStyle.horizontal); - ul.addContent(getNavLinkMainTree(configuration.getText("doclet.All_Packages"))); - div.addContent(ul); - } - - /** - * Get link for the previous package tree file. - * - * @return a content tree for the link - */ - protected Content getNavLinkPrevious() { - if (prev == null) { - return getNavLinkPrevious(null); - } else { - DocPath path = DocPath.relativePath(packagedoc, prev); - return getNavLinkPrevious(path.resolve(DocPaths.PACKAGE_TREE)); - } - } - - /** - * Get link for the next package tree file. - * - * @return a content tree for the link - */ - protected Content getNavLinkNext() { - if (next == null) { - return getNavLinkNext(null); - } else { - DocPath path = DocPath.relativePath(packagedoc, next); - return getNavLinkNext(path.resolve(DocPaths.PACKAGE_TREE)); - } - } - - /** - * Get link to the package summary page for the package of this tree. - * - * @return a content tree for the package link - */ - protected Content getNavLinkPackage() { - Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY, - packageLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate package usage information. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert G. Field - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class PackageUseWriter extends SubWriterHolderWriter { - - final PackageDoc pkgdoc; - final SortedMap> usingPackageToUsedClasses = new TreeMap<>(); - protected HtmlTree mainTree = HtmlTree.MAIN(); - - /** - * Constructor. - * - * @param filename the file to be generated. - * @throws IOException - * @throws DocletAbortException - */ - public PackageUseWriter(ConfigurationImpl configuration, - ClassUseMapper mapper, DocPath filename, - PackageDoc pkgdoc) throws IOException { - super(configuration, DocPath.forPackage(pkgdoc).resolve(filename)); - this.pkgdoc = pkgdoc; - - // by examining all classes in this package, find what packages - // use these classes - produce a map between using package and - // used classes. - for (ClassDoc usedClass : pkgdoc.allClasses()) { - Set usingClasses = mapper.classToClass.get(usedClass.qualifiedName()); - if (usingClasses != null) { - for (ClassDoc usingClass : usingClasses) { - PackageDoc usingPackage = usingClass.containingPackage(); - Set usedClasses = usingPackageToUsedClasses - .get(usingPackage.name()); - if (usedClasses == null) { - usedClasses = new TreeSet<>(); - usingPackageToUsedClasses.put(utils.getPackageName(usingPackage), - usedClasses); - } - usedClasses.add(usedClass); - } - } - } - } - - /** - * Generate a class page. - * - * @param configuration the current configuration of the doclet. - * @param mapper the mapping of the class usage. - * @param pkgdoc the package doc being documented. - */ - public static void generate(ConfigurationImpl configuration, - ClassUseMapper mapper, PackageDoc pkgdoc) { - PackageUseWriter pkgusegen; - DocPath filename = DocPaths.PACKAGE_USE; - try { - pkgusegen = new PackageUseWriter(configuration, - mapper, filename, pkgdoc); - pkgusegen.generatePackageUseFile(); - pkgusegen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(exc); - } - } - - - /** - * Generate the package use list. - */ - protected void generatePackageUseFile() throws IOException { - HtmlTree body = getPackageUseHeader(); - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.contentContainer); - if (usingPackageToUsedClasses.isEmpty()) { - div.addContent(getResource( - "doclet.ClassUse_No.usage.of.0", pkgdoc.name())); - } else { - addPackageUse(div); - } - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - body.addContent(mainTree); - } else { - body.addContent(div); - } - HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : body; - addNavLinks(false, tree); - addBottom(tree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(tree); - } - printHtmlDocument(null, true, body); - } - - /** - * Add the package use information. - * - * @param contentTree the content tree to which the package use information will be added - */ - protected void addPackageUse(Content contentTree) throws IOException { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - if (configuration.packages.size() > 1) { - addPackageList(ul); - } - addClassList(ul); - contentTree.addContent(ul); - } - - /** - * Add the list of packages that use the given package. - * - * @param contentTree the content tree to which the package list will be added - */ - protected void addPackageList(Content contentTree) throws IOException { - Content caption = getTableCaption(configuration.getResource( - "doclet.ClassUse_Packages.that.use.0", - getPackageLink(pkgdoc, utils.getPackageName(pkgdoc)))); - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.useSummary, caption) - : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption); - table.addContent(getSummaryTableHeader(packageTableHeader, "col")); - Content tbody = new HtmlTree(HtmlTag.TBODY); - Iterator it = usingPackageToUsedClasses.keySet().iterator(); - for (int i = 0; it.hasNext(); i++) { - PackageDoc pkg = configuration.root.packageNamed(it.next()); - HtmlTree tr = new HtmlTree(HtmlTag.TR); - if (i % 2 == 0) { - tr.addStyle(HtmlStyle.altColor); - } else { - tr.addStyle(HtmlStyle.rowColor); - } - addPackageUse(pkg, tr); - tbody.addContent(tr); - } - table.addContent(tbody); - Content li = HtmlTree.LI(HtmlStyle.blockList, table); - contentTree.addContent(li); - } - - /** - * Add the list of classes that use the given package. - * - * @param contentTree the content tree to which the class list will be added - */ - protected void addClassList(Content contentTree) throws IOException { - String[] classTableHeader = new String[] { - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Class"), - configuration.getText("doclet.Description")) - }; - for (String packageName : usingPackageToUsedClasses.keySet()) { - PackageDoc usingPackage = configuration.root.packageNamed(packageName); - HtmlTree li = new HtmlTree(HtmlTag.LI); - li.addStyle(HtmlStyle.blockList); - if (usingPackage != null) { - li.addContent(getMarkerAnchor(usingPackage.name())); - } - String tableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.classes")); - Content caption = getTableCaption(configuration.getResource( - "doclet.ClassUse_Classes.in.0.used.by.1", - getPackageLink(pkgdoc, utils.getPackageName(pkgdoc)), - getPackageLink(usingPackage, utils.getPackageName(usingPackage)))); - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.useSummary, caption) - : HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption); - table.addContent(getSummaryTableHeader(classTableHeader, "col")); - Content tbody = new HtmlTree(HtmlTag.TBODY); - Iterator itc = - usingPackageToUsedClasses.get(packageName).iterator(); - for (int i = 0; itc.hasNext(); i++) { - HtmlTree tr = new HtmlTree(HtmlTag.TR); - if (i % 2 == 0) { - tr.addStyle(HtmlStyle.altColor); - } else { - tr.addStyle(HtmlStyle.rowColor); - } - addClassRow(itc.next(), usingPackage, tr); - tbody.addContent(tr); - } - table.addContent(tbody); - li.addContent(table); - contentTree.addContent(li); - } - } - - /** - * Add a row for the class that uses the given package. - * - * @param usedClass the class that uses the given package - * @param pkg the package to which the class belongs - * @param contentTree the content tree to which the row will be added - */ - protected void addClassRow(ClassDoc usedClass, PackageDoc pkg, - Content contentTree) { - DocPath dp = pathString(usedClass, - DocPaths.CLASS_USE.resolve(DocPath.forName(usedClass))); - Content td = HtmlTree.TD(HtmlStyle.colOne, - getHyperLink(dp.fragment(getPackageAnchorName(pkg)), new StringContent(usedClass.name()))); - addIndexComment(usedClass, td); - contentTree.addContent(td); - } - - /** - * Add the package use information. - * - * @param pkg the package that used the given package - * @param contentTree the content tree to which the information will be added - */ - protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException { - Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst, - getHyperLink(utils.getPackageName(pkg), - new StringContent(utils.getPackageName(pkg)))); - contentTree.addContent(tdFirst); - HtmlTree tdLast = new HtmlTree(HtmlTag.TD); - tdLast.addStyle(HtmlStyle.colLast); - if (pkg != null && pkg.name().length() != 0) { - addSummaryComment(pkg, tdLast); - } else { - tdLast.addContent(getSpace()); - } - contentTree.addContent(tdLast); - } - - /** - * Get the header for the package use listing. - * - * @return a content tree representing the package use header - */ - protected HtmlTree getPackageUseHeader() { - String packageText = configuration.getText("doclet.Package"); - String name = pkgdoc.name(); - String title = configuration.getText("doclet.Window_ClassUse_Header", - packageText, name); - HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - ContentBuilder headContent = new ContentBuilder(); - headContent.addContent(getResource("doclet.ClassUse_Title", packageText)); - headContent.addContent(new HtmlTree(HtmlTag.BR)); - headContent.addContent(name); - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, - HtmlStyle.title, headContent); - Content div = HtmlTree.DIV(HtmlStyle.header, heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } - return bodyTree; - } - - /** - * Get this package link. - * - * @return a content tree for the package link - */ - protected Content getNavLinkPackage() { - Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY, - packageLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } - - /** - * Get the use link. - * - * @return a content tree for the use link - */ - protected Content getNavLinkClassUse() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, useLabel); - return li; - } - - /** - * Get the tree link. - * - * @return a content tree for the tree link - */ - protected Content getNavLinkTree() { - Content linkContent = getHyperLink(DocPaths.PACKAGE_TREE, - treeLabel); - Content li = HtmlTree.LI(linkContent); - return li; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Class to generate file for each package contents in the right-hand - * frame. This will list all the Class Kinds in the package. A click on any - * class-kind will update the frame with the clicked class-kind page. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class PackageWriterImpl extends HtmlDocletWriter - implements PackageSummaryWriter { - - /** - * The prev package name in the alpha-order list. - */ - protected PackageDoc prev; - - /** - * The next package name in the alpha-order list. - */ - protected PackageDoc next; - - /** - * The package being documented. - */ - protected PackageDoc packageDoc; - - /** - * The HTML tree for main tag. - */ - protected HtmlTree mainTree = HtmlTree.MAIN(); - - /** - * The HTML tree for section tag. - */ - protected HtmlTree sectionTree = HtmlTree.SECTION(); - - /** - * Constructor to construct PackageWriter object and to generate - * "package-summary.html" file in the respective package directory. - * For example for package "java.lang" this will generate file - * "package-summary.html" file in the "java/lang" directory. It will also - * create "java/lang" directory in the current or the destination directory - * if it doesn't exist. - * - * @param configuration the configuration of the doclet. - * @param packageDoc PackageDoc under consideration. - * @param prev Previous package in the sorted array. - * @param next Next package in the sorted array. - */ - public PackageWriterImpl(ConfigurationImpl configuration, - PackageDoc packageDoc, PackageDoc prev, PackageDoc next) - throws IOException { - super(configuration, DocPath.forPackage(packageDoc).resolve(DocPaths.PACKAGE_SUMMARY)); - this.prev = prev; - this.next = next; - this.packageDoc = packageDoc; - } - - /** - * {@inheritDoc} - */ - public Content getPackageHeader(String heading) { - HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageDoc))); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.header); - Content annotationContent = new HtmlTree(HtmlTag.P); - addAnnotationInfo(packageDoc, annotationContent); - div.addContent(annotationContent); - Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, - HtmlStyle.title, packageLabel); - tHeading.addContent(getSpace()); - Content packageHead = new StringContent(heading); - tHeading.addContent(packageHead); - div.addContent(tHeading); - addDeprecationInfo(div); - if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) { - HtmlTree docSummaryDiv = new HtmlTree(HtmlTag.DIV); - docSummaryDiv.addStyle(HtmlStyle.docSummary); - addSummaryComment(packageDoc, docSummaryDiv); - div.addContent(docSummaryDiv); - Content space = getSpace(); - Content descLink = getHyperLink(getDocLink( - SectionName.PACKAGE_DESCRIPTION), - descriptionLabel, "", ""); - Content descPara = new HtmlTree(HtmlTag.P, seeLabel, space, descLink); - div.addContent(descPara); - } - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } - return bodyTree; - } - - /** - * {@inheritDoc} - */ - public Content getContentHeader() { - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.contentContainer); - return div; - } - - /** - * Add the package deprecation information to the documentation tree. - * - * @param div the content tree to which the deprecation information will be added - */ - public void addDeprecationInfo(Content div) { - Tag[] deprs = packageDoc.tags("deprecated"); - if (utils.isDeprecated(packageDoc)) { - HtmlTree deprDiv = new HtmlTree(HtmlTag.DIV); - deprDiv.addStyle(HtmlStyle.deprecatedContent); - Content deprPhrase = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); - deprDiv.addContent(deprPhrase); - if (deprs.length > 0) { - Tag[] commentTags = deprs[0].inlineTags(); - if (commentTags.length > 0) { - addInlineDeprecatedComment(packageDoc, deprs[0], deprDiv); - } - } - div.addContent(deprDiv); - } - } - - /** - * {@inheritDoc} - */ - public Content getSummaryHeader() { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - return ul; - } - - /** - * {@inheritDoc} - */ - public void addClassesSummary(ClassDoc[] classes, String label, - String tableSummary, String[] tableHeader, Content summaryContentTree) { - if(classes.length > 0) { - Arrays.sort(classes); - Content caption = getTableCaption(new RawHtml(label)); - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.typeSummary, caption) - : HtmlTree.TABLE(HtmlStyle.typeSummary, tableSummary, caption); - table.addContent(getSummaryTableHeader(tableHeader, "col")); - Content tbody = new HtmlTree(HtmlTag.TBODY); - for (int i = 0; i < classes.length; i++) { - if (!utils.isCoreClass(classes[i]) || - !configuration.isGeneratedDoc(classes[i])) { - continue; - } - Content classContent = getLink(new LinkInfoImpl( - configuration, LinkInfoImpl.Kind.PACKAGE, classes[i])); - Content tdClass = HtmlTree.TD(HtmlStyle.colFirst, classContent); - HtmlTree tr = HtmlTree.TR(tdClass); - if (i%2 == 0) - tr.addStyle(HtmlStyle.altColor); - else - tr.addStyle(HtmlStyle.rowColor); - HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD); - tdClassDescription.addStyle(HtmlStyle.colLast); - if (utils.isDeprecated(classes[i])) { - tdClassDescription.addContent(deprecatedLabel); - if (classes[i].tags("deprecated").length > 0) { - addSummaryDeprecatedComment(classes[i], - classes[i].tags("deprecated")[0], tdClassDescription); - } - } - else - addSummaryComment(classes[i], tdClassDescription); - tr.addContent(tdClassDescription); - tbody.addContent(tr); - } - table.addContent(tbody); - Content li = HtmlTree.LI(HtmlStyle.blockList, table); - summaryContentTree.addContent(li); - } - } - - /** - * {@inheritDoc} - */ - public void addPackageDescription(Content packageContentTree) { - if (packageDoc.inlineTags().length > 0) { - packageContentTree.addContent( - getMarkerAnchor(SectionName.PACKAGE_DESCRIPTION)); - Content h2Content = new StringContent( - configuration.getText("doclet.Package_Description", - packageDoc.name())); - Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, h2Content); - if (configuration.allowTag(HtmlTag.SECTION)) { - sectionTree.addContent(heading); - addInlineComment(packageDoc, sectionTree); - } else { - packageContentTree.addContent(heading); - addInlineComment(packageDoc, packageContentTree); - } - } - } - - /** - * {@inheritDoc} - */ - public void addPackageTags(Content packageContentTree) { - Content htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? sectionTree - : packageContentTree; - addTagsInfo(packageDoc, htmlTree); - } - - /** - * {@inheritDoc} - */ - public void addPackageContent(Content contentTree, Content packageContentTree) { - if (configuration.allowTag(HtmlTag.MAIN)) { - packageContentTree.addContent(sectionTree); - mainTree.addContent(packageContentTree); - contentTree.addContent(mainTree); - } else { - contentTree.addContent(packageContentTree); - } - } - - /** - * {@inheritDoc} - */ - public void addPackageFooter(Content contentTree) { - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : contentTree; - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - contentTree.addContent(htmlTree); - } - } - - /** - * {@inheritDoc} - */ - public void printDocument(Content contentTree) throws IOException { - printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageDoc), - true, contentTree); - } - - /** - * Get "Use" link for this pacakge in the navigation bar. - * - * @return a content tree for the class use link - */ - protected Content getNavLinkClassUse() { - Content useLink = getHyperLink(DocPaths.PACKAGE_USE, - useLabel, "", ""); - Content li = HtmlTree.LI(useLink); - return li; - } - - /** - * Get "PREV PACKAGE" link in the navigation bar. - * - * @return a content tree for the previous link - */ - public Content getNavLinkPrevious() { - Content li; - if (prev == null) { - li = HtmlTree.LI(prevpackageLabel); - } else { - DocPath path = DocPath.relativePath(packageDoc, prev); - li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY), - prevpackageLabel, "", "")); - } - return li; - } - - /** - * Get "NEXT PACKAGE" link in the navigation bar. - * - * @return a content tree for the next link - */ - public Content getNavLinkNext() { - Content li; - if (next == null) { - li = HtmlTree.LI(nextpackageLabel); - } else { - DocPath path = DocPath.relativePath(packageDoc, next); - li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY), - nextpackageLabel, "", "")); - } - return li; - } - - /** - * Get "Tree" link in the navigation bar. This will be link to the package - * tree file. - * - * @return a content tree for the tree link - */ - protected Content getNavLinkTree() { - Content useLink = getHyperLink(DocPaths.PACKAGE_TREE, - treeLabel, "", ""); - Content li = HtmlTree.LI(useLink); - return li; - } - - /** - * Highlight "Package" in the navigation bar, as this is the package page. - * - * @return a content tree for the package link - */ - protected Content getNavLinkPackage() { - Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, packageLabel); - return li; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Writes property documentation in HTML format. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert Field - * @author Atul M Dambalkar - * @author Jamie Ho (rewrite) - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class PropertyWriterImpl extends AbstractMemberWriter - implements PropertyWriter, MemberSummaryWriter { - - public PropertyWriterImpl(SubWriterHolderWriter writer, ClassDoc classdoc) { - super(writer, classdoc); - } - - /** - * {@inheritDoc} - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree) { - memberSummaryTree.addContent(HtmlConstants.START_OF_PROPERTY_SUMMARY); - Content memberTree = writer.getMemberTreeHeader(); - writer.addSummaryHeader(this, classDoc, memberTree); - return memberTree; - } - - /** - * {@inheritDoc} - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - writer.addMemberTree(memberSummaryTree, memberTree); - } - - /** - * {@inheritDoc} - */ - public Content getPropertyDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree) { - memberDetailsTree.addContent(HtmlConstants.START_OF_PROPERTY_DETAILS); - Content propertyDetailsTree = writer.getMemberTreeHeader(); - propertyDetailsTree.addContent(writer.getMarkerAnchor( - SectionName.PROPERTY_DETAIL)); - Content heading = HtmlTree.HEADING(HtmlConstants.DETAILS_HEADING, - writer.propertyDetailsLabel); - propertyDetailsTree.addContent(heading); - return propertyDetailsTree; - } - - /** - * {@inheritDoc} - */ - public Content getPropertyDocTreeHeader(MethodDoc property, - Content propertyDetailsTree) { - propertyDetailsTree.addContent( - writer.getMarkerAnchor(property.name())); - Content propertyDocTree = writer.getMemberTreeHeader(); - Content heading = new HtmlTree(HtmlConstants.MEMBER_HEADING); - heading.addContent(property.name().substring(0, property.name().lastIndexOf("Property"))); - propertyDocTree.addContent(heading); - return propertyDocTree; - } - - /** - * {@inheritDoc} - */ - public Content getSignature(MethodDoc property) { - Content pre = new HtmlTree(HtmlTag.PRE); - writer.addAnnotationInfo(property, pre); - addModifiers(property, pre); - Content propertylink = writer.getLink(new LinkInfoImpl( - configuration, LinkInfoImpl.Kind.MEMBER, - property.returnType())); - pre.addContent(propertylink); - pre.addContent(" "); - if (configuration.linksource) { - Content propertyName = new StringContent(property.name()); - writer.addSrcLink(property, propertyName, pre); - } else { - addName(property.name(), pre); - } - return pre; - } - - /** - * {@inheritDoc} - */ - public void addDeprecated(MethodDoc property, Content propertyDocTree) { - } - - /** - * {@inheritDoc} - */ - public void addComments(MethodDoc property, Content propertyDocTree) { - ClassDoc holder = property.containingClass(); - if (property.inlineTags().length > 0) { - if (holder.equals(classdoc) || - (! (holder.isPublic() || utils.isLinkable(holder, configuration)))) { - writer.addInlineComment(property, propertyDocTree); - } else { - Content link = - writer.getDocLink(LinkInfoImpl.Kind.PROPERTY_DOC_COPY, - holder, property, - holder.isIncluded() ? - holder.typeName() : holder.qualifiedTypeName(), - false); - Content codeLink = HtmlTree.CODE(link); - Content descfrmLabel = HtmlTree.SPAN(HtmlStyle.descfrmTypeLabel, holder.isClass()? - writer.descfrmClassLabel : writer.descfrmInterfaceLabel); - descfrmLabel.addContent(writer.getSpace()); - descfrmLabel.addContent(codeLink); - propertyDocTree.addContent(HtmlTree.DIV(HtmlStyle.block, descfrmLabel)); - writer.addInlineComment(property, propertyDocTree); - } - } - } - - /** - * {@inheritDoc} - */ - public void addTags(MethodDoc property, Content propertyDocTree) { - writer.addTagsInfo(property, propertyDocTree); - } - - /** - * {@inheritDoc} - */ - public Content getPropertyDetails(Content propertyDetailsTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(propertyDetailsTree)); - return htmlTree; - } - return getMemberTree(propertyDetailsTree); - } - - /** - * {@inheritDoc} - */ - public Content getPropertyDoc(Content propertyDocTree, - boolean isLastContent) { - return getMemberTree(propertyDocTree, isLastContent); - } - - /** - * Close the writer. - */ - public void close() throws IOException { - writer.close(); - } - - public int getMemberKind() { - return VisibleMemberMap.PROPERTIES; - } - - /** - * {@inheritDoc} - */ - public void addSummaryLabel(Content memberTree) { - Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - writer.getResource("doclet.Property_Summary")); - memberTree.addContent(label); - } - - /** - * {@inheritDoc} - */ - public String getTableSummary() { - return configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Property_Summary"), - configuration.getText("doclet.properties")); - } - - /** - * {@inheritDoc} - */ - public Content getCaption() { - return configuration.getResource("doclet.Properties"); - } - - /** - * {@inheritDoc} - */ - public String[] getSummaryTableHeader(ProgramElementDoc member) { - String[] header = new String[] { - configuration.getText("doclet.Type"), - configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Property"), - configuration.getText("doclet.Description")) - }; - return header; - } - - /** - * {@inheritDoc} - */ - public void addSummaryAnchor(ClassDoc cd, Content memberTree) { - memberTree.addContent(writer.getMarkerAnchor( - SectionName.PROPERTY_SUMMARY)); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryAnchor(ClassDoc cd, Content inheritedTree) { - inheritedTree.addContent(writer.getMarkerAnchor( - SectionName.PROPERTIES_INHERITANCE, - configuration.getClassName(cd))); - } - - /** - * {@inheritDoc} - */ - public void addInheritedSummaryLabel(ClassDoc cd, Content inheritedTree) { - Content classLink = writer.getPreQualifiedClassLink( - LinkInfoImpl.Kind.MEMBER, cd, false); - Content label = new StringContent(cd.isClass() ? - configuration.getText("doclet.Properties_Inherited_From_Class") : - configuration.getText("doclet.Properties_Inherited_From_Interface")); - Content labelHeading = HtmlTree.HEADING(HtmlConstants.INHERITED_SUMMARY_HEADING, - label); - labelHeading.addContent(writer.getSpace()); - labelHeading.addContent(classLink); - inheritedTree.addContent(labelHeading); - } - - /** - * {@inheritDoc} - */ - protected void addSummaryLink(LinkInfoImpl.Kind context, ClassDoc cd, ProgramElementDoc member, - Content tdSummary) { - Content memberLink = HtmlTree.SPAN(HtmlStyle.memberNameLink, - writer.getDocLink(context, cd, - (MemberDoc) member, - member.name().substring(0, member.name().lastIndexOf("Property")), - false, - true)); - - Content code = HtmlTree.CODE(memberLink); - tdSummary.addContent(code); - } - - /** - * {@inheritDoc} - */ - protected void addInheritedSummaryLink(ClassDoc cd, - ProgramElementDoc member, Content linksTree) { - linksTree.addContent( - writer.getDocLink(LinkInfoImpl.Kind.MEMBER, cd, (MemberDoc)member, - ((member.name().lastIndexOf("Property") != -1) && configuration.javafx) - ? member.name().substring(0, member.name().length() - "Property".length()) - : member.name(), - false, true)); - } - - /** - * {@inheritDoc} - */ - protected void addSummaryType(ProgramElementDoc member, Content tdSummaryType) { - MethodDoc property = (MethodDoc)member; - addModifierAndType(property, property.returnType(), tdSummaryType); - } - - /** - * {@inheritDoc} - */ - protected Content getDeprecatedLink(ProgramElementDoc member) { - return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, - (MemberDoc) member, ((MethodDoc)member).qualifiedName()); - } - - /** - * {@inheritDoc} - */ - protected Content getNavSummaryLink(ClassDoc cd, boolean link) { - if (link) { - if (cd == null) { - return writer.getHyperLink( - SectionName.PROPERTY_SUMMARY, - writer.getResource("doclet.navProperty")); - } else { - return writer.getHyperLink( - SectionName.PROPERTIES_INHERITANCE, - configuration.getClassName(cd), writer.getResource("doclet.navProperty")); - } - } else { - return writer.getResource("doclet.navProperty"); - } - } - - /** - * {@inheritDoc} - */ - protected void addNavDetailLink(boolean link, Content liNav) { - if (link) { - liNav.addContent(writer.getHyperLink( - SectionName.PROPERTY_DETAIL, - writer.getResource("doclet.navProperty"))); - } else { - liNav.addContent(writer.getResource("doclet.navProperty")); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SearchIndexItem.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SearchIndexItem.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SearchIndexItem.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -/** - * Index item for search. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ -@Deprecated -public class SearchIndexItem { - - private String label = ""; - private String url = ""; - private String category = ""; - private String containingPackage = ""; - private String containingClass = ""; - private String holder = ""; - private String description = ""; - - public void setLabel(String l) { - label = l; - } - - public String getLabel() { - return label; - } - - public void setUrl(String u) { - url = u; - } - - public String getUrl() { - return url; - } - - public void setContainingPackage(String p) { - containingPackage = p; - } - - public void setContainingClass(String c) { - containingClass = c; - } - - public void setCategory(String c) { - category = c; - } - - public void setHolder(String h) { - holder = h; - } - - public String getHolder() { - return holder; - } - - public void setDescription(String d) { - description = d; - } - - public String getDescription() { - return description; - } - - public String toString() { - StringBuilder item = new StringBuilder(""); - if (category.equals("Packages")) { - item.append("{") - .append("\"l\":\"").append(label).append("\"") - .append("}"); - } else if (category.equals("Types")) { - item.append("{") - .append("\"p\":\"").append(containingPackage).append("\",") - .append("\"l\":\"").append(label).append("\"") - .append("}"); - } else if (category.equals("Members")) { - item.append("{") - .append("\"p\":\"").append(containingPackage).append("\",") - .append("\"c\":\"").append(containingClass).append("\",") - .append("\"l\":\"").append(label).append("\""); - if (!url.equals("")) { - item.append(",\"url\":\"").append(url).append("\""); - } - item.append("}"); - } else { - item.append("{") - .append("\"l\":\"").append(label).append("\",") - .append("\"h\":\"").append(holder).append("\","); - if (!description.equals("")) { - item.append("\"d\":\"").append(description).append("\","); - } - item.append("\"u\":\"").append(url).append("\"") - .append("}"); - } - return item.toString(); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SectionName.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SectionName.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SectionName.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -/** - * Enum representing various section names of generated API documentation. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public enum SectionName { - - ANNOTATION_TYPE_ELEMENT_DETAIL("annotation.type.element.detail"), - ANNOTATION_TYPE_FIELD_DETAIL("annotation.type.field.detail"), - ANNOTATION_TYPE_FIELD_SUMMARY("annotation.type.field.summary"), - ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY("annotation.type.optional.element.summary"), - ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY("annotation.type.required.element.summary"), - CONSTRUCTOR_DETAIL("constructor.detail"), - CONSTRUCTOR_SUMMARY("constructor.summary"), - ENUM_CONSTANT_DETAIL("enum.constant.detail"), - ENUM_CONSTANTS_INHERITANCE("enum.constants.inherited.from.class."), - ENUM_CONSTANT_SUMMARY("enum.constant.summary"), - FIELD_DETAIL("field.detail"), - FIELDS_INHERITANCE("fields.inherited.from.class."), - FIELD_SUMMARY("field.summary"), - METHOD_DETAIL("method.detail"), - METHODS_INHERITANCE("methods.inherited.from.class."), - METHOD_SUMMARY("method.summary"), - NAVBAR_BOTTOM("navbar.bottom"), - NAVBAR_BOTTOM_FIRSTROW("navbar.bottom.firstrow"), - NAVBAR_TOP("navbar.top"), - NAVBAR_TOP_FIRSTROW("navbar.top.firstrow"), - NESTED_CLASSES_INHERITANCE("nested.classes.inherited.from.class."), - NESTED_CLASS_SUMMARY("nested.class.summary"), - OVERVIEW_DESCRIPTION("overview.description"), - PACKAGE_DESCRIPTION("package.description"), - PROPERTY_DETAIL("property.detail"), - PROPERTIES_INHERITANCE("properties.inherited.from.class."), - PROPERTY_SUMMARY("property.summary"), - SKIP_NAVBAR_BOTTOM("skip.navbar.bottom"), - SKIP_NAVBAR_TOP("skip.navbar.top"), - UNNAMED_PACKAGE_ANCHOR("unnamed.package"); - - private final String value; - - SectionName(String sName) { - this.value = sName; - } - - public String getName() { - return this.value; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.DocPaths; -import com.sun.tools.doclets.internal.toolkit.util.DocletAbortException; - -/** - * Generate the Serialized Form Information Page. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - */ -@Deprecated -public class SerializedFormWriterImpl extends SubWriterHolderWriter - implements SerializedFormWriter { - - List visibleClasses; - - /** - * HTML tree for main tag. - */ - private HtmlTree mainTree = HtmlTree.MAIN(); - - /** - * @param configuration the configuration data for the doclet - * @throws IOException - * @throws DocletAbortException - */ - public SerializedFormWriterImpl(ConfigurationImpl configuration) - throws IOException { - super(configuration, DocPaths.SERIALIZED_FORM); - visibleClasses = Arrays.asList(configuration.root.classes()); - } - - /** - * Get the given header. - * - * @param header the header to write - * @return the body content tree - */ - public Content getHeader(String header) { - HtmlTree bodyTree = getBody(true, getWindowTitle(header)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - Content h1Content = new StringContent(header); - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true, - HtmlStyle.title, h1Content); - Content div = HtmlTree.DIV(HtmlStyle.header, heading); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(div); - } else { - bodyTree.addContent(div); - } - return bodyTree; - } - - /** - * Get the serialized form summaries header. - * - * @return the serialized form summary header tree - */ - public Content getSerializedSummariesHeader() { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - return ul; - } - - /** - * Get the package serialized form header. - * - * @return the package serialized form header tree - */ - public Content getPackageSerializedHeader() { - HtmlTree htmlTree; - if (configuration.allowTag(HtmlTag.SECTION)) { - htmlTree = HtmlTree.SECTION(); - } else { - htmlTree = new HtmlTree(HtmlTag.LI); - htmlTree.addStyle(HtmlStyle.blockList); - } - return htmlTree; - } - - /** - * Get the given package header. - * - * @param packageName the package header to write - * @return a content tree for the package header - */ - public Content getPackageHeader(String packageName) { - Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, - packageLabel); - heading.addContent(getSpace()); - heading.addContent(packageName); - return heading; - } - - /** - * Get the serialized class header. - * - * @return a content tree for the serialized class header - */ - public Content getClassSerializedHeader() { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - return ul; - } - - /** - * Checks if a class is generated and is visible. - * - * @param classDoc the class being processed. - * @return true if the class, that is being processed, is generated and is visible. - */ - public boolean isVisibleClass(ClassDoc classDoc) { - return visibleClasses.contains(classDoc) && configuration.isGeneratedDoc(classDoc); - } - - /** - * Get the serializable class heading. - * - * @param classDoc the class being processed - * @return a content tree for the class header - */ - public Content getClassHeader(ClassDoc classDoc) { - Content classLink = (isVisibleClass(classDoc)) ? - getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, classDoc) - .label(configuration.getClassName(classDoc))) : - new StringContent(classDoc.qualifiedName()); - Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor( - classDoc.qualifiedName())); - Content superClassLink = - classDoc.superclassType() != null ? - getLink(new LinkInfoImpl(configuration, - LinkInfoImpl.Kind.SERIALIZED_FORM, - classDoc.superclassType())) : - null; - - //Print the heading. - Content className = superClassLink == null ? - configuration.getResource( - "doclet.Class_0_implements_serializable", classLink) : - configuration.getResource( - "doclet.Class_0_extends_implements_serializable", classLink, - superClassLink); - li.addContent(HtmlTree.HEADING(HtmlConstants.SERIALIZED_MEMBER_HEADING, - className)); - return li; - } - - /** - * Get the serial UID info header. - * - * @return a content tree for the serial uid info header - */ - public Content getSerialUIDInfoHeader() { - HtmlTree dl = new HtmlTree(HtmlTag.DL); - dl.addStyle(HtmlStyle.nameValue); - return dl; - } - - /** - * Adds the serial UID info. - * - * @param header the header that will show up before the UID. - * @param serialUID the serial UID to print. - * @param serialUidTree the serial UID content tree to which the serial UID - * content will be added - */ - public void addSerialUIDInfo(String header, String serialUID, - Content serialUidTree) { - Content headerContent = new StringContent(header); - serialUidTree.addContent(HtmlTree.DT(headerContent)); - Content serialContent = new StringContent(serialUID); - serialUidTree.addContent(HtmlTree.DD(serialContent)); - } - - /** - * Get the class serialize content header. - * - * @return a content tree for the class serialize content header - */ - public Content getClassContentHeader() { - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.blockList); - return ul; - } - - /** - * Get the serialized content tree section. - * - * @param serializedTreeContent the serialized content tree to be added - * @return a div content tree - */ - public Content getSerializedContent(Content serializedTreeContent) { - HtmlTree divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer, - serializedTreeContent); - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(divContent); - return mainTree; - } else { - return divContent; - } - } - - /** - * {@inheritDoc} - */ - public void addPackageSerializedTree(Content serializedSummariesTree, - Content packageSerializedTree) { - serializedSummariesTree.addContent((configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.LI(HtmlStyle.blockList, packageSerializedTree) - : packageSerializedTree); - } - - /** - * Add the footer. - * - * @param serializedTree the serialized tree to be added - */ - public void addFooter(Content serializedTree) { - Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER)) - ? HtmlTree.FOOTER() - : serializedTree; - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - serializedTree.addContent(htmlTree); - } - } - - /** - * {@inheritDoc} - */ - public void printDocument(Content serializedTree) throws IOException { - printHtmlDocument(null, true, serializedTree); - } - - /** - * Return an instance of a SerialFieldWriter. - * - * @return an instance of a SerialFieldWriter. - */ - public SerialFieldWriter getSerialFieldWriter(ClassDoc classDoc) { - return new HtmlSerialFieldWriter(this, classDoc); - } - - /** - * Return an instance of a SerialMethodWriter. - * - * @return an instance of a SerialMethodWriter. - */ - public SerialMethodWriter getSerialMethodWriter(ClassDoc classDoc) { - return new HtmlSerialMethodWriter(this, classDoc); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate only one index file for all the Member Names with Indexing in - * Unicode Order. The name of the generated file is "index-all.html" and it is - * generated in current or the destination directory. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @see java.lang.Character - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class SingleIndexWriter extends AbstractIndexWriter { - - private List elements; - - /** - * Construct the SingleIndexWriter with filename "index-all.html" and the - * {@link IndexBuilder} - * - * @param filename Name of the index file to be generated. - * @param indexbuilder Unicode based Index from {@link IndexBuilder} - */ - public SingleIndexWriter(ConfigurationImpl configuration, - DocPath filename, - IndexBuilder indexbuilder) throws IOException { - super(configuration, filename, indexbuilder); - } - - /** - * Generate single index file, for all Unicode characters. - * - * @param indexbuilder IndexBuilder built by {@link IndexBuilder} - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration, - IndexBuilder indexbuilder) { - SingleIndexWriter indexgen; - DocPath filename = DocPaths.INDEX_ALL; - try { - indexgen = new SingleIndexWriter(configuration, - filename, indexbuilder); - indexgen.generateIndexFile(); - indexgen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(exc); - } - } - - /** - * Generate the contents of each index file, with Header, Footer, - * Member Field, Method and Constructor Description. - */ - protected void generateIndexFile() throws IOException { - String title = configuration.getText("doclet.Window_Single_Index"); - HtmlTree body = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : body; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - body.addContent(htmlTree); - } - HtmlTree divTree = new HtmlTree(HtmlTag.DIV); - divTree.addStyle(HtmlStyle.contentContainer); - Set keys = new TreeSet<>(Arrays.asList(indexbuilder.elements())); - keys.addAll(configuration.tagSearchIndexKeys); - elements = new ArrayList<>(keys); - addLinksForIndexes(divTree); - for (Object ch : elements) { - Character unicode = (Character) ch; - if (configuration.tagSearchIndexMap.get(unicode) == null) { - addContents(unicode, indexbuilder.getMemberList(unicode), divTree); - } else if (indexbuilder.getMemberList(unicode) == null) { - addSearchContents(unicode, configuration.tagSearchIndexMap.get(unicode), divTree); - } else { - addContents(unicode, indexbuilder.getMemberList(unicode), - configuration.tagSearchIndexMap.get(unicode), divTree); - } - } - addLinksForIndexes(divTree); - body.addContent((configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN(divTree) - : divTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - htmlTree = HtmlTree.FOOTER(); - } - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } - createSearchIndexFiles(); - printHtmlDocument(null, true, body); - } - - /** - * Add links for all the Index Files per unicode character. - * - * @param contentTree the content tree to which the links for indexes will be added - */ - protected void addLinksForIndexes(Content contentTree) { - for (Object ch : elements) { - String unicode = ch.toString(); - contentTree.addContent( - getHyperLink(getNameForIndex(unicode), - new StringContent(unicode))); - contentTree.addContent(getSpace()); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; - -import javax.tools.FileObject; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.javadoc.main.SourcePositionImpl; - -/** - * Converts Java Source Code to HTML. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.4 - */ -@Deprecated -public class SourceToHTMLConverter { - - /** - * The number of trailing blank lines at the end of the page. - * This is inserted so that anchors at the bottom of small pages - * can be reached. - */ - private static final int NUM_BLANK_LINES = 60; - - /** - * New line to be added to the documentation. - */ - private static final String NEW_LINE = DocletConstants.NL; - - private final ConfigurationImpl configuration; - private final Utils utils; - - private final RootDoc rootDoc; - - private DocPath outputdir; - - /** - * Relative path from the documentation root to the file that is being - * generated. - */ - private DocPath relativePath = DocPath.empty; - - private SourceToHTMLConverter(ConfigurationImpl configuration, RootDoc rd, - DocPath outputdir) { - this.configuration = configuration; - this.utils = configuration.utils; - this.rootDoc = rd; - this.outputdir = outputdir; - } - - /** - * Convert the Classes in the given RootDoc to an HTML. - * - * @param configuration the configuration. - * @param rd the RootDoc to convert. - * @param outputdir the name of the directory to output to. - */ - public static void convertRoot(ConfigurationImpl configuration, RootDoc rd, - DocPath outputdir) { - new SourceToHTMLConverter(configuration, rd, outputdir).generate(); - } - - void generate() { - if (rootDoc == null || outputdir == null) { - return; - } - for (PackageDoc pd : rootDoc.specifiedPackages()) { - // If -nodeprecated option is set and the package is marked as deprecated, - // do not convert the package files to HTML. - if (!(configuration.nodeprecated && utils.isDeprecated(pd))) - convertPackage(pd, outputdir); - } - for (ClassDoc cd : rootDoc.specifiedClasses()) { - // If -nodeprecated option is set and the class is marked as deprecated - // or the containing package is deprecated, do not convert the - // package files to HTML. - if (!(configuration.nodeprecated && - (utils.isDeprecated(cd) || utils.isDeprecated(cd.containingPackage())))) - convertClass(cd, outputdir); - } - } - - /** - * Convert the Classes in the given Package to an HTML. - * - * @param pd the Package to convert. - * @param outputdir the name of the directory to output to. - */ - public void convertPackage(PackageDoc pd, DocPath outputdir) { - if (pd == null) { - return; - } - for (ClassDoc cd : pd.allClasses()) { - // If -nodeprecated option is set and the class is marked as deprecated, - // do not convert the package files to HTML. We do not check for - // containing package deprecation since it is already check in - // the calling method above. - if (!(configuration.nodeprecated && utils.isDeprecated(cd))) - convertClass(cd, outputdir); - } - } - - /** - * Convert the given Class to an HTML. - * - * @param cd the class to convert. - * @param outputdir the name of the directory to output to. - */ - public void convertClass(ClassDoc cd, DocPath outputdir) { - if (cd == null) { - return; - } - try { - SourcePosition sp = cd.position(); - if (sp == null) - return; - Reader r; - // temp hack until we can update SourcePosition API. - if (sp instanceof SourcePositionImpl) { - FileObject fo = ((SourcePositionImpl) sp).fileObject(); - if (fo == null) - return; - r = fo.openReader(true); - } else { - File file = sp.file(); - if (file == null) - return; - r = new FileReader(file); - } - int lineno = 1; - String line; - relativePath = DocPaths.SOURCE_OUTPUT - .resolve(DocPath.forPackage(cd)) - .invert(); - Content body = getHeader(); - Content pre = new HtmlTree(HtmlTag.PRE); - try (LineNumberReader reader = new LineNumberReader(r)) { - while ((line = reader.readLine()) != null) { - addLineNo(pre, lineno); - addLine(pre, line, lineno); - lineno++; - } - } - addBlankLines(pre); - Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre); - body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(div) : div); - writeToFile(body, outputdir.resolve(DocPath.forClass(cd))); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * Write the output to the file. - * - * @param body the documentation content to be written to the file. - * @param path the path for the file. - */ - private void writeToFile(Content body, DocPath path) throws IOException { - Content htmlDocType = configuration.isOutputHtml5() - ? DocType.HTML5 - : DocType.TRANSITIONAL; - Content head = new HtmlTree(HtmlTag.HEAD); - head.addContent(HtmlTree.TITLE(new StringContent( - configuration.getText("doclet.Window_Source_title")))); - head.addContent(getStyleSheetProperties()); - Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), - head, body); - Content htmlDocument = new HtmlDocument(htmlDocType, htmlTree); - configuration.message.notice("doclet.Generating_0", path.getPath()); - DocFile df = DocFile.createFileForOutput(configuration, path); - try (Writer w = df.openWriter()) { - htmlDocument.write(w, true); - } - - } - - /** - * Returns a link to the stylesheet file. - * - * @return an HtmlTree for the lINK tag which provides the stylesheet location - */ - public HtmlTree getStyleSheetProperties() { - String filename = configuration.stylesheetfile; - DocPath stylesheet; - if (filename.length() > 0) { - DocFile file = DocFile.createFileForInput(configuration, filename); - stylesheet = DocPath.create(file.getName()); - } else { - stylesheet = DocPaths.STYLESHEET; - } - DocPath p = relativePath.resolve(stylesheet); - HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", p.getPath(), "Style"); - return link; - } - - /** - * Get the header. - * - * @return the header content for the HTML file - */ - private static Content getHeader() { - return new HtmlTree(HtmlTag.BODY); - } - - /** - * Add the line numbers for the source code. - * - * @param pre the content tree to which the line number will be added - * @param lineno The line number - */ - private static void addLineNo(Content pre, int lineno) { - HtmlTree span = new HtmlTree(HtmlTag.SPAN); - span.addStyle(HtmlStyle.sourceLineNo); - if (lineno < 10) { - span.addContent("00" + Integer.toString(lineno)); - } else if (lineno < 100) { - span.addContent("0" + Integer.toString(lineno)); - } else { - span.addContent(Integer.toString(lineno)); - } - pre.addContent(span); - } - - /** - * Add a line from source to the HTML file that is generated. - * - * @param pre the content tree to which the line will be added. - * @param line the string to format. - * @param currentLineNo the current number. - */ - private void addLine(Content pre, String line, int currentLineNo) { - if (line != null) { - Content anchor = HtmlTree.A(configuration.htmlVersion, - "line." + Integer.toString(currentLineNo), - new StringContent(utils.replaceTabs(configuration, line))); - pre.addContent(anchor); - pre.addContent(NEW_LINE); - } - } - - /** - * Add trailing blank lines at the end of the page. - * - * @param pre the content tree to which the blank lines will be added. - */ - private static void addBlankLines(Content pre) { - for (int i = 0; i < NUM_BLANK_LINES; i++) { - pre.addContent(NEW_LINE); - } - } - - /** - * Given a Doc, return an anchor name for it. - * - * @param d the Doc to check. - * @return the name of the anchor. - */ - public static String getAnchorName(Doc d) { - return "line." + d.position().line(); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate Separate Index Files for all the member names with Indexing in - * Unicode Order. This will create "index-files" directory in the current or - * destination directory and will generate separate file for each unicode index. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @see java.lang.Character - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class SplitIndexWriter extends AbstractIndexWriter { - - /** - * Previous unicode character index in the built index. - */ - protected int prev; - - /** - * Next unicode character in the built index. - */ - protected int next; - - private List indexElements; - - /** - * Construct the SplitIndexWriter. Uses path to this file and relative path - * from this file. - * - * @param path Path to the file which is getting generated. - * @param indexbuilder Unicode based Index from {@link IndexBuilder} - */ - public SplitIndexWriter(ConfigurationImpl configuration, - DocPath path, - IndexBuilder indexbuilder, List elements, - int prev, int next) throws IOException { - super(configuration, path, indexbuilder); - this.indexElements = elements; - this.prev = prev; - this.next = next; - } - - /** - * Generate separate index files, for each Unicode character, listing all - * the members starting with the particular unicode character. - * - * @param indexbuilder IndexBuilder built by {@link IndexBuilder} - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration, - IndexBuilder indexbuilder) { - SplitIndexWriter indexgen; - DocPath filename = DocPath.empty; - DocPath path = DocPaths.INDEX_FILES; - try { - Set keys = new TreeSet<>(Arrays.asList(indexbuilder.elements())); - keys.addAll(configuration.tagSearchIndexKeys); - List elements = new ArrayList<>(keys); - ListIterator li = elements.listIterator(); - while (li.hasNext()) { - Object ch = li.next(); - filename = DocPaths.indexN(li.nextIndex()); - indexgen = new SplitIndexWriter(configuration, - path.resolve(filename), - indexbuilder, elements, li.previousIndex(), li.nextIndex()); - indexgen.generateIndexFile((Character) ch); - if (!li.hasNext()) { - indexgen.createSearchIndexFiles(); - } - indexgen.close(); - } - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename.getPath()); - throw new DocletAbortException(exc); - } - } - - /** - * Generate the contents of each index file, with Header, Footer, - * Member Field, Method and Constructor Description. - * - * @param unicode Unicode character referring to the character for the - * index. - */ - protected void generateIndexFile(Character unicode) throws IOException { - String title = configuration.getText("doclet.Window_Split_Index", - unicode.toString()); - HtmlTree body = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : body; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - body.addContent(htmlTree); - } - HtmlTree divTree = new HtmlTree(HtmlTag.DIV); - divTree.addStyle(HtmlStyle.contentContainer); - addLinksForIndexes(divTree); - if (configuration.tagSearchIndexMap.get(unicode) == null) { - addContents(unicode, indexbuilder.getMemberList(unicode), divTree); - } else if (indexbuilder.getMemberList(unicode) == null) { - addSearchContents(unicode, configuration.tagSearchIndexMap.get(unicode), divTree); - } else { - addContents(unicode, indexbuilder.getMemberList(unicode), - configuration.tagSearchIndexMap.get(unicode), divTree); - } - addLinksForIndexes(divTree); - body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(divTree) : divTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - htmlTree = HtmlTree.FOOTER(); - } - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } - printHtmlDocument(null, true, body); - } - - /** - * Add links for all the Index Files per unicode character. - * - * @param contentTree the content tree to which the links for indexes will be added - */ - protected void addLinksForIndexes(Content contentTree) { - for (int i = 0; i < indexElements.size(); i++) { - int j = i + 1; - contentTree.addContent(getHyperLink(DocPaths.indexN(j), - new StringContent(indexElements.get(i).toString()))); - contentTree.addContent(getSpace()); - } - } - - /** - * Get link to the previous unicode character. - * - * @return a content tree for the link - */ - public Content getNavLinkPrevious() { - Content prevletterLabel = getResource("doclet.Prev_Letter"); - if (prev == -1) { - return HtmlTree.LI(prevletterLabel); - } - else { - Content prevLink = getHyperLink(DocPaths.indexN(prev), - prevletterLabel); - return HtmlTree.LI(prevLink); - } - } - - /** - * Get link to the next unicode character. - * - * @return a content tree for the link - */ - public Content getNavLinkNext() { - Content nextletterLabel = getResource("doclet.Next_Letter"); - if (next == -1) { - return HtmlTree.LI(nextletterLabel); - } - else { - Content nextLink = getHyperLink(DocPaths.indexN(next), - nextletterLabel); - return HtmlTree.LI(nextLink); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java +++ /dev/null @@ -1,362 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * This abstract class exists to provide functionality needed in the - * the formatting of member information. Since AbstractSubWriter and its - * subclasses control this, they would be the logical place to put this. - * However, because each member type has its own subclass, subclassing - * can not be used effectively to change formatting. The concrete - * class subclass of this class can be subclassed to change formatting. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @see AbstractMemberWriter - * @see ClassWriterImpl - * - * @author Robert Field - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public abstract class SubWriterHolderWriter extends HtmlDocletWriter { - - /** - * The HTML tree for main tag. - */ - protected HtmlTree mainTree = HtmlTree.MAIN(); - - public SubWriterHolderWriter(ConfigurationImpl configuration, DocPath filename) - throws IOException { - super(configuration, filename); - } - - /** - * Add the summary header. - * - * @param mw the writer for the member being documented - * @param cd the classdoc to be documented - * @param memberTree the content tree to which the summary header will be added - */ - public void addSummaryHeader(AbstractMemberWriter mw, ClassDoc cd, - Content memberTree) { - mw.addSummaryAnchor(cd, memberTree); - mw.addSummaryLabel(memberTree); - } - - /** - * Get the summary table. - * - * @param mw the writer for the member being documented - * @param cd the classdoc to be documented - * @param tableContents list of summary table contents - * @param showTabs true if the table needs to show tabs - * @return the content tree for the summary table - */ - public Content getSummaryTableTree(AbstractMemberWriter mw, ClassDoc cd, - List tableContents, boolean showTabs) { - Content caption; - if (showTabs) { - caption = getTableCaption(mw.methodTypes); - generateMethodTypesScript(mw.typeMap, mw.methodTypes); - } - else { - caption = getTableCaption(mw.getCaption()); - } - Content table = (configuration.isOutputHtml5()) - ? HtmlTree.TABLE(HtmlStyle.memberSummary, caption) - : HtmlTree.TABLE(HtmlStyle.memberSummary, mw.getTableSummary(), caption); - table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col")); - for (Content tableContent : tableContents) { - table.addContent(tableContent); - } - return table; - } - - /** - * Get the summary table caption. - * - * @param methodTypes set comprising of method types to show as table caption - * @return the caption for the summary table - */ - public Content getTableCaption(Set methodTypes) { - Content tabbedCaption = new HtmlTree(HtmlTag.CAPTION); - for (MethodTypes type : methodTypes) { - Content captionSpan; - Content span; - if (type.isDefaultTab()) { - captionSpan = HtmlTree.SPAN(configuration.getResource(type.resourceKey())); - span = HtmlTree.SPAN(type.tabId(), - HtmlStyle.activeTableTab, captionSpan); - } else { - captionSpan = HtmlTree.SPAN(getMethodTypeLinks(type)); - span = HtmlTree.SPAN(type.tabId(), - HtmlStyle.tableTab, captionSpan); - } - Content tabSpan = HtmlTree.SPAN(HtmlStyle.tabEnd, getSpace()); - span.addContent(tabSpan); - tabbedCaption.addContent(span); - } - return tabbedCaption; - } - - /** - * Get the method type links for the table caption. - * - * @param methodType the method type to be displayed as link - * @return the content tree for the method type link - */ - public Content getMethodTypeLinks(MethodTypes methodType) { - String jsShow = "javascript:show(" + methodType.value() +");"; - HtmlTree link = HtmlTree.A(jsShow, configuration.getResource(methodType.resourceKey())); - return link; - } - - /** - * Add the inherited summary header. - * - * @param mw the writer for the member being documented - * @param cd the classdoc to be documented - * @param inheritedTree the content tree to which the inherited summary header will be added - */ - public void addInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd, - Content inheritedTree) { - mw.addInheritedSummaryAnchor(cd, inheritedTree); - mw.addInheritedSummaryLabel(cd, inheritedTree); - } - - /** - * Add the index comment. - * - * @param member the member being documented - * @param contentTree the content tree to which the comment will be added - */ - protected void addIndexComment(Doc member, Content contentTree) { - addIndexComment(member, member.firstSentenceTags(), contentTree); - } - - /** - * Add the index comment. - * - * @param member the member being documented - * @param firstSentenceTags the first sentence tags for the member to be documented - * @param tdSummary the content tree to which the comment will be added - */ - protected void addIndexComment(Doc member, Tag[] firstSentenceTags, - Content tdSummary) { - Tag[] deprs = member.tags("deprecated"); - Content div; - if (utils.isDeprecated((ProgramElementDoc) member)) { - Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); - div = HtmlTree.DIV(HtmlStyle.block, deprLabel); - div.addContent(getSpace()); - if (deprs.length > 0) { - addInlineDeprecatedComment(member, deprs[0], div); - } - tdSummary.addContent(div); - return; - } else { - ClassDoc cd = ((ProgramElementDoc)member).containingClass(); - if (cd != null && utils.isDeprecated(cd)) { - Content deprLabel = HtmlTree.SPAN(HtmlStyle.deprecatedLabel, deprecatedPhrase); - div = HtmlTree.DIV(HtmlStyle.block, deprLabel); - div.addContent(getSpace()); - tdSummary.addContent(div); - } - } - addSummaryComment(member, firstSentenceTags, tdSummary); - } - - /** - * Add the summary type for the member. - * - * @param mw the writer for the member being documented - * @param member the member to be documented - * @param tdSummaryType the content tree to which the type will be added - */ - public void addSummaryType(AbstractMemberWriter mw, ProgramElementDoc member, - Content tdSummaryType) { - mw.addSummaryType(member, tdSummaryType); - } - - /** - * Add the summary link for the member. - * - * @param mw the writer for the member being documented - * @param member the member to be documented - * @param contentTree the content tree to which the link will be added - */ - public void addSummaryLinkComment(AbstractMemberWriter mw, - ProgramElementDoc member, Content contentTree) { - addSummaryLinkComment(mw, member, member.firstSentenceTags(), contentTree); - } - - /** - * Add the summary link comment. - * - * @param mw the writer for the member being documented - * @param member the member being documented - * @param firstSentenceTags the first sentence tags for the member to be documented - * @param tdSummary the content tree to which the comment will be added - */ - public void addSummaryLinkComment(AbstractMemberWriter mw, - ProgramElementDoc member, Tag[] firstSentenceTags, Content tdSummary) { - addIndexComment(member, firstSentenceTags, tdSummary); - } - - /** - * Add the inherited member summary. - * - * @param mw the writer for the member being documented - * @param cd the class being documented - * @param member the member being documented - * @param isFirst true if its the first link being documented - * @param linksTree the content tree to which the summary will be added - */ - public void addInheritedMemberSummary(AbstractMemberWriter mw, ClassDoc cd, - ProgramElementDoc member, boolean isFirst, Content linksTree) { - if (! isFirst) { - linksTree.addContent(", "); - } - mw.addInheritedSummaryLink(cd, member, linksTree); - } - - /** - * Get the document content header tree - * - * @return a content tree the document content header - */ - public Content getContentHeader() { - HtmlTree div = new HtmlTree(HtmlTag.DIV); - div.addStyle(HtmlStyle.contentContainer); - return div; - } - - /** - * Add the class content tree. - * - * @param contentTree content tree to which the class content will be added - * @param classContentTree class content tree which will be added to the content tree - */ - public void addClassContentTree(Content contentTree, Content classContentTree) { - if (configuration.allowTag(HtmlTag.MAIN)) { - mainTree.addContent(classContentTree); - contentTree.addContent(mainTree); - } else { - contentTree.addContent(classContentTree); - } - } - - /** - * Add the annotation content tree. - * - * @param contentTree content tree to which the annotation content will be added - * @param annotationContentTree annotation content tree which will be added to the content tree - */ - public void addAnnotationContentTree(Content contentTree, Content annotationContentTree) { - addClassContentTree(contentTree, annotationContentTree); - } - - /** - * Get the member header tree - * - * @return a content tree the member header - */ - public Content getMemberTreeHeader() { - HtmlTree li = new HtmlTree(HtmlTag.LI); - li.addStyle(HtmlStyle.blockList); - return li; - } - - /** - * Add the member tree. - * - * @param memberSummaryTree the content tree representing the member summary - * @param memberTree the content tree representing the member - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree) { - if (configuration.allowTag(HtmlTag.SECTION)) { - HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree)); - memberSummaryTree.addContent(htmlTree); - } else { - memberSummaryTree.addContent(getMemberTree(memberTree)); - } - } - - /** - * Get the member tree - * - * @param contentTree the tree used to generate the complete member tree - * @return a content tree for the member - */ - public Content getMemberTree(Content contentTree) { - Content ul = HtmlTree.UL(HtmlStyle.blockList, contentTree); - return ul; - } - - /** - * Get the member summary tree - * - * @param contentTree the tree used to generate the member summary tree - * @return a content tree for the member summary - */ - public Content getMemberSummaryTree(Content contentTree) { - return getMemberTree(HtmlStyle.summary, contentTree); - } - - /** - * Get the member details tree - * - * @param contentTree the tree used to generate the member details tree - * @return a content tree for the member details - */ - public Content getMemberDetailsTree(Content contentTree) { - return getMemberTree(HtmlStyle.details, contentTree); - } - - /** - * Get the member tree - * - * @param style the style class to be added to the content tree - * @param contentTree the tree used to generate the complete member tree - */ - public Content getMemberTree(HtmlStyle style, Content contentTree) { - Content div = HtmlTree.DIV(style, getMemberTree(contentTree)); - return div; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.ContentBuilder; -import com.sun.tools.doclets.formats.html.markup.HtmlStyle; -import com.sun.tools.doclets.formats.html.markup.HtmlTree; -import com.sun.tools.doclets.formats.html.markup.RawHtml; -import com.sun.tools.doclets.formats.html.markup.StringContent; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder; -import com.sun.tools.doclets.internal.toolkit.taglets.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * The taglet writer that writes HTML. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @since 1.5 - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - */ - -@Deprecated -public class TagletWriterImpl extends TagletWriter { - - private final HtmlDocletWriter htmlWriter; - private final ConfigurationImpl configuration; - private final Utils utils; - - public TagletWriterImpl(HtmlDocletWriter htmlWriter, boolean isFirstSentence) { - super(isFirstSentence); - this.htmlWriter = htmlWriter; - configuration = htmlWriter.configuration; - this.utils = configuration.utils; - } - - /** - * {@inheritDoc} - */ - public Content getOutputInstance() { - return new ContentBuilder(); - } - - /** - * {@inheritDoc} - */ - protected Content codeTagOutput(Tag tag) { - Content result = HtmlTree.CODE(new StringContent(utils.normalizeNewlines(tag.text()))); - return result; - } - - protected Content indexTagOutput(Tag tag) { - String text = tag.text(); - String tagText = ""; - String desc = ""; - if (text.isEmpty() || text.trim().isEmpty()) { - configuration.message.warning(tag.position(), "doclet.invalid_usage_of_tag", tag.name()); - } else { - int len = text.length(); - int tagTextEnd = 0; - int descstart = 0; - int start = 0; - Character term = ' '; - int cp = text.codePointAt(0); - if (cp == '"') { - term = '"'; - start++; - } - for (int i = start; i < len; i += Character.charCount(cp)) { - cp = text.codePointAt(i); - if (cp == term) { - tagTextEnd = i; - break; - } - } - if (tagTextEnd < len - 1 && tagTextEnd != 0) { - descstart = tagTextEnd + 1; - } - String desctext = ""; - if (descstart > 0) { - tagText = text.substring(start, tagTextEnd).trim(); - desctext = text.substring(descstart, len).trim(); - // strip off the white space which can be between tag description and the - // actual label. - for (int i = 0; i < desctext.length(); i++) { - char ch2 = desctext.charAt(i); - if (!(ch2 == ' ' || ch2 == '\t' || ch2 == '\n')) { - desc = desctext.substring(i); - break; - } - } - } else { - if (term == '"') { - if (tagTextEnd == 0) { - // If unclosed quote, print out a warning and ignore the invalid tag text. - configuration.message.warning(tag.position(), "doclet.invalid_usage_of_tag", tag.name()); - tagText = ""; - } else { - tagText = text.substring(start, tagTextEnd).trim(); - } - } else { - tagText = text.trim(); - } - desc = ""; - } - } - String anchorName = htmlWriter.getName(tagText); - Content result = HtmlTree.A_ID(anchorName, new StringContent(tagText)); - if (configuration.createindex && !tagText.isEmpty()) { - SearchIndexItem si = new SearchIndexItem(); - si.setLabel(tagText); - si.setDescription(desc); - if (tag.holder() instanceof ProgramElementDoc) { - if (tag.holder() instanceof MemberDoc) { - si.setUrl(DocPath.forClass(((MemberDoc) tag.holder()).containingClass()).getPath() - + "#" + anchorName); - si.setHolder(((MemberDoc) tag.holder()).qualifiedName()); - } else { - si.setUrl(DocPath.forClass((ClassDoc) tag.holder()).getPath() + "#" + anchorName); - si.setHolder(((ClassDoc) tag.holder()).qualifiedName()); - } - } else if (tag.holder() instanceof PackageDoc) { - si.setUrl(DocPath.forPackage((PackageDoc) tag.holder()).getPath() - + "/" + DocPaths.PACKAGE_SUMMARY.getPath() + "#" + anchorName); - si.setHolder(((PackageDoc) tag.holder()).name()); - } - si.setCategory(configuration.getResource("doclet.SearchTags").toString()); - configuration.tagSearchIndex.add(si); - } - return result; - } - - /** - * {@inheritDoc} - */ - public Content getDocRootOutput() { - String path; - if (htmlWriter.pathToRoot.isEmpty()) - path = "."; - else - path = htmlWriter.pathToRoot.getPath(); - return new StringContent(path); - } - - /** - * {@inheritDoc} - */ - public Content deprecatedTagOutput(Doc doc) { - ContentBuilder result = new ContentBuilder(); - Tag[] deprs = doc.tags("deprecated"); - if (doc instanceof ClassDoc) { - if (utils.isDeprecated((ProgramElementDoc) doc)) { - result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel, - new StringContent(configuration.getText("doclet.Deprecated")))); - result.addContent(RawHtml.nbsp); - if (deprs.length > 0) { - Tag[] commentTags = deprs[0].inlineTags(); - if (commentTags.length > 0) { - result.addContent(commentTagsToOutput(null, doc, - deprs[0].inlineTags(), false) - ); - } - } - } - } else { - MemberDoc member = (MemberDoc) doc; - if (utils.isDeprecated((ProgramElementDoc) doc)) { - result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel, - new StringContent(configuration.getText("doclet.Deprecated")))); - result.addContent(RawHtml.nbsp); - if (deprs.length > 0) { - Content body = commentTagsToOutput(null, doc, - deprs[0].inlineTags(), false); - if (!body.isEmpty()) - result.addContent(HtmlTree.SPAN(HtmlStyle.deprecationComment, body)); - } - } else { - if (utils.isDeprecated(member.containingClass())) { - result.addContent(HtmlTree.SPAN(HtmlStyle.deprecatedLabel, - new StringContent(configuration.getText("doclet.Deprecated")))); - result.addContent(RawHtml.nbsp); - } - } - } - return result; - } - - /** - * {@inheritDoc} - */ - protected Content literalTagOutput(Tag tag) { - Content result = new StringContent(utils.normalizeNewlines(tag.text())); - return result; - } - - /** - * {@inheritDoc} - */ - public MessageRetriever getMsgRetriever() { - return configuration.message; - } - - /** - * {@inheritDoc} - */ - public Content getParamHeader(String header) { - HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.paramLabel, - new StringContent(header))); - return result; - } - - /** - * {@inheritDoc} - */ - public Content paramTagOutput(ParamTag paramTag, String paramName) { - ContentBuilder body = new ContentBuilder(); - body.addContent(HtmlTree.CODE(new RawHtml(paramName))); - body.addContent(" - "); - body.addContent(htmlWriter.commentTagsToContent(paramTag, null, paramTag.inlineTags(), false)); - HtmlTree result = HtmlTree.DD(body); - return result; - } - - /** - * {@inheritDoc} - */ - public Content propertyTagOutput(Tag tag, String prefix) { - Content body = new ContentBuilder(); - body.addContent(new RawHtml(prefix)); - body.addContent(" "); - body.addContent(HtmlTree.CODE(new RawHtml(tag.text()))); - body.addContent("."); - Content result = HtmlTree.P(body); - return result; - } - - /** - * {@inheritDoc} - */ - public Content returnTagOutput(Tag returnTag) { - ContentBuilder result = new ContentBuilder(); - result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.returnLabel, - new StringContent(configuration.getText("doclet.Returns"))))); - result.addContent(HtmlTree.DD(htmlWriter.commentTagsToContent( - returnTag, null, returnTag.inlineTags(), false))); - return result; - } - - /** - * {@inheritDoc} - */ - public Content seeTagOutput(Doc holder, SeeTag[] seeTags) { - ContentBuilder body = new ContentBuilder(); - if (seeTags.length > 0) { - for (SeeTag seeTag : seeTags) { - appendSeparatorIfNotEmpty(body); - body.addContent(htmlWriter.seeTagToContent(seeTag)); - } - } - if (holder.isField() && ((FieldDoc)holder).constantValue() != null && - htmlWriter instanceof ClassWriterImpl) { - //Automatically add link to constant values page for constant fields. - appendSeparatorIfNotEmpty(body); - DocPath constantsPath = - htmlWriter.pathToRoot.resolve(DocPaths.CONSTANT_VALUES); - String whichConstant = - ((ClassWriterImpl) htmlWriter).getClassDoc().qualifiedName() + "." + ((FieldDoc) holder).name(); - DocLink link = constantsPath.fragment(whichConstant); - body.addContent(htmlWriter.getHyperLink(link, - new StringContent(configuration.getText("doclet.Constants_Summary")))); - } - if (holder.isClass() && ((ClassDoc)holder).isSerializable()) { - //Automatically add link to serialized form page for serializable classes. - if ((SerializedFormBuilder.serialInclude(holder) && - SerializedFormBuilder.serialInclude(((ClassDoc)holder).containingPackage()))) { - appendSeparatorIfNotEmpty(body); - DocPath serialPath = htmlWriter.pathToRoot.resolve(DocPaths.SERIALIZED_FORM); - DocLink link = serialPath.fragment(((ClassDoc)holder).qualifiedName()); - body.addContent(htmlWriter.getHyperLink(link, - new StringContent(configuration.getText("doclet.Serialized_Form")))); - } - } - if (body.isEmpty()) - return body; - - ContentBuilder result = new ContentBuilder(); - result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.seeLabel, - new StringContent(configuration.getText("doclet.See_Also"))))); - result.addContent(HtmlTree.DD(body)); - return result; - - } - - private void appendSeparatorIfNotEmpty(ContentBuilder body) { - if (!body.isEmpty()) { - body.addContent(", "); - body.addContent(DocletConstants.NL); - } - } - - /** - * {@inheritDoc} - */ - public Content simpleTagOutput(Tag[] simpleTags, String header) { - ContentBuilder result = new ContentBuilder(); - result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header)))); - ContentBuilder body = new ContentBuilder(); - for (int i = 0; i < simpleTags.length; i++) { - if (i > 0) { - body.addContent(", "); - } - body.addContent(htmlWriter.commentTagsToContent( - simpleTags[i], null, simpleTags[i].inlineTags(), false)); - } - result.addContent(HtmlTree.DD(body)); - return result; - } - - /** - * {@inheritDoc} - */ - public Content simpleTagOutput(Tag simpleTag, String header) { - ContentBuilder result = new ContentBuilder(); - result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.simpleTagLabel, new RawHtml(header)))); - Content body = htmlWriter.commentTagsToContent( - simpleTag, null, simpleTag.inlineTags(), false); - result.addContent(HtmlTree.DD(body)); - return result; - } - - /** - * {@inheritDoc} - */ - public Content getThrowsHeader() { - HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.throwsLabel, - new StringContent(configuration.getText("doclet.Throws")))); - return result; - } - - /** - * {@inheritDoc} - */ - public Content throwsTagOutput(ThrowsTag throwsTag) { - ContentBuilder body = new ContentBuilder(); - Content excName = (throwsTag.exceptionType() == null) ? - new RawHtml(throwsTag.exceptionName()) : - htmlWriter.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, - throwsTag.exceptionType())); - body.addContent(HtmlTree.CODE(excName)); - Content desc = htmlWriter.commentTagsToContent(throwsTag, null, - throwsTag.inlineTags(), false); - if (desc != null && !desc.isEmpty()) { - body.addContent(" - "); - body.addContent(desc); - } - HtmlTree result = HtmlTree.DD(body); - return result; - } - - /** - * {@inheritDoc} - */ - public Content throwsTagOutput(Type throwsType) { - HtmlTree result = HtmlTree.DD(HtmlTree.CODE(htmlWriter.getLink( - new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, throwsType)))); - return result; - } - - /** - * {@inheritDoc} - */ - public Content valueTagOutput(FieldDoc field, String constantVal, - boolean includeLink) { - return includeLink ? - htmlWriter.getDocLink(LinkInfoImpl.Kind.VALUE_TAG, field, - constantVal, false) : new RawHtml(constantVal); - } - - /** - * {@inheritDoc} - */ - public Content commentTagsToOutput(Tag holderTag, Tag[] tags) { - return commentTagsToOutput(holderTag, null, tags, false); - } - - /** - * {@inheritDoc} - */ - public Content commentTagsToOutput(Doc holderDoc, Tag[] tags) { - return commentTagsToOutput(null, holderDoc, tags, false); - } - - /** - * {@inheritDoc} - */ - public Content commentTagsToOutput(Tag holderTag, - Doc holderDoc, Tag[] tags, boolean isFirstSentence) { - return htmlWriter.commentTagsToContent( - holderTag, holderDoc, tags, isFirstSentence); - } - - /** - * {@inheritDoc} - */ - public Configuration configuration() { - return configuration; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.IOException; -import java.util.SortedSet; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.markup.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Generate Class Hierarchy page for all the Classes in this run. Use - * ClassTree for building the Tree. The name of - * the generated file is "overview-tree.html" and it is generated in the - * current or the destination directory. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class TreeWriter extends AbstractTreeWriter { - - /** - * Packages in this run. - */ - SortedSet packages; - - /** - * True if there are no packages specified on the command line, - * False otherwise. - */ - private boolean classesonly; - - /** - * Constructor to construct TreeWriter object. - * - * @param configuration the current configuration of the doclet. - * @param filename String filename - * @param classtree the tree being built. - */ - public TreeWriter(ConfigurationImpl configuration, - DocPath filename, ClassTree classtree) throws IOException { - super(configuration, filename, classtree); - packages = configuration.packages; - classesonly = packages.isEmpty(); - } - - /** - * Create a TreeWriter object and use it to generate the - * "overview-tree.html" file. - * - * @param classtree the class tree being documented. - * @throws DocletAbortException - */ - public static void generate(ConfigurationImpl configuration, - ClassTree classtree) { - TreeWriter treegen; - DocPath filename = DocPaths.OVERVIEW_TREE; - try { - treegen = new TreeWriter(configuration, filename, classtree); - treegen.generateTreeFile(); - treegen.close(); - } catch (IOException exc) { - configuration.standardmessage.error( - "doclet.exception_encountered", - exc.toString(), filename); - throw new DocletAbortException(exc); - } - } - - /** - * Generate the interface hierarchy and class hierarchy. - */ - public void generateTreeFile() throws IOException { - HtmlTree body = getTreeHeader(); - Content headContent = getResource("doclet.Hierarchy_For_All_Packages"); - Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, - HtmlStyle.title, headContent); - Content div = HtmlTree.DIV(HtmlStyle.header, heading); - addPackageTreeLinks(div); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN)) - ? HtmlTree.MAIN() - : body; - htmlTree.addContent(div); - HtmlTree divTree = new HtmlTree(HtmlTag.DIV); - divTree.addStyle(HtmlStyle.contentContainer); - addTree(classtree.baseclasses(), "doclet.Class_Hierarchy", divTree); - addTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy", divTree); - addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); - addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree); - htmlTree.addContent(divTree); - if (configuration.allowTag(HtmlTag.MAIN)) { - body.addContent(htmlTree); - } - if (configuration.allowTag(HtmlTag.FOOTER)) { - htmlTree = HtmlTree.FOOTER(); - } else { - htmlTree = body; - } - addNavLinks(false, htmlTree); - addBottom(htmlTree); - if (configuration.allowTag(HtmlTag.FOOTER)) { - body.addContent(htmlTree); - } - printHtmlDocument(null, true, body); - } - - /** - * Add the links to all the package tree files. - * - * @param contentTree the content tree to which the links will be added - */ - protected void addPackageTreeLinks(Content contentTree) { - //Do nothing if only unnamed package is used - if (isUnnamedPackage()) { - return; - } - if (!classesonly) { - Content span = HtmlTree.SPAN(HtmlStyle.packageHierarchyLabel, - getResource("doclet.Package_Hierarchies")); - contentTree.addContent(span); - HtmlTree ul = new HtmlTree(HtmlTag.UL); - ul.addStyle(HtmlStyle.horizontal); - int i = 0; - for (PackageDoc pkg : packages) { - // If the package name length is 0 or if -nodeprecated option - // is set and the package is marked as deprecated, do not include - // the page in the list of package hierarchies. - if (pkg.name().isEmpty() || - (configuration.nodeprecated && utils.isDeprecated(pkg))) { - i++; - continue; - } - DocPath link = pathString(pkg, DocPaths.PACKAGE_TREE); - Content li = HtmlTree.LI(getHyperLink( - link, new StringContent(pkg.name()))); - if (i < packages.size() - 1) { - li.addContent(", "); - } - ul.addContent(li); - i++; - } - contentTree.addContent(ul); - } - } - - /** - * Get the tree header. - * - * @return a content tree for the tree header - */ - protected HtmlTree getTreeHeader() { - String title = configuration.getText("doclet.Window_Class_Hierarchy"); - HtmlTree bodyTree = getBody(true, getWindowTitle(title)); - HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER)) - ? HtmlTree.HEADER() - : bodyTree; - addTop(htmlTree); - addNavLinks(true, htmlTree); - if (configuration.allowTag(HtmlTag.HEADER)) { - bodyTree.addContent(htmlTree); - } - return bodyTree; - } - - private boolean isUnnamedPackage() { - return packages.size() == 1 && packages.first().name().isEmpty(); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html; - -import java.io.IOException; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * The factory that returns HTML writers. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @since 1.5 - */ -@Deprecated -public class WriterFactoryImpl implements WriterFactory { - - private final ConfigurationImpl configuration; - - public WriterFactoryImpl(ConfigurationImpl configuration) { - this.configuration = configuration; - } - - /** - * {@inheritDoc} - */ - public ConstantsSummaryWriter getConstantsSummaryWriter() throws Exception { - return new ConstantsSummaryWriterImpl(configuration); - } - - /** - * {@inheritDoc} - */ - public PackageSummaryWriter getPackageSummaryWriter(PackageDoc packageDoc, - PackageDoc prevPkg, PackageDoc nextPkg) throws Exception { - return new PackageWriterImpl(configuration, packageDoc, - prevPkg, nextPkg); - } - - /** - * {@inheritDoc} - */ - public ClassWriter getClassWriter(ClassDoc classDoc, ClassDoc prevClass, - ClassDoc nextClass, ClassTree classTree) throws IOException { - return new ClassWriterImpl(configuration, classDoc, - prevClass, nextClass, classTree); - } - - /** - * {@inheritDoc} - */ - public AnnotationTypeWriter getAnnotationTypeWriter( - AnnotationTypeDoc annotationType, Type prevType, Type nextType) - throws Exception { - return new AnnotationTypeWriterImpl(configuration, - annotationType, prevType, nextType); - } - - /** - * {@inheritDoc} - */ - public AnnotationTypeFieldWriter - getAnnotationTypeFieldWriter(AnnotationTypeWriter annotationTypeWriter) throws Exception { - return new AnnotationTypeFieldWriterImpl( - (SubWriterHolderWriter) annotationTypeWriter, - annotationTypeWriter.getAnnotationTypeDoc()); - } - - /** - * {@inheritDoc} - */ - public AnnotationTypeOptionalMemberWriter - getAnnotationTypeOptionalMemberWriter( - AnnotationTypeWriter annotationTypeWriter) throws Exception { - return new AnnotationTypeOptionalMemberWriterImpl( - (SubWriterHolderWriter) annotationTypeWriter, - annotationTypeWriter.getAnnotationTypeDoc()); - } - - /** - * {@inheritDoc} - */ - public AnnotationTypeRequiredMemberWriter - getAnnotationTypeRequiredMemberWriter(AnnotationTypeWriter annotationTypeWriter) throws Exception { - return new AnnotationTypeRequiredMemberWriterImpl( - (SubWriterHolderWriter) annotationTypeWriter, - annotationTypeWriter.getAnnotationTypeDoc()); - } - - /** - * {@inheritDoc} - */ - public EnumConstantWriterImpl getEnumConstantWriter(ClassWriter classWriter) - throws Exception { - return new EnumConstantWriterImpl((SubWriterHolderWriter) classWriter, - classWriter.getClassDoc()); - } - - /** - * {@inheritDoc} - */ - public FieldWriterImpl getFieldWriter(ClassWriter classWriter) - throws Exception { - return new FieldWriterImpl((SubWriterHolderWriter) classWriter, - classWriter.getClassDoc()); - } - - /** - * {@inheritDoc} - */ - public PropertyWriterImpl getPropertyWriter(ClassWriter classWriter) - throws Exception { - return new PropertyWriterImpl((SubWriterHolderWriter) classWriter, - classWriter.getClassDoc()); - } - - /** - * {@inheritDoc} - */ - public MethodWriterImpl getMethodWriter(ClassWriter classWriter) - throws Exception { - return new MethodWriterImpl((SubWriterHolderWriter) classWriter, - classWriter.getClassDoc()); - } - - /** - * {@inheritDoc} - */ - public ConstructorWriterImpl getConstructorWriter(ClassWriter classWriter) - throws Exception { - return new ConstructorWriterImpl((SubWriterHolderWriter) classWriter, - classWriter.getClassDoc()); - } - - /** - * {@inheritDoc} - */ - public MemberSummaryWriter getMemberSummaryWriter( - ClassWriter classWriter, int memberType) - throws Exception { - switch (memberType) { - case VisibleMemberMap.CONSTRUCTORS: - return getConstructorWriter(classWriter); - case VisibleMemberMap.ENUM_CONSTANTS: - return getEnumConstantWriter(classWriter); - case VisibleMemberMap.FIELDS: - return getFieldWriter(classWriter); - case VisibleMemberMap.PROPERTIES: - return getPropertyWriter(classWriter); - case VisibleMemberMap.INNERCLASSES: - return new NestedClassWriterImpl((SubWriterHolderWriter) - classWriter, classWriter.getClassDoc()); - case VisibleMemberMap.METHODS: - return getMethodWriter(classWriter); - default: - return null; - } - } - - /** - * {@inheritDoc} - */ - public MemberSummaryWriter getMemberSummaryWriter( - AnnotationTypeWriter annotationTypeWriter, int memberType) - throws Exception { - switch (memberType) { - case VisibleMemberMap.ANNOTATION_TYPE_FIELDS: - return (AnnotationTypeFieldWriterImpl) - getAnnotationTypeFieldWriter(annotationTypeWriter); - case VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL: - return (AnnotationTypeOptionalMemberWriterImpl) - getAnnotationTypeOptionalMemberWriter(annotationTypeWriter); - case VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED: - return (AnnotationTypeRequiredMemberWriterImpl) - getAnnotationTypeRequiredMemberWriter(annotationTypeWriter); - default: - return null; - } - } - - /** - * {@inheritDoc} - */ - public SerializedFormWriter getSerializedFormWriter() throws Exception { - return new SerializedFormWriterImpl(configuration); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/Comment.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/Comment.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/Comment.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import java.io.IOException; -import java.io.Writer; - -import com.sun.tools.doclets.internal.toolkit.Content; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Class for generating a comment for HTML pages of javadoc output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public class Comment extends Content { - - private String commentText; - - /** - * Constructor to construct a Comment object. - * - * @param comment comment text for the comment - */ - public Comment(String comment) { - commentText = nullCheck(comment); - } - - /** - * This method is not supported by the class. - * - * @param content content that needs to be added - * @throws DocletAbortException this method will always throw a - * DocletAbortException because it - * is not supported. - */ - public void addContent(Content content) { - throw new DocletAbortException("not supported"); - } - - /** - * This method is not supported by the class. - * - * @param stringContent string content that needs to be added - * @throws DocletAbortException this method will always throw a - * DocletAbortException because it - * is not supported. - */ - public void addContent(String stringContent) { - throw new DocletAbortException("not supported"); - } - - /** - * {@inheritDoc} - */ - public boolean isEmpty() { - return commentText.isEmpty(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean write(Writer out, boolean atNewline) throws IOException { - if (!atNewline) - out.write(DocletConstants.NL); - out.write("" + DocletConstants.NL); - return true; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/ContentBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/ContentBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/ContentBuilder.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import java.io.IOException; -import java.io.Writer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import com.sun.tools.doclets.internal.toolkit.Content; - -/** - * A sequence of Content nodes. - */ -@Deprecated -public class ContentBuilder extends Content { - protected List contents = Collections.emptyList(); - - @Override - public void addContent(Content content) { - nullCheck(content); - ensureMutableContents(); - if (content instanceof ContentBuilder) { - contents.addAll(((ContentBuilder) content).contents); - } else - contents.add(content); - } - - @Override - public void addContent(String text) { - if (text.isEmpty()) - return; - ensureMutableContents(); - Content c = contents.isEmpty() ? null : contents.get(contents.size() - 1); - StringContent sc; - if (c != null && c instanceof StringContent) { - sc = (StringContent) c; - } else { - contents.add(sc = new StringContent()); - } - sc.addContent(text); - } - - @Override - public boolean write(Writer writer, boolean atNewline) throws IOException { - for (Content content: contents) { - atNewline = content.write(writer, atNewline); - } - return atNewline; - } - - @Override - public boolean isEmpty() { - for (Content content: contents) { - if (!content.isEmpty()) - return false; - } - return true; - } - - @Override - public int charCount() { - int n = 0; - for (Content c : contents) - n += c.charCount(); - return n; - } - - private void ensureMutableContents() { - if (contents.isEmpty()) - contents = new ArrayList<>(); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import java.io.IOException; -import java.io.Writer; - -import com.sun.tools.doclets.internal.toolkit.Content; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Class for generating document type for HTML pages of javadoc output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public class DocType extends Content { - - private String docType; - - public static final DocType TRANSITIONAL = - new DocType("Transitional", "http://www.w3.org/TR/html4/loose.dtd"); - - public static final DocType HTML5 = new DocType(); - - /** - * Constructor to construct a DocType object. - * - * @param type the doctype to be added - * @param dtd the dtd of the doctype - */ - private DocType(String type, String dtd) { - docType = "" + DocletConstants.NL; - } - - /** - * Constructor to construct a DocType object. - */ - private DocType() { - docType = "" + DocletConstants.NL; - } - - /** - * This method is not supported by the class. - * - * @param content content that needs to be added - * @throws DocletAbortException this method will always throw a - * DocletAbortException because it - * is not supported. - */ - public void addContent(Content content) { - throw new DocletAbortException("not supported"); - } - - /** - * This method is not supported by the class. - * - * @param stringContent string content that needs to be added - * @throws DocletAbortException this method will always throw a - * DocletAbortException because it - * is not supported. - */ - public void addContent(String stringContent) { - throw new DocletAbortException("not supported"); - } - - /** - * {@inheritDoc} - */ - public boolean isEmpty() { - return (docType.length() == 0); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean write(Writer out, boolean atNewline) throws IOException { - out.write(docType); - return true; // guaranteed by constructor - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import com.sun.tools.javac.util.StringUtils; - -/** - * Enum representing HTML tag attributes. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public enum HtmlAttr { - ALT, - CLASS, - CLEAR, - COLS, - CONTENT, - DISABLED, - HREF, - HTTP_EQUIV("http-equiv"), - ID, - LANG, - NAME, - ONLOAD, - REL, - ROLE, - ROWS, - SCOPE, - SCROLLING, - SRC, - SUMMARY, - TARGET, - TITLE, - TYPE, - VALUE, - WIDTH; - - private final String value; - - public enum Role { - - BANNER, - CONTENTINFO, - MAIN, - NAVIGATION, - REGION; - - private final String role; - - Role() { - role = StringUtils.toLowerCase(name()); - } - - public String toString() { - return role; - } - } - - HtmlAttr() { - this.value = StringUtils.toLowerCase(name()); - } - - HtmlAttr(String name) { - this.value = name; - } - - public String toString() { - return value; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlConstants.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import com.sun.tools.doclets.internal.toolkit.Content; - -/** - * Stores constants for Html Doclet. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public class HtmlConstants { - - /** - * Marker to identify start of top navigation bar. - */ - public static final Content START_OF_TOP_NAVBAR = - new Comment("========= START OF TOP NAVBAR ======="); - - /** - * Marker to identify start of bottom navigation bar. - */ - public static final Content START_OF_BOTTOM_NAVBAR = - new Comment("======= START OF BOTTOM NAVBAR ======"); - - /** - * Marker to identify end of top navigation bar. - */ - public static final Content END_OF_TOP_NAVBAR = - new Comment("========= END OF TOP NAVBAR ========="); - - /** - * Marker to identify end of bottom navigation bar. - */ - public static final Content END_OF_BOTTOM_NAVBAR = - new Comment("======== END OF BOTTOM NAVBAR ======="); - - /** - * Marker to identify start of class data. - */ - public static final Content START_OF_CLASS_DATA = - new Comment("======== START OF CLASS DATA ========"); - - /** - * Marker to identify end of class data. - */ - public static final Content END_OF_CLASS_DATA = - new Comment("========= END OF CLASS DATA ========="); - - /** - * Marker to identify start of nested class summary. - */ - public static final Content START_OF_NESTED_CLASS_SUMMARY = - new Comment("======== NESTED CLASS SUMMARY ========"); - - /** - * Marker to identify start of annotation type optional member summary. - */ - public static final Content START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY = - new Comment("=========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY ==========="); - - /** - * Marker to identify start of annotation type required member summary. - */ - public static final Content START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY = - new Comment("=========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY ==========="); - - /** - * Marker to identify start of annotation type required member summary. - */ - public static final Content START_OF_ANNOTATION_TYPE_FIELD_SUMMARY = - new Comment("=========== ANNOTATION TYPE FIELD SUMMARY ==========="); - - /** - * Marker to identify start of constructor summary. - */ - public static final Content START_OF_CONSTRUCTOR_SUMMARY = - new Comment("======== CONSTRUCTOR SUMMARY ========"); - - /** - * Marker to identify start of enum constants summary. - */ - public static final Content START_OF_ENUM_CONSTANT_SUMMARY = - new Comment("=========== ENUM CONSTANT SUMMARY ==========="); - - /** - * Marker to identify start of field summary. - */ - public static final Content START_OF_FIELD_SUMMARY = - new Comment("=========== FIELD SUMMARY ==========="); - - /** - * Marker to identify start of properties summary. - */ - public static final Content START_OF_PROPERTY_SUMMARY = - new Comment("=========== PROPERTY SUMMARY ==========="); - - /** - * Marker to identify start of method summary. - */ - public static final Content START_OF_METHOD_SUMMARY = - new Comment("========== METHOD SUMMARY ==========="); - - /** - * Marker to identify start of annotation type details. - */ - public static final Content START_OF_ANNOTATION_TYPE_DETAILS = - new Comment("============ ANNOTATION TYPE MEMBER DETAIL ==========="); - - /** - * Marker to identify start of annotation type field details. - */ - public static final Content START_OF_ANNOTATION_TYPE_FIELD_DETAILS = - new Comment("============ ANNOTATION TYPE FIELD DETAIL ==========="); - - /** - * Marker to identify start of method details. - */ - public static final Content START_OF_METHOD_DETAILS = - new Comment("============ METHOD DETAIL =========="); - - /** - * Marker to identify start of field details. - */ - public static final Content START_OF_FIELD_DETAILS = - new Comment("============ FIELD DETAIL ==========="); - - /** - * Marker to identify start of property details. - */ - public static final Content START_OF_PROPERTY_DETAILS = - new Comment("============ PROPERTY DETAIL ==========="); - - /** - * Marker to identify start of constructor details. - */ - public static final Content START_OF_CONSTRUCTOR_DETAILS = - new Comment("========= CONSTRUCTOR DETAIL ========"); - - /** - * Marker to identify start of enum constants details. - */ - public static final Content START_OF_ENUM_CONSTANT_DETAILS = - new Comment("============ ENUM CONSTANT DETAIL ==========="); - - /** - * Html tag for the page title heading. - */ - public static final HtmlTag TITLE_HEADING = HtmlTag.H1; - - /** - * Html tag for the class page title heading. - */ - public static final HtmlTag CLASS_PAGE_HEADING = HtmlTag.H2; - - /** - * Html tag for the content heading. - */ - public static final HtmlTag CONTENT_HEADING = HtmlTag.H2; - - /** - * Html tag for the package name heading. - */ - public static final HtmlTag PACKAGE_HEADING = HtmlTag.H2; - - /** - * Html tag for the member summary heading. - */ - public static final HtmlTag SUMMARY_HEADING = HtmlTag.H3; - - /** - * Html tag for the inherited member summary heading. - */ - public static final HtmlTag INHERITED_SUMMARY_HEADING = HtmlTag.H3; - - /** - * Html tag for the member details heading. - */ - public static final HtmlTag DETAILS_HEADING = HtmlTag.H3; - - /** - * Html tag for the serialized member heading. - */ - public static final HtmlTag SERIALIZED_MEMBER_HEADING = HtmlTag.H3; - - /** - * Html tag for the member heading. - */ - public static final HtmlTag MEMBER_HEADING = HtmlTag.H4; - - /** - * Default charset for HTML. - */ - public static final String HTML_DEFAULT_CHARSET = "utf-8"; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.formats.html.ConfigurationImpl; -import com.sun.tools.doclets.formats.html.SectionName; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.DocFile; -import com.sun.tools.doclets.internal.toolkit.util.DocLink; -import com.sun.tools.doclets.internal.toolkit.util.DocPath; -import com.sun.tools.doclets.internal.toolkit.util.DocPaths; - - -/** - * Class for the Html Format Code Generation specific to JavaDoc. - * This Class contains methods related to the Html Code Generation which - * are used by the Sub-Classes in the package com.sun.tools.doclets.standard - * and com.sun.tools.doclets.oneone. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @since 1.2 - * @author Atul M Dambalkar - * @author Robert Field - */ -@Deprecated -public abstract class HtmlDocWriter extends HtmlWriter { - - public static final String CONTENT_TYPE = "text/html"; - - DocPath pathToRoot; - - /** - * Constructor. Initializes the destination file name through the super - * class HtmlWriter. - * - * @param filename String file name. - */ - public HtmlDocWriter(Configuration configuration, DocPath filename) - throws IOException { - super(configuration, filename); - this.pathToRoot = filename.parent().invert(); - configuration.message.notice("doclet.Generating_0", - DocFile.createFileForOutput(configuration, filename).getPath()); - } - - /** - * Accessor for configuration. - */ - public abstract Configuration configuration(); - - public Content getHyperLink(DocPath link, String label) { - return getHyperLink(link, new StringContent(label), false, "", "", ""); - } - - /** - * Get Html Hyper Link Content. - * - * @param where Position of the link in the file. Character '#' is not - * needed. - * @param label Tag for the link. - * @return a content tree for the hyper link - */ - public Content getHyperLink(String where, - Content label) { - return getHyperLink(getDocLink(where), label, "", ""); - } - - /** - * Get Html Hyper Link Content. - * - * @param sectionName The section name to which the link will be created. - * @param label Tag for the link. - * @return a content tree for the hyper link - */ - public Content getHyperLink(SectionName sectionName, - Content label) { - return getHyperLink(getDocLink(sectionName), label, "", ""); - } - - /** - * Get Html Hyper Link Content. - * - * @param sectionName The section name combined with where to which the link - * will be created. - * @param where The fragment combined with sectionName to which the link - * will be created. - * @param label Tag for the link. - * @return a content tree for the hyper link - */ - public Content getHyperLink(SectionName sectionName, String where, - Content label) { - return getHyperLink(getDocLink(sectionName, where), label, "", ""); - } - - /** - * Get the link. - * - * @param where Position of the link in the file. - * @return a DocLink object for the hyper link - */ - public DocLink getDocLink(String where) { - return DocLink.fragment(getName(where)); - } - - /** - * Get the link. - * - * @param sectionName The section name to which the link will be created. - * @return a DocLink object for the hyper link - */ - public DocLink getDocLink(SectionName sectionName) { - return DocLink.fragment(sectionName.getName()); - } - - /** - * Get the link. - * - * @param sectionName The section name combined with where to which the link - * will be created. - * @param where The fragment combined with sectionName to which the link - * will be created. - * @return a DocLink object for the hyper link - */ - public DocLink getDocLink(SectionName sectionName, String where) { - return DocLink.fragment(sectionName.getName() + getName(where)); - } - - /** - * Convert the name to a valid HTML name. - * - * @param name the name that needs to be converted to valid HTML name. - * @return a valid HTML name string. - */ - public String getName(String name) { - StringBuilder sb = new StringBuilder(); - char ch; - /* The HTML 4 spec at http://www.w3.org/TR/html4/types.html#h-6.2 mentions - * that the name/id should begin with a letter followed by other valid characters. - * The HTML 5 spec (draft) is more permissive on names/ids where the only restriction - * is that it should be at least one character long and should not contain spaces. - * The spec draft is @ http://www.w3.org/html/wg/drafts/html/master/dom.html#the-id-attribute. - * - * For HTML 4, we need to check for non-characters at the beginning of the name and - * substitute it accordingly, "_" and "$" can appear at the beginning of a member name. - * The method substitutes "$" with "Z:Z:D" and will prefix "_" with "Z:Z". - */ - for (int i = 0; i < name.length(); i++) { - ch = name.charAt(i); - switch (ch) { - case '(': - case ')': - case '<': - case '>': - case ',': - sb.append('-'); - break; - case ' ': - case '[': - break; - case ']': - sb.append(":A"); - break; - // Any appearance of $ needs to be substituted with ":D" and not with hyphen - // since a field name "P$$ and a method P(), both valid member names, can end - // up as "P--". A member name beginning with $ needs to be substituted with - // "Z:Z:D". - case '$': - if (i == 0) - sb.append("Z:Z"); - sb.append(":D"); - break; - // A member name beginning with _ needs to be prefixed with "Z:Z" since valid anchor - // names can only begin with a letter. - case '_': - if (i == 0) - sb.append("Z:Z"); - sb.append(ch); - break; - default: - sb.append(ch); - } - } - return sb.toString(); - } - - /** - * Get Html hyperlink. - * - * @param link path of the file. - * @param label Tag for the link. - * @return a content tree for the hyper link - */ - public Content getHyperLink(DocPath link, Content label) { - return getHyperLink(link, label, "", ""); - } - - public Content getHyperLink(DocLink link, Content label) { - return getHyperLink(link, label, "", ""); - } - - public Content getHyperLink(DocPath link, - Content label, boolean strong, - String stylename, String title, String target) { - return getHyperLink(new DocLink(link), label, strong, - stylename, title, target); - } - - public Content getHyperLink(DocLink link, - Content label, boolean strong, - String stylename, String title, String target) { - Content body = label; - if (strong) { - body = HtmlTree.SPAN(HtmlStyle.typeNameLink, body); - } - if (stylename != null && stylename.length() != 0) { - HtmlTree t = new HtmlTree(HtmlTag.FONT, body); - t.addAttr(HtmlAttr.CLASS, stylename); - body = t; - } - HtmlTree l = HtmlTree.A(link.toString(), body); - if (title != null && title.length() != 0) { - l.addAttr(HtmlAttr.TITLE, title); - } - if (target != null && target.length() != 0) { - l.addAttr(HtmlAttr.TARGET, target); - } - return l; - } - - /** - * Get Html Hyper Link. - * - * @param link String name of the file. - * @param label Tag for the link. - * @param title String that describes the link's content for accessibility. - * @param target Target frame. - * @return a content tree for the hyper link. - */ - public Content getHyperLink(DocPath link, - Content label, String title, String target) { - return getHyperLink(new DocLink(link), label, title, target); - } - - public Content getHyperLink(DocLink link, - Content label, String title, String target) { - HtmlTree anchor = HtmlTree.A(link.toString(), label); - if (title != null && title.length() != 0) { - anchor.addAttr(HtmlAttr.TITLE, title); - } - if (target != null && target.length() != 0) { - anchor.addAttr(HtmlAttr.TARGET, target); - } - return anchor; - } - - /** - * Get the name of the package, this class is in. - * - * @param cd ClassDoc. - */ - public String getPkgName(ClassDoc cd) { - String pkgName = cd.containingPackage().name(); - if (pkgName.length() > 0) { - pkgName += "."; - return pkgName; - } - return ""; - } - - public boolean getMemberDetailsListPrinted() { - return memberDetailsListPrinted; - } - - /** - * Print the frames version of the Html file header. - * Called only when generating an HTML frames file. - * - * @param title Title of this HTML document - * @param configuration the configuration object - * @param body the body content tree to be added to the HTML document - */ - public void printFramesDocument(String title, ConfigurationImpl configuration, - HtmlTree body) throws IOException { - Content htmlDocType = configuration.isOutputHtml5() - ? DocType.HTML5 - : DocType.TRANSITIONAL; - Content htmlComment = new Comment(configuration.getText("doclet.New_Page")); - Content head = new HtmlTree(HtmlTag.HEAD); - head.addContent(getGeneratedBy(!configuration.notimestamp)); - Content windowTitle = HtmlTree.TITLE(new StringContent(title)); - head.addContent(windowTitle); - Content meta = HtmlTree.META("Content-Type", CONTENT_TYPE, - (configuration.charset.length() > 0) ? - configuration.charset : HtmlConstants.HTML_DEFAULT_CHARSET); - head.addContent(meta); - head.addContent(getStyleSheetProperties(configuration)); - head.addContent(getFramesJavaScript()); - Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), - head, body); - Content htmlDocument = new HtmlDocument(htmlDocType, - htmlComment, htmlTree); - write(htmlDocument); - } - - /** - * Returns a link to the stylesheet file. - * - * @return an HtmlTree for the lINK tag which provides the stylesheet location - */ - public HtmlTree getStyleSheetProperties(ConfigurationImpl configuration) { - String stylesheetfile = configuration.stylesheetfile; - DocPath stylesheet; - if (stylesheetfile.isEmpty()) { - stylesheet = DocPaths.STYLESHEET; - } else { - DocFile file = DocFile.createFileForInput(configuration, stylesheetfile); - stylesheet = DocPath.create(file.getName()); - } - HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", - pathToRoot.resolve(stylesheet).getPath(), - "Style"); - return link; - } - - protected Comment getGeneratedBy(boolean timestamp) { - String text = "Generated by javadoc"; // marker string, deliberately not localized - if (timestamp) { - Calendar calendar = new GregorianCalendar(TimeZone.getDefault()); - Date today = calendar.getTime(); - text += " ("+ configuration.getDocletSpecificBuildDate() + ") on " + today; - } - return new Comment(text); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocument.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocument.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocument.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import java.io.IOException; -import java.io.Writer; -import java.util.*; - -import com.sun.tools.doclets.internal.toolkit.Content; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Class for generating an HTML document for javadoc output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public class HtmlDocument extends Content { - - private List docContent = Collections.emptyList(); - - /** - * Constructor to construct an HTML document. - * - * @param docType document type for the HTML document - * @param docComment comment for the document - * @param htmlTree HTML tree of the document - */ - public HtmlDocument(Content docType, Content docComment, Content htmlTree) { - docContent = new ArrayList<>(); - addContent(nullCheck(docType)); - addContent(nullCheck(docComment)); - addContent(nullCheck(htmlTree)); - } - - /** - * Constructor to construct an HTML document. - * - * @param docType document type for the HTML document - * @param htmlTree HTML tree of the document - */ - public HtmlDocument(Content docType, Content htmlTree) { - docContent = new ArrayList<>(); - addContent(nullCheck(docType)); - addContent(nullCheck(htmlTree)); - } - - /** - * Adds content for the HTML document. - * - * @param htmlContent html content to be added - */ - public final void addContent(Content htmlContent) { - if (htmlContent.isValid()) - docContent.add(htmlContent); - } - - /** - * This method is not supported by the class. - * - * @param stringContent string content that needs to be added - * @throws DocletAbortException this method will always throw a - * DocletAbortException because it - * is not supported. - */ - public void addContent(String stringContent) { - throw new DocletAbortException("not supported"); - } - - /** - * {@inheritDoc} - */ - public boolean isEmpty() { - return (docContent.isEmpty()); - } - - /** - * {@inheritDoc} - */ - public boolean write(Writer out, boolean atNewline) throws IOException { - for (Content c : docContent) - atNewline = c.write(out, atNewline); - return atNewline; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -/** - * Enum representing HTML styles. The name map to values in the CSS file. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public enum HtmlStyle { - aboutLanguage, - activeTableTab, - altColor, - bar, - block, - blockList, - blockListLast, - bottomNav, - circle, - classUseContainer, - colFirst, - colLast, - colOne, - constantsSummary, - constantValuesContainer, - contentContainer, - deprecatedContent, - deprecatedLabel, - deprecatedSummary, - deprecationComment, - description, - descfrmTypeLabel, - details, - docSummary, - emphasizedPhrase, - fixedNav, - header, - horizontal, - footer, - indexContainer, - indexNav, - inheritance, - interfaceName, - leftContainer, - leftTop, - leftBottom, - legalCopy, - mainContainer, - memberNameLabel, - memberNameLink, - memberSummary, - nameValue, - navBarCell1Rev, - navList, - navListSearch, - navPadding, - overrideSpecifyLabel, - overviewSummary, - packageHierarchyLabel, - packageLabelInClass, - paramLabel, - returnLabel, - rightContainer, - rightIframe, - rowColor, - searchTagLink, - seeLabel, - serializedFormContainer, - simpleTagLabel, - skipNav, - sourceContainer, - sourceLineNo, - subNav, - subNavList, - subTitle, - summary, - tabEnd, - tableTab, - throwsLabel, - title, - topNav, - typeNameLabel, - typeNameLink, - typeSummary, - useSummary -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import com.sun.tools.javac.util.StringUtils; - -/** - * Enum representing HTML tags. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public enum HtmlTag { - A(BlockType.INLINE, EndTag.END), - BLOCKQUOTE, - BODY(BlockType.OTHER, EndTag.END), - BR(BlockType.INLINE, EndTag.NOEND), - CAPTION, - CENTER(HtmlVersion.HTML4), - CODE(BlockType.INLINE, EndTag.END), - DD, - DIR(HtmlVersion.HTML4), - DIV, - DL, - DT, - EM(BlockType.INLINE, EndTag.END), - FONT(HtmlVersion.HTML4, BlockType.INLINE, EndTag.END), - FOOTER(HtmlVersion.HTML5), - H1, - H2, - H3, - H4, - H5, - H6, - HEAD(BlockType.OTHER, EndTag.END), - HEADER(HtmlVersion.HTML5), - HR(BlockType.BLOCK, EndTag.NOEND), - HTML(BlockType.OTHER, EndTag.END), - I(BlockType.INLINE, EndTag.END), - IFRAME(BlockType.OTHER, EndTag.END), - IMG(BlockType.INLINE, EndTag.NOEND), - INPUT(BlockType.BLOCK, EndTag.NOEND), - LI, - LISTING, - LINK(BlockType.OTHER, EndTag.NOEND), - MAIN(HtmlVersion.HTML5), - MENU, - META(BlockType.OTHER, EndTag.NOEND), - NAV(HtmlVersion.HTML5), - NOSCRIPT(BlockType.OTHER, EndTag.END), - OL, - P, - PRE, - SCRIPT(BlockType.OTHER, EndTag.END), - SECTION(HtmlVersion.HTML5), - SMALL(BlockType.INLINE, EndTag.END), - SPAN(BlockType.INLINE, EndTag.END), - STRONG(BlockType.INLINE, EndTag.END), - SUB(BlockType.INLINE, EndTag.END), - TABLE, - TBODY, - TD, - TH, - TITLE(BlockType.OTHER, EndTag.END), - TR, - TT(HtmlVersion.HTML4, BlockType.INLINE, EndTag.END), - UL; - - public final BlockType blockType; - public final EndTag endTag; - public final String value; - public final HtmlVersion htmlVersion; - - /** - * Enum representing the type of HTML element. - */ - public static enum BlockType { - BLOCK, - INLINE, - OTHER - } - - /** - * Enum representing HTML end tag requirement. - */ - public static enum EndTag { - END, - NOEND - } - - HtmlTag() { - this(HtmlVersion.ALL, BlockType.BLOCK, EndTag.END); - } - - HtmlTag(HtmlVersion htmlVersion) { - this(htmlVersion, BlockType.BLOCK, EndTag.END); - } - - HtmlTag(BlockType blockType, EndTag endTag ) { - this(HtmlVersion.ALL, blockType, endTag); - } - - HtmlTag(HtmlVersion htmlVersion, BlockType blockType, EndTag endTag ) { - this.htmlVersion = htmlVersion; - this.blockType = blockType; - this.endTag = endTag; - this.value = StringUtils.toLowerCase(name()); - } - - /** - * Returns true if the end tag is required. This is specific to the standard - * doclet and does not exactly resemble the W3C specifications. - * - * @return true if end tag needs to be displayed else return false - */ - public boolean endTagRequired() { - return (endTag == EndTag.END); - } - - /** - * Returns true if the tag is allowed in the output HTML version of this javadoc run. - * - * @param htmlVer the output HTML version for this javadoc run - * @return true if the tag is allowed - */ - public boolean allowTag(HtmlVersion htmlVer) { - return (this.htmlVersion == HtmlVersion.ALL || this.htmlVersion == htmlVer); - } - - public String toString() { - return value; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java +++ /dev/null @@ -1,973 +0,0 @@ -/* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import java.io.IOException; -import java.io.Writer; -import java.util.*; -import java.nio.charset.*; - -import com.sun.tools.doclets.internal.toolkit.Content; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.doclets.formats.html.markup.HtmlAttr.Role; - -/** - * Class for generating HTML tree for javadoc output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public class HtmlTree extends Content { - - private HtmlTag htmlTag; - private Map attrs = Collections.emptyMap(); - private List content = Collections.emptyList(); - public static final Content EMPTY = new StringContent(""); - - /** - * Constructor to construct HtmlTree object. - * - * @param tag HTML tag for the HtmlTree object - */ - public HtmlTree(HtmlTag tag) { - htmlTag = nullCheck(tag); - } - - /** - * Constructor to construct HtmlTree object. - * - * @param tag HTML tag for the HtmlTree object - * @param contents contents to be added to the tree - */ - public HtmlTree(HtmlTag tag, Content... contents) { - this(tag); - for (Content content: contents) - addContent(content); - } - - /** - * Adds an attribute for the HTML tag. - * - * @param attrName name of the attribute - * @param attrValue value of the attribute - */ - public void addAttr(HtmlAttr attrName, String attrValue) { - if (attrs.isEmpty()) - attrs = new LinkedHashMap<>(3); - attrs.put(nullCheck(attrName), escapeHtmlChars(attrValue)); - } - - public void setTitle(Content body) { - addAttr(HtmlAttr.TITLE, stripHtml(body)); - } - - public void setRole(Role role) { - addAttr(HtmlAttr.ROLE, role.toString()); - } - - /** - * Adds a style for the HTML tag. - * - * @param style style to be added - */ - public void addStyle(HtmlStyle style) { - addAttr(HtmlAttr.CLASS, style.toString()); - } - - /** - * Adds content for the HTML tag. - * - * @param tagContent tag content to be added - */ - public void addContent(Content tagContent) { - if (tagContent instanceof ContentBuilder) { - for (Content content: ((ContentBuilder)tagContent).contents) { - addContent(content); - } - } - else if (tagContent == HtmlTree.EMPTY || tagContent.isValid()) { - if (content.isEmpty()) - content = new ArrayList<>(); - content.add(tagContent); - } - } - - /** - * This method adds a string content to the htmltree. If the last content member - * added is a StringContent, append the string to that StringContent or else - * create a new StringContent and add it to the html tree. - * - * @param stringContent string content that needs to be added - */ - public void addContent(String stringContent) { - if (!content.isEmpty()) { - Content lastContent = content.get(content.size() - 1); - if (lastContent instanceof StringContent) - lastContent.addContent(stringContent); - else - addContent(new StringContent(stringContent)); - } - else - addContent(new StringContent(stringContent)); - } - - public int charCount() { - int n = 0; - for (Content c : content) - n += c.charCount(); - return n; - } - - /** - * Given a string, escape all special html characters and - * return the result. - * - * @param s The string to check. - * @return the original string with all of the HTML characters escaped. - */ - private static String escapeHtmlChars(String s) { - for (int i = 0; i < s.length(); i++) { - char ch = s.charAt(i); - switch (ch) { - // only start building a new string if we need to - case '<': case '>': case '&': - StringBuilder sb = new StringBuilder(s.substring(0, i)); - for ( ; i < s.length(); i++) { - ch = s.charAt(i); - switch (ch) { - case '<': sb.append("<"); break; - case '>': sb.append(">"); break; - case '&': sb.append("&"); break; - default: sb.append(ch); break; - } - } - return sb.toString(); - } - } - return s; - } - - /** - * A set of ASCII URI characters to be left unencoded. - */ - public static final BitSet NONENCODING_CHARS = new BitSet(256); - - static { - // alphabetic characters - for (int i = 'a'; i <= 'z'; i++) { - NONENCODING_CHARS.set(i); - } - for (int i = 'A'; i <= 'Z'; i++) { - NONENCODING_CHARS.set(i); - } - // numeric characters - for (int i = '0'; i <= '9'; i++) { - NONENCODING_CHARS.set(i); - } - // Reserved characters as per RFC 3986. These are set of delimiting characters. - String noEnc = ":/?#[]@!$&'()*+,;="; - // Unreserved characters as per RFC 3986 which should not be percent encoded. - noEnc += "-._~"; - for (int i = 0; i < noEnc.length(); i++) { - NONENCODING_CHARS.set(noEnc.charAt(i)); - } - } - - private static String encodeURL(String url) { - StringBuilder sb = new StringBuilder(); - for (byte c : url.getBytes(Charset.forName("UTF-8"))) { - if (NONENCODING_CHARS.get(c & 0xFF)) { - sb.append((char) c); - } else { - sb.append(String.format("%%%02X", c & 0xFF)); - } - } - return sb.toString(); - } - - /** - * Generates an HTML anchor tag. - * - * @param ref reference url for the anchor tag - * @param body content for the anchor tag - * @return an HtmlTree object - */ - public static HtmlTree A(String ref, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.A, nullCheck(body)); - htmltree.addAttr(HtmlAttr.HREF, encodeURL(ref)); - return htmltree; - } - - /** - * Generates an HTML anchor tag with an id or a name attribute and content. - * - * @param htmlVersion the version of the generated HTML - * @param attr name or id attribute for the anchor tag - * @param body content for the anchor tag - * @return an HtmlTree object - */ - public static HtmlTree A(HtmlVersion htmlVersion, String attr, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.A); - htmltree.addAttr((htmlVersion == HtmlVersion.HTML4) - ? HtmlAttr.NAME - : HtmlAttr.ID, - nullCheck(attr)); - htmltree.addContent(nullCheck(body)); - return htmltree; - } - - /** - * Generates an HTML anchor tag with id attribute and a body. - * - * @param id id for the anchor tag - * @param body body for the anchor tag - * @return an HtmlTree object - */ - public static HtmlTree A_ID(String id, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.A); - htmltree.addAttr(HtmlAttr.ID, nullCheck(id)); - htmltree.addContent(nullCheck(body)); - return htmltree; - } - - /** - * Generates a CAPTION tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the CAPTION tag - */ - public static HtmlTree CAPTION(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.CAPTION, nullCheck(body)); - return htmltree; - } - - /** - * Generates a CODE tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the CODE tag - */ - public static HtmlTree CODE(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.CODE, nullCheck(body)); - return htmltree; - } - - /** - * Generates a DD tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the DD tag - */ - public static HtmlTree DD(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.DD, nullCheck(body)); - return htmltree; - } - - /** - * Generates a DL tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the DL tag - */ - public static HtmlTree DL(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.DL, nullCheck(body)); - return htmltree; - } - - /** - * Generates a DIV tag with the style class attributes. It also encloses - * a content. - * - * @param styleClass stylesheet class for the tag - * @param body content for the tag - * @return an HtmlTree object for the DIV tag - */ - public static HtmlTree DIV(HtmlStyle styleClass, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.DIV, nullCheck(body)); - if (styleClass != null) - htmltree.addStyle(styleClass); - return htmltree; - } - - /** - * Generates a DIV tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the DIV tag - */ - public static HtmlTree DIV(Content body) { - return DIV(null, body); - } - - /** - * Generates a DT tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the DT tag - */ - public static HtmlTree DT(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.DT, nullCheck(body)); - return htmltree; - } - - /** - * Generates a FOOTER tag with role attribute. - * - * @return an HtmlTree object for the FOOTER tag - */ - public static HtmlTree FOOTER() { - HtmlTree htmltree = new HtmlTree(HtmlTag.FOOTER); - htmltree.setRole(Role.CONTENTINFO); - return htmltree; - } - - /** - * Generates a HEADER tag with role attribute. - * - * @return an HtmlTree object for the HEADER tag - */ - public static HtmlTree HEADER() { - HtmlTree htmltree = new HtmlTree(HtmlTag.HEADER); - htmltree.setRole(Role.BANNER); - return htmltree; - } - - /** - * Generates a heading tag (h1 to h6) with the title and style class attributes. It also encloses - * a content. - * - * @param headingTag the heading tag to be generated - * @param printTitle true if title for the tag needs to be printed else false - * @param styleClass stylesheet class for the tag - * @param body content for the tag - * @return an HtmlTree object for the tag - */ - public static HtmlTree HEADING(HtmlTag headingTag, boolean printTitle, - HtmlStyle styleClass, Content body) { - HtmlTree htmltree = new HtmlTree(headingTag, nullCheck(body)); - if (printTitle) - htmltree.setTitle(body); - if (styleClass != null) - htmltree.addStyle(styleClass); - return htmltree; - } - - /** - * Generates a heading tag (h1 to h6) with style class attribute. It also encloses - * a content. - * - * @param headingTag the heading tag to be generated - * @param styleClass stylesheet class for the tag - * @param body content for the tag - * @return an HtmlTree object for the tag - */ - public static HtmlTree HEADING(HtmlTag headingTag, HtmlStyle styleClass, Content body) { - return HEADING(headingTag, false, styleClass, body); - } - - /** - * Generates a heading tag (h1 to h6) with the title attribute. It also encloses - * a content. - * - * @param headingTag the heading tag to be generated - * @param printTitle true if the title for the tag needs to be printed else false - * @param body content for the tag - * @return an HtmlTree object for the tag - */ - public static HtmlTree HEADING(HtmlTag headingTag, boolean printTitle, Content body) { - return HEADING(headingTag, printTitle, null, body); - } - - /** - * Generates a heading tag (h1 to h6) with some content. - * - * @param headingTag the heading tag to be generated - * @param body content for the tag - * @return an HtmlTree object for the tag - */ - public static HtmlTree HEADING(HtmlTag headingTag, Content body) { - return HEADING(headingTag, false, null, body); - } - - /** - * Generates an HTML tag with lang attribute. It also adds head and body - * content to the HTML tree. - * - * @param lang language for the HTML document - * @param head head for the HTML tag - * @param body body for the HTML tag - * @return an HtmlTree object for the HTML tag - */ - public static HtmlTree HTML(String lang, Content head, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.HTML, nullCheck(head), nullCheck(body)); - htmltree.addAttr(HtmlAttr.LANG, nullCheck(lang)); - return htmltree; - } - - /** - * Generates a IFRAME tag. - * - * @param src the url of the document to be shown in the frame - * @param name specifies the name of the frame - * @param title the title for the frame - * @return an HtmlTree object for the IFRAME tag - */ - public static HtmlTree IFRAME(String src, String name, String title) { - HtmlTree htmltree = new HtmlTree(HtmlTag.IFRAME); - htmltree.addAttr(HtmlAttr.SRC, nullCheck(src)); - htmltree.addAttr(HtmlAttr.NAME, nullCheck(name)); - htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title)); - return htmltree; - } - - /** - * Generates a INPUT tag with some id. - * - * @param type the type of input - * @param id id for the tag - * @return an HtmlTree object for the INPUT tag - */ - public static HtmlTree INPUT(String type, String id) { - HtmlTree htmltree = new HtmlTree(HtmlTag.INPUT); - htmltree.addAttr(HtmlAttr.TYPE, nullCheck(type)); - htmltree.addAttr(HtmlAttr.ID, nullCheck(id)); - htmltree.addAttr(HtmlAttr.VALUE, " "); - htmltree.addAttr(HtmlAttr.DISABLED, "disabled"); - return htmltree; - } - - /** - * Generates a LI tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the LI tag - */ - public static HtmlTree LI(Content body) { - return LI(null, body); - } - - /** - * Generates a LI tag with some content. - * - * @param styleClass style for the tag - * @param body content for the tag - * @return an HtmlTree object for the LI tag - */ - public static HtmlTree LI(HtmlStyle styleClass, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.LI, nullCheck(body)); - if (styleClass != null) - htmltree.addStyle(styleClass); - return htmltree; - } - - /** - * Generates a LINK tag with the rel, type, href and title attributes. - * - * @param rel relevance of the link - * @param type type of link - * @param href the path for the link - * @param title title for the link - * @return an HtmlTree object for the LINK tag - */ - public static HtmlTree LINK(String rel, String type, String href, String title) { - HtmlTree htmltree = new HtmlTree(HtmlTag.LINK); - htmltree.addAttr(HtmlAttr.REL, nullCheck(rel)); - htmltree.addAttr(HtmlAttr.TYPE, nullCheck(type)); - htmltree.addAttr(HtmlAttr.HREF, nullCheck(href)); - htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title)); - return htmltree; - } - - /** - * Generates a MAIN tag with role attribute. - * - * @return an HtmlTree object for the MAIN tag - */ - public static HtmlTree MAIN() { - HtmlTree htmltree = new HtmlTree(HtmlTag.MAIN); - htmltree.setRole(Role.MAIN); - return htmltree; - } - - /** - * Generates a MAIN tag with role attribute and some content. - * - * @param body content of the MAIN tag - * @return an HtmlTree object for the MAIN tag - */ - public static HtmlTree MAIN(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.MAIN, nullCheck(body)); - htmltree.setRole(Role.MAIN); - return htmltree; - } - - /** - * Generates a MAIN tag with role attribute, style attribute and some content. - * - * @param styleClass style of the MAIN tag - * @param body content of the MAIN tag - * @return an HtmlTree object for the MAIN tag - */ - public static HtmlTree MAIN(HtmlStyle styleClass, Content body) { - HtmlTree htmltree = HtmlTree.MAIN(body); - if (styleClass != null) { - htmltree.addStyle(styleClass); - } - return htmltree; - } - - /** - * Generates a META tag with the http-equiv, content and charset attributes. - * - * @param httpEquiv http equiv attribute for the META tag - * @param content type of content - * @param charSet character set used - * @return an HtmlTree object for the META tag - */ - public static HtmlTree META(String httpEquiv, String content, String charSet) { - HtmlTree htmltree = new HtmlTree(HtmlTag.META); - String contentCharset = content + "; charset=" + charSet; - htmltree.addAttr(HtmlAttr.HTTP_EQUIV, nullCheck(httpEquiv)); - htmltree.addAttr(HtmlAttr.CONTENT, contentCharset); - return htmltree; - } - - /** - * Generates a META tag with the name and content attributes. - * - * @param name name attribute - * @param content type of content - * @return an HtmlTree object for the META tag - */ - public static HtmlTree META(String name, String content) { - HtmlTree htmltree = new HtmlTree(HtmlTag.META); - htmltree.addAttr(HtmlAttr.NAME, nullCheck(name)); - htmltree.addAttr(HtmlAttr.CONTENT, nullCheck(content)); - return htmltree; - } - - /** - * Generates a NAV tag with the role attribute. - * - * @return an HtmlTree object for the NAV tag - */ - public static HtmlTree NAV() { - HtmlTree htmltree = new HtmlTree(HtmlTag.NAV); - htmltree.setRole(Role.NAVIGATION); - return htmltree; - } - - /** - * Generates a NOSCRIPT tag with some content. - * - * @param body content of the noscript tag - * @return an HtmlTree object for the NOSCRIPT tag - */ - public static HtmlTree NOSCRIPT(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.NOSCRIPT, nullCheck(body)); - return htmltree; - } - - /** - * Generates a P tag with some content. - * - * @param body content of the Paragraph tag - * @return an HtmlTree object for the P tag - */ - public static HtmlTree P(Content body) { - return P(null, body); - } - - /** - * Generates a P tag with some content. - * - * @param styleClass style of the Paragraph tag - * @param body content of the Paragraph tag - * @return an HtmlTree object for the P tag - */ - public static HtmlTree P(HtmlStyle styleClass, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.P, nullCheck(body)); - if (styleClass != null) - htmltree.addStyle(styleClass); - return htmltree; - } - - /** - * Generates a SCRIPT tag with the type and src attributes. - * - * @param type type of link - * @param src the path for the script - * @return an HtmlTree object for the SCRIPT tag - */ - public static HtmlTree SCRIPT(String src) { - HtmlTree htmltree = HtmlTree.SCRIPT(); - htmltree.addAttr(HtmlAttr.SRC, nullCheck(src)); - return htmltree; - } - - /** - * Generates a SCRIPT tag with the type attribute. - * - * @return an HtmlTree object for the SCRIPT tag - */ - public static HtmlTree SCRIPT() { - HtmlTree htmltree = new HtmlTree(HtmlTag.SCRIPT); - htmltree.addAttr(HtmlAttr.TYPE, "text/javascript"); - return htmltree; - } - - /** - * Generates a SECTION tag with role attribute. - * - * @return an HtmlTree object for the SECTION tag - */ - public static HtmlTree SECTION() { - HtmlTree htmltree = new HtmlTree(HtmlTag.SECTION); - htmltree.setRole(Role.REGION); - return htmltree; - } - - /** - * Generates a SECTION tag with role attribute and some content. - * - * @param body content of the section tag - * @return an HtmlTree object for the SECTION tag - */ - public static HtmlTree SECTION(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.SECTION, nullCheck(body)); - htmltree.setRole(Role.REGION); - return htmltree; - } - - /** - * Generates a SMALL tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the SMALL tag - */ - public static HtmlTree SMALL(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.SMALL, nullCheck(body)); - return htmltree; - } - - /** - * Generates a SPAN tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the SPAN tag - */ - public static HtmlTree SPAN(Content body) { - return SPAN(null, body); - } - - /** - * Generates a SPAN tag with style class attribute and some content. - * - * @param styleClass style class for the tag - * @param body content for the tag - * @return an HtmlTree object for the SPAN tag - */ - public static HtmlTree SPAN(HtmlStyle styleClass, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.SPAN, nullCheck(body)); - if (styleClass != null) - htmltree.addStyle(styleClass); - return htmltree; - } - - /** - * Generates a SPAN tag with id and style class attributes. It also encloses - * a content. - * - * @param id the id for the tag - * @param styleClass stylesheet class for the tag - * @param body content for the tag - * @return an HtmlTree object for the SPAN tag - */ - public static HtmlTree SPAN(String id, HtmlStyle styleClass, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.SPAN, nullCheck(body)); - htmltree.addAttr(HtmlAttr.ID, nullCheck(id)); - if (styleClass != null) - htmltree.addStyle(styleClass); - return htmltree; - } - - /** - * Generates a Table tag with style class and summary attributes and some content. - * - * @param styleClass style of the table - * @param summary summary for the table - * @param body content for the table - * @return an HtmlTree object for the TABLE tag - */ - public static HtmlTree TABLE(HtmlStyle styleClass, String summary, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body)); - if (styleClass != null) - htmltree.addStyle(styleClass); - htmltree.addAttr(HtmlAttr.SUMMARY, nullCheck(summary)); - return htmltree; - } - - /** - * Generates a Table tag with style class attribute and some content. - * - * @param styleClass style of the table - * @param body content for the table - * @return an HtmlTree object for the TABLE tag - */ - public static HtmlTree TABLE(HtmlStyle styleClass, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body)); - if (styleClass != null) { - htmltree.addStyle(styleClass); - } - return htmltree; - } - - /** - * Generates a TD tag with style class attribute and some content. - * - * @param styleClass style for the tag - * @param body content for the tag - * @return an HtmlTree object for the TD tag - */ - public static HtmlTree TD(HtmlStyle styleClass, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.TD, nullCheck(body)); - if (styleClass != null) - htmltree.addStyle(styleClass); - return htmltree; - } - - /** - * Generates a TD tag for an HTML table with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the TD tag - */ - public static HtmlTree TD(Content body) { - return TD(null, body); - } - - /** - * Generates a TH tag with style class and scope attributes and some content. - * - * @param styleClass style for the tag - * @param scope scope of the tag - * @param body content for the tag - * @return an HtmlTree object for the TH tag - */ - public static HtmlTree TH(HtmlStyle styleClass, String scope, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.TH, nullCheck(body)); - if (styleClass != null) - htmltree.addStyle(styleClass); - htmltree.addAttr(HtmlAttr.SCOPE, nullCheck(scope)); - return htmltree; - } - - /** - * Generates a TH tag with scope attribute and some content. - * - * @param scope scope of the tag - * @param body content for the tag - * @return an HtmlTree object for the TH tag - */ - public static HtmlTree TH(String scope, Content body) { - return TH(null, scope, body); - } - - /** - * Generates a TITLE tag with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the TITLE tag - */ - public static HtmlTree TITLE(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.TITLE, nullCheck(body)); - return htmltree; - } - - /** - * Generates a TR tag for an HTML table with some content. - * - * @param body content for the tag - * @return an HtmlTree object for the TR tag - */ - public static HtmlTree TR(Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.TR, nullCheck(body)); - return htmltree; - } - - /** - * Generates a UL tag with the style class attribute and some content. - * - * @param styleClass style for the tag - * @param body content for the tag - * @return an HtmlTree object for the UL tag - */ - public static HtmlTree UL(HtmlStyle styleClass, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.UL, nullCheck(body)); - htmltree.addStyle(nullCheck(styleClass)); - return htmltree; - } - - /** - * {@inheritDoc} - */ - public boolean isEmpty() { - return (!hasContent() && !hasAttrs()); - } - - /** - * Returns true if the HTML tree has content. - * - * @return true if the HTML tree has content else return false - */ - public boolean hasContent() { - return (!content.isEmpty()); - } - - /** - * Returns true if the HTML tree has attributes. - * - * @return true if the HTML tree has attributes else return false - */ - public boolean hasAttrs() { - return (!attrs.isEmpty()); - } - - /** - * Returns true if the HTML tree has a specific attribute. - * - * @param attrName name of the attribute to check within the HTML tree - * @return true if the HTML tree has the specified attribute else return false - */ - public boolean hasAttr(HtmlAttr attrName) { - return (attrs.containsKey(attrName)); - } - - /** - * Returns true if the HTML tree is valid. This check is more specific to - * standard doclet and not exactly similar to W3C specifications. But it - * ensures HTML validation. - * - * @return true if the HTML tree is valid - */ - public boolean isValid() { - switch (htmlTag) { - case A : - return (hasAttr(HtmlAttr.NAME) || hasAttr(HtmlAttr.ID) || (hasAttr(HtmlAttr.HREF) && hasContent())); - case BR : - return (!hasContent() && (!hasAttrs() || hasAttr(HtmlAttr.CLEAR))); - case IFRAME : - return (hasAttr(HtmlAttr.SRC) && !hasContent()); - case HR : - case INPUT: - return (!hasContent()); - case IMG : - return (hasAttr(HtmlAttr.SRC) && hasAttr(HtmlAttr.ALT) && !hasContent()); - case LINK : - return (hasAttr(HtmlAttr.HREF) && !hasContent()); - case META : - return (hasAttr(HtmlAttr.CONTENT) && !hasContent()); - case SCRIPT : - return ((hasAttr(HtmlAttr.TYPE) && hasAttr(HtmlAttr.SRC) && !hasContent()) || - (hasAttr(HtmlAttr.TYPE) && hasContent())); - default : - return hasContent(); - } - } - - /** - * Returns true if the element is an inline element. - * - * @return true if the HTML tag is an inline element - */ - public boolean isInline() { - return (htmlTag.blockType == HtmlTag.BlockType.INLINE); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean write(Writer out, boolean atNewline) throws IOException { - if (!isInline() && !atNewline) - out.write(DocletConstants.NL); - String tagString = htmlTag.toString(); - out.write("<"); - out.write(tagString); - Iterator iterator = attrs.keySet().iterator(); - HtmlAttr key; - String value; - while (iterator.hasNext()) { - key = iterator.next(); - value = attrs.get(key); - out.write(" "); - out.write(key.toString()); - if (!value.isEmpty()) { - out.write("=\""); - out.write(value); - out.write("\""); - } - } - out.write(">"); - boolean nl = false; - for (Content c : content) - nl = c.write(out, nl); - if (htmlTag.endTagRequired()) { - out.write(""); - } - if (!isInline()) { - out.write(DocletConstants.NL); - return true; - } else { - return false; - } - } - - /** - * Given a Content node, strips all html characters and - * return the result. - * - * @param body The content node to check. - * @return the plain text from the content node - * - */ - private static String stripHtml(Content body) { - String rawString = body.toString(); - // remove HTML tags - rawString = rawString.replaceAll("\\<.*?>", " "); - // consolidate multiple spaces between a word to a single space - rawString = rawString.replaceAll("\\b\\s{2,}\\b", " "); - // remove extra whitespaces - return rawString.trim(); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlVersion.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlVersion.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlVersion.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -/** - * Enum representing the version of HTML generated by javadoc. - * - * @author Bhavesh Patel - */ -@Deprecated -public enum HtmlVersion { - HTML4, - HTML5, - ALL -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java +++ /dev/null @@ -1,520 +0,0 @@ -/* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import java.io.*; -import java.util.*; - -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Class for the Html format code generation. - * Initializes PrintWriter with FileWriter, to enable print - * related methods to generate the code to the named File through FileWriter. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @since 1.2 - * @author Atul M Dambalkar - * @author Bhavesh Patel (Modified) - */ -@Deprecated -public class HtmlWriter { - - /** - * The window title of this file - */ - protected String winTitle; - - /** - * The configuration - */ - protected Configuration configuration; - - /** - * The flag to indicate whether a member details list is printed or not. - */ - protected boolean memberDetailsListPrinted; - - /** - * Header for tables displaying packages and description.. - */ - protected final String[] packageTableHeader; - - /** - * Summary for use tables displaying class and package use. - */ - protected final String useTableSummary; - - /** - * Column header for class docs displaying Modifier and Type header. - */ - protected final String modifierTypeHeader; - - public final Content overviewLabel; - - public final Content defaultPackageLabel; - - public final Content packageLabel; - - public final Content useLabel; - - public final Content prevLabel; - - public final Content nextLabel; - - public final Content prevclassLabel; - - public final Content nextclassLabel; - - public final Content summaryLabel; - - public final Content detailLabel; - - public final Content framesLabel; - - public final Content noframesLabel; - - public final Content treeLabel; - - public final Content classLabel; - - public final Content deprecatedLabel; - - public final Content deprecatedPhrase; - - public final Content allclassesLabel; - - public final Content allpackagesLabel; - - public final Content indexLabel; - - public final Content helpLabel; - - public final Content seeLabel; - - public final Content descriptionLabel; - - public final Content prevpackageLabel; - - public final Content nextpackageLabel; - - public final Content packagesLabel; - - public final Content methodDetailsLabel; - - public final Content annotationTypeDetailsLabel; - - public final Content fieldDetailsLabel; - - public final Content propertyDetailsLabel; - - public final Content constructorDetailsLabel; - - public final Content enumConstantsDetailsLabel; - - public final Content specifiedByLabel; - - public final Content overridesLabel; - - public final Content descfrmClassLabel; - - public final Content descfrmInterfaceLabel; - - private final DocFile file; - - private Writer writer; - - protected Content script; - - /** - * Constructor. - * - * @param path The directory path to be created for this file - * or null if none to be created. - * @exception IOException Exception raised by the FileWriter is passed on - * to next level. - * @exception UnsupportedEncodingException Exception raised by the - * OutputStreamWriter is passed on to next level. - */ - public HtmlWriter(Configuration configuration, DocPath path) - throws IOException, UnsupportedEncodingException { - file = DocFile.createFileForOutput(configuration, path); - this.configuration = configuration; - this.memberDetailsListPrinted = false; - packageTableHeader = new String[] { - configuration.getText("doclet.Package"), - configuration.getText("doclet.Description") - }; - useTableSummary = configuration.getText("doclet.Use_Table_Summary", - configuration.getText("doclet.packages")); - modifierTypeHeader = configuration.getText("doclet.0_and_1", - configuration.getText("doclet.Modifier"), - configuration.getText("doclet.Type")); - overviewLabel = getResource("doclet.Overview"); - defaultPackageLabel = new StringContent(DocletConstants.DEFAULT_PACKAGE_NAME); - packageLabel = getResource("doclet.Package"); - useLabel = getResource("doclet.navClassUse"); - prevLabel = getResource("doclet.Prev"); - nextLabel = getResource("doclet.Next"); - prevclassLabel = getNonBreakResource("doclet.Prev_Class"); - nextclassLabel = getNonBreakResource("doclet.Next_Class"); - summaryLabel = getResource("doclet.Summary"); - detailLabel = getResource("doclet.Detail"); - framesLabel = getResource("doclet.Frames"); - noframesLabel = getNonBreakResource("doclet.No_Frames"); - treeLabel = getResource("doclet.Tree"); - classLabel = getResource("doclet.Class"); - deprecatedLabel = getResource("doclet.navDeprecated"); - deprecatedPhrase = getResource("doclet.Deprecated"); - allclassesLabel = getNonBreakResource("doclet.All_Classes"); - allpackagesLabel = getNonBreakResource("doclet.All_Packages"); - indexLabel = getResource("doclet.Index"); - helpLabel = getResource("doclet.Help"); - seeLabel = getResource("doclet.See"); - descriptionLabel = getResource("doclet.Description"); - prevpackageLabel = getNonBreakResource("doclet.Prev_Package"); - nextpackageLabel = getNonBreakResource("doclet.Next_Package"); - packagesLabel = getResource("doclet.Packages"); - methodDetailsLabel = getResource("doclet.Method_Detail"); - annotationTypeDetailsLabel = getResource("doclet.Annotation_Type_Member_Detail"); - fieldDetailsLabel = getResource("doclet.Field_Detail"); - propertyDetailsLabel = getResource("doclet.Property_Detail"); - constructorDetailsLabel = getResource("doclet.Constructor_Detail"); - enumConstantsDetailsLabel = getResource("doclet.Enum_Constant_Detail"); - specifiedByLabel = getResource("doclet.Specified_By"); - overridesLabel = getResource("doclet.Overrides"); - descfrmClassLabel = getResource("doclet.Description_From_Class"); - descfrmInterfaceLabel = getResource("doclet.Description_From_Interface"); - } - - public void write(Content c) throws IOException { - writer = file.openWriter(); - c.write(writer, true); - } - - public void close() throws IOException { - writer.close(); - } - - /** - * Get the configuration string as a content. - * - * @param key the key to look for in the configuration file - * @return a content tree for the text - */ - public Content getResource(String key) { - return configuration.getResource(key); - } - - /** - * Get the configuration string as a content, replacing spaces - * with non-breaking spaces. - * - * @param key the key to look for in the configuration file - * @return a content tree for the text - */ - public Content getNonBreakResource(String key) { - String text = configuration.getText(key); - Content c = configuration.newContent(); - int start = 0; - int p; - while ((p = text.indexOf(" ", start)) != -1) { - c.addContent(text.substring(start, p)); - c.addContent(RawHtml.nbsp); - start = p + 1; - } - c.addContent(text.substring(start)); - return c; - } - - /** - * Get the configuration string as a content. - * - * @param key the key to look for in the configuration file - * @param o string or content argument added to configuration text - * @return a content tree for the text - */ - public Content getResource(String key, Object o) { - return configuration.getResource(key, o); - } - - /** - * Get the configuration string as a content. - * - * @param key the key to look for in the configuration file - * @param o1 string or content argument added to configuration text - * @param o2 string or content argument added to configuration text - * @return a content tree for the text - */ - public Content getResource(String key, Object o0, Object o1) { - return configuration.getResource(key, o0, o1); - } - - /** - * Returns an HtmlTree for the SCRIPT tag. - * - * @return an HtmlTree for the SCRIPT tag - */ - protected HtmlTree getWinTitleScript(){ - HtmlTree script = HtmlTree.SCRIPT(); - if(winTitle != null && winTitle.length() > 0) { - String scriptCode = "" + DocletConstants.NL; - RawHtml scriptContent = new RawHtml(scriptCode); - script.addContent(scriptContent); - } - return script; - } - - /** - * Returns a String with escaped special JavaScript characters. - * - * @param s String that needs to be escaped - * @return a valid escaped JavaScript string - */ - private static String escapeJavaScriptChars(String s) { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < s.length(); i++) { - char ch = s.charAt(i); - switch (ch) { - case '\b': - sb.append("\\b"); - break; - case '\t': - sb.append("\\t"); - break; - case '\n': - sb.append("\\n"); - break; - case '\f': - sb.append("\\f"); - break; - case '\r': - sb.append("\\r"); - break; - case '"': - sb.append("\\\""); - break; - case '\'': - sb.append("\\\'"); - break; - case '\\': - sb.append("\\\\"); - break; - default: - if (ch < 32 || ch >= 127) { - sb.append(String.format("\\u%04X", (int)ch)); - } else { - sb.append(ch); - } - break; - } - } - return sb.toString(); - } - - /** - * Returns a content tree for the SCRIPT tag for the main page(index.html). - * - * @return a content for the SCRIPT tag - */ - protected Content getFramesJavaScript() { - HtmlTree script = HtmlTree.SCRIPT(); - String scriptCode = DocletConstants.NL + - " tmpTargetPage = \"\" + window.location.search;" + DocletConstants.NL + - " if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")" + DocletConstants.NL + - " tmpTargetPage = tmpTargetPage.substring(1);" + DocletConstants.NL + - " if (tmpTargetPage.indexOf(\":\") != -1 || (tmpTargetPage != \"\" && !validURL(tmpTargetPage)))" + DocletConstants.NL + - " tmpTargetPage = \"undefined\";" + DocletConstants.NL + - " targetPage = tmpTargetPage;" + DocletConstants.NL + - " function validURL(url) {" + DocletConstants.NL + - " try {" + DocletConstants.NL + - " url = decodeURIComponent(url);" + DocletConstants.NL + - " }" + DocletConstants.NL + - " catch (error) {" + DocletConstants.NL + - " return false;" + DocletConstants.NL + - " }" + DocletConstants.NL + - " var pos = url.indexOf(\".html\");" + DocletConstants.NL + - " if (pos == -1 || pos != url.length - 5)" + DocletConstants.NL + - " return false;" + DocletConstants.NL + - " var allowNumber = false;" + DocletConstants.NL + - " var allowSep = false;" + DocletConstants.NL + - " var seenDot = false;" + DocletConstants.NL + - " for (var i = 0; i < url.length - 5; i++) {" + DocletConstants.NL + - " var ch = url.charAt(i);" + DocletConstants.NL + - " if ('a' <= ch && ch <= 'z' ||" + DocletConstants.NL + - " 'A' <= ch && ch <= 'Z' ||" + DocletConstants.NL + - " ch == '$' ||" + DocletConstants.NL + - " ch == '_' ||" + DocletConstants.NL + - " ch.charCodeAt(0) > 127) {" + DocletConstants.NL + - " allowNumber = true;" + DocletConstants.NL + - " allowSep = true;" + DocletConstants.NL + - " } else if ('0' <= ch && ch <= '9'" + DocletConstants.NL + - " || ch == '-') {" + DocletConstants.NL + - " if (!allowNumber)" + DocletConstants.NL + - " return false;" + DocletConstants.NL + - " } else if (ch == '/' || ch == '.') {" + DocletConstants.NL + - " if (!allowSep)" + DocletConstants.NL + - " return false;" + DocletConstants.NL + - " allowNumber = false;" + DocletConstants.NL + - " allowSep = false;" + DocletConstants.NL + - " if (ch == '.')" + DocletConstants.NL + - " seenDot = true;" + DocletConstants.NL + - " if (ch == '/' && seenDot)" + DocletConstants.NL + - " return false;" + DocletConstants.NL + - " } else {" + DocletConstants.NL + - " return false;"+ DocletConstants.NL + - " }" + DocletConstants.NL + - " }" + DocletConstants.NL + - " return true;" + DocletConstants.NL + - " }" + DocletConstants.NL + - " function loadFrames() {" + DocletConstants.NL + - " if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL + - " top.classFrame.location = top.targetPage;" + DocletConstants.NL + - " }" + DocletConstants.NL; - RawHtml scriptContent = new RawHtml(scriptCode); - script.addContent(scriptContent); - return script; - } - - /** - * Returns an HtmlTree for the BODY tag. - * - * @param includeScript set true if printing windowtitle script - * @param title title for the window - * @return an HtmlTree for the BODY tag - */ - public HtmlTree getBody(boolean includeScript, String title) { - HtmlTree body = new HtmlTree(HtmlTag.BODY); - // Set window title string which is later printed - this.winTitle = title; - // Don't print windowtitle script for overview-frame, allclasses-frame - // and package-frame - if (includeScript) { - this.script = getWinTitleScript(); - body.addContent(script); - Content noScript = HtmlTree.NOSCRIPT( - HtmlTree.DIV(getResource("doclet.No_Script_Message"))); - body.addContent(noScript); - } - return body; - } - - /** - * Generated javascript variables for the document. - * - * @param typeMap map comprising of method and type relationship - * @param methodTypes set comprising of all methods types for this class - */ - public void generateMethodTypesScript(Map typeMap, - Set methodTypes) { - String sep = ""; - StringBuilder vars = new StringBuilder("var methods = {"); - for (Map.Entry entry : typeMap.entrySet()) { - vars.append(sep); - sep = ","; - vars.append("\"") - .append(entry.getKey()) - .append("\":") - .append(entry.getValue()); - } - vars.append("};").append(DocletConstants.NL); - sep = ""; - vars.append("var tabs = {"); - for (MethodTypes entry : methodTypes) { - vars.append(sep); - sep = ","; - vars.append(entry.value()) - .append(":") - .append("[") - .append("\"") - .append(entry.tabId()) - .append("\"") - .append(sep) - .append("\"") - .append(configuration.getText(entry.resourceKey())) - .append("\"]"); - } - vars.append("};") - .append(DocletConstants.NL); - addStyles(HtmlStyle.altColor, vars); - addStyles(HtmlStyle.rowColor, vars); - addStyles(HtmlStyle.tableTab, vars); - addStyles(HtmlStyle.activeTableTab, vars); - script.addContent(new RawHtml(vars.toString())); - } - - /** - * Adds javascript style variables to the document. - * - * @param style style to be added as a javascript variable - * @param vars variable string to which the style variable will be added - */ - public void addStyles(HtmlStyle style, StringBuilder vars) { - vars.append("var ").append(style).append(" = \"").append(style) - .append("\";").append(DocletConstants.NL); - } - - /** - * Returns an HtmlTree for the TITLE tag. - * - * @return an HtmlTree for the TITLE tag - */ - public HtmlTree getTitle() { - HtmlTree title = HtmlTree.TITLE(new StringContent(winTitle)); - return title; - } - - public String codeText(String text) { - return "" + text + ""; - } - - /** - * Return "&nbsp;", non-breaking space. - */ - public Content getSpace() { - return RawHtml.nbsp; - } - - /* - * Returns a header for Modifier and Type column of a table. - */ - public String getModifierTypeHeader() { - return modifierTypeHeader; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/RawHtml.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/RawHtml.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/RawHtml.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import java.io.IOException; -import java.io.Writer; - -import com.sun.tools.doclets.internal.toolkit.Content; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Class for generating raw HTML content to be added to HTML pages of javadoc output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public class RawHtml extends Content { - - private String rawHtmlContent; - - public static final Content nbsp = new RawHtml(" "); - - /** - * Constructor to construct a RawHtml object. - * - * @param rawHtml raw HTML text to be added - */ - public RawHtml(String rawHtml) { - rawHtmlContent = nullCheck(rawHtml); - } - - /** - * This method is not supported by the class. - * - * @param content content that needs to be added - * @throws DocletAbortException this method will always throw a - * DocletAbortException because it - * is not supported. - */ - public void addContent(Content content) { - throw new DocletAbortException("not supported"); - } - - /** - * This method is not supported by the class. - * - * @param stringContent string content that needs to be added - * @throws DocletAbortException this method will always throw a - * DocletAbortException because it - * is not supported. - */ - public void addContent(String stringContent) { - throw new DocletAbortException("not supported"); - } - - /** - * {@inheritDoc} - */ - public boolean isEmpty() { - return rawHtmlContent.isEmpty(); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return rawHtmlContent; - } - - private enum State { TEXT, ENTITY, TAG, STRING } - - @Override - public int charCount() { - return charCount(rawHtmlContent); - } - - static int charCount(String htmlText) { - State state = State.TEXT; - int count = 0; - for (int i = 0; i < htmlText.length(); i++) { - char c = htmlText.charAt(i); - switch (state) { - case TEXT: - switch (c) { - case '<': - state = State.TAG; - break; - case '&': - state = State.ENTITY; - count++; - break; - default: - count++; - } - break; - - case ENTITY: - if (!Character.isLetterOrDigit(c)) - state = State.TEXT; - break; - - case TAG: - switch (c) { - case '"': - state = State.STRING; - break; - case '>': - state = State.TEXT; - break; - } - break; - - case STRING: - switch (c) { - case '"': - state = State.TAG; - break; - } - } - } - return count; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean write(Writer out, boolean atNewline) throws IOException { - out.write(rawHtmlContent); - return rawHtmlContent.endsWith(DocletConstants.NL); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/StringContent.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/StringContent.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/StringContent.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.formats.html.markup; - -import java.io.IOException; -import java.io.Writer; - -import com.sun.tools.doclets.internal.toolkit.Content; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Class for generating string content for HTML tags of javadoc output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public class StringContent extends Content { - - private StringBuilder stringContent; - - /** - * Constructor to construct StringContent object. - */ - public StringContent() { - stringContent = new StringBuilder(); - } - - /** - * Constructor to construct StringContent object with some initial content. - * - * @param initialContent initial content for the object - */ - public StringContent(String initialContent) { - stringContent = new StringBuilder(); - appendChars(initialContent); - } - - /** - * This method is not supported by the class. - * - * @param content content that needs to be added - * @throws DocletAbortException this method will always throw a - * DocletAbortException because it - * is not supported. - */ - @Override - public void addContent(Content content) { - throw new DocletAbortException("not supported"); - } - - /** - * Adds content for the StringContent object. The method escapes - * HTML characters for the string content that is added. - * - * @param strContent string content to be added - */ - @Override - public void addContent(String strContent) { - appendChars(strContent); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean isEmpty() { - return (stringContent.length() == 0); - } - - @Override - public int charCount() { - return RawHtml.charCount(stringContent.toString()); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return stringContent.toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean write(Writer out, boolean atNewline) throws IOException { - String s = stringContent.toString(); - out.write(s); - return s.endsWith(DocletConstants.NL); - } - - private void appendChars(String s) { - for (int i = 0; i < s.length(); i++) { - char ch = s.charAt(i); - switch (ch) { - case '<': stringContent.append("<"); break; - case '>': stringContent.append(">"); break; - case '&': stringContent.append("&"); break; - default: stringContent.append(ch); break; - } - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/package-info.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/package-info.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/package-info.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - This package contains classes that write HTML markup tags. - -

This is NOT part of any supported API. - If you write code that depends on this, you do so at your own risk. - This code and its internal interfaces are subject to change or - deletion without notice. - */ - -package com.sun.tools.doclets.formats.html.markup; diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/package-info.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/package-info.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/package-info.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - This produces Javadoc's HTML-formatted API output. For more documentation - on this doclet, please refer to the link below. - - @see - http://www.java.sun.com/javadoc/standard-doclet.html - -

This is NOT part of any supported API. - If you write code that depends on this, you do so at your own risk. - This code and its internal interfaces are subject to change or - deletion without notice. -*/ - -package com.sun.tools.doclets.formats.html; diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties +++ /dev/null @@ -1,237 +0,0 @@ -doclet.build_version=Standard Doclet (Old) version {0} -doclet.Contents=Contents -doclet.Overview=Overview -doclet.Window_Overview=Overview List -doclet.Window_Overview_Summary=Overview -doclet.Package=Package -doclet.All_Packages=All Packages -doclet.Tree=Tree -doclet.Class_Hierarchy=Class Hierarchy -doclet.Window_Class_Hierarchy=Class Hierarchy -doclet.Interface_Hierarchy=Interface Hierarchy -doclet.Enum_Hierarchy=Enum Hierarchy -doclet.Annotation_Type_Hierarchy=Annotation Type Hierarchy -doclet.Prev=Prev -doclet.Next=Next -doclet.Prev_Class=Prev Class -doclet.Next_Class=Next Class -doclet.Prev_Package=Prev Package -doclet.Next_Package=Next Package -doclet.Prev_Letter=Prev Letter -doclet.Next_Letter=Next Letter -doclet.Href_Class_Title=class in {0} -doclet.Href_Interface_Title=interface in {0} -doclet.Href_Annotation_Title=annotation in {0} -doclet.Href_Enum_Title=enum in {0} -doclet.Href_Type_Param_Title=type parameter in {0} -doclet.Href_Class_Or_Interface_Title=class or interface in {0} -doclet.Summary=Summary: -doclet.Detail=Detail: -doclet.navNested=Nested -doclet.navAnnotationTypeOptionalMember=Optional -doclet.navAnnotationTypeRequiredMember=Required -doclet.navAnnotationTypeMember=Element -doclet.navField=Field -doclet.navProperty=Property -doclet.navEnum=Enum Constants -doclet.navConstructor=Constr -doclet.navMethod=Method -doclet.Index=Index -doclet.Window_Single_Index=Index -doclet.Window_Split_Index={0}-Index -doclet.Help=Help -doclet.Skip_navigation_links=Skip navigation links -doclet.Navigation=Navigation -doclet.New_Page=NewPage -doclet.navDeprecated=Deprecated -doclet.Window_Deprecated_List=Deprecated List -doclet.Overrides=Overrides: -doclet.in_class=in class -doclet.Static_variable_in=Static variable in {0} -doclet.Variable_in=Variable in {0} -doclet.Constructor_for=Constructor for {0} -doclet.Static_method_in=Static method in {0} -doclet.Search_tag_in=Search tag in {0} -doclet.Method_in=Method in {0} -doclet.package=package -doclet.MalformedURL=Malformed URL: {0} -doclet.File_error=Error reading file: {0} -doclet.URL_error=Error fetching URL: {0} -doclet.see.class_or_package_not_found=Tag {0}: reference not found: {1} -doclet.see.class_or_package_not_accessible=Tag {0}: reference not accessible: {1} -doclet.Deprecated_API=Deprecated API -doclet.Deprecated_Packages=Deprecated Packages -doclet.Deprecated_Classes=Deprecated Classes -doclet.Deprecated_Enums=Deprecated Enums -doclet.Deprecated_Interfaces=Deprecated Interfaces -doclet.Deprecated_Exceptions=Deprecated Exceptions -doclet.Deprecated_Annotation_Types=Deprecated Annotation Types -doclet.Deprecated_Errors=Deprecated Errors -doclet.Deprecated_Fields=Deprecated Fields -doclet.Deprecated_Constructors=Deprecated Constructors -doclet.Deprecated_Methods=Deprecated Methods -doclet.Deprecated_Enum_Constants=Deprecated Enum Constants -doclet.Deprecated_Annotation_Type_Members=Deprecated Annotation Type Elements -doclet.deprecated_packages=deprecated packages -doclet.deprecated_classes=deprecated classes -doclet.deprecated_enums=deprecated enums -doclet.deprecated_interfaces=deprecated interfaces -doclet.deprecated_exceptions=deprecated exceptions -doclet.deprecated_annotation_types=deprecated annotation types -doclet.deprecated_errors=deprecated errors -doclet.deprecated_fields=deprecated fields -doclet.deprecated_constructors=deprecated constructors -doclet.deprecated_methods=deprecated methods -doclet.deprecated_enum_constants=deprecated enum constants -doclet.deprecated_annotation_type_members=deprecated annotation type elements -doclet.Generated_Docs_Untitled=Generated Documentation (Untitled) -doclet.Other_Packages=Other Packages -doclet.Package_Description=Package {0} Description -doclet.Description=Description -doclet.Specified_By=Specified by: -doclet.in_interface=in interface -doclet.Subclasses=Direct Known Subclasses: -doclet.Subinterfaces=All Known Subinterfaces: -doclet.Implementing_Classes=All Known Implementing Classes: -doclet.Functional_Interface=Functional Interface: -doclet.Functional_Interface_Message=This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference. -doclet.also=also -doclet.Frames=Frames -doclet.No_Frames=No Frames -doclet.Package_Hierarchies=Package Hierarchies: -doclet.Hierarchy_For_Package=Hierarchy For Package {0} -doclet.Hierarchy_For_All_Packages=Hierarchy For All Packages -doclet.No_Script_Message=JavaScript is disabled on your browser. -doclet.Description_From_Interface=Description copied from interface: -doclet.Description_From_Class=Description copied from class: -doclet.No_Non_Deprecated_Classes_To_Document=No non-deprecated classes found to document. -doclet.Interfaces_Italic=Interfaces (italic) -doclet.Enclosing_Class=Enclosing class: -doclet.Enclosing_Interface=Enclosing interface: -doclet.Window_Source_title=Source code -doclet.Window_Help_title=API Help -doclet.Help_line_1=How This API Document Is Organized -doclet.Help_line_2=This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows. -doclet.Help_line_3=The {0} page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages. -doclet.Help_line_4=Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories: -doclet.Help_line_5=Class/Interface -doclet.Help_line_6=Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions: -doclet.Help_line_7=Class inheritance diagram -doclet.Help_line_8=Direct Subclasses -doclet.Help_line_9=All Known Subinterfaces -doclet.Help_line_10=All Known Implementing Classes -doclet.Help_line_11=Class/interface declaration -doclet.Help_line_12=Class/interface description -doclet.Help_line_13=Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer. -doclet.Help_line_14=Use -doclet.Help_line_15=Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar. -doclet.Help_line_16=Tree (Class Hierarchy) -doclet.Help_line_17_with_tree_link=There is a {0} page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with {1}. The interfaces do not inherit from {1}. -doclet.Help_line_18=When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages. -doclet.Help_line_19=When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package. -doclet.Help_line_20_with_deprecated_api_link=The {0} page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations. -doclet.Help_line_21=Index -doclet.Help_line_22=The {0} contains an alphabetic list of all classes, interfaces, constructors, methods, and fields. -doclet.Help_line_23=Prev/Next -doclet.Help_line_24=These links take you to the next or previous class, interface, package, or related page. -doclet.Help_line_25=Frames/No Frames -doclet.Help_line_26=These links show and hide the HTML frames. All pages are available with or without frames. -doclet.Help_line_27=The {0} link shows all classes and interfaces except non-static nested types. -doclet.Help_line_28=Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. -doclet.Help_line_29=The {0} page lists the static final fields and their values. -doclet.Help_line_30=This help file applies to API documentation generated using the standard doclet. -doclet.Help_enum_line_1=Each enum has its own separate page with the following sections: -doclet.Help_enum_line_2=Enum declaration -doclet.Help_enum_line_3=Enum description -doclet.Help_annotation_type_line_1=Each annotation type has its own separate page with the following sections: -doclet.Help_annotation_type_line_2=Annotation Type declaration -doclet.Help_annotation_type_line_3=Annotation Type description -doclet.ClassUse_Packages.that.use.0=Packages that use {0} -doclet.ClassUse_Uses.of.0.in.1=Uses of {0} in {1} -doclet.ClassUse_Classes.in.0.used.by.1=Classes in {0} used by {1} -doclet.ClassUse_PackageAnnotation=Packages with annotations of type {0} -doclet.ClassUse_Annotation=Classes in {1} with annotations of type {0} -doclet.ClassUse_TypeParameter=Classes in {1} with type parameters of type {0} -doclet.ClassUse_MethodTypeParameter=Methods in {1} with type parameters of type {0} -doclet.ClassUse_FieldTypeParameter=Fields in {1} with type parameters of type {0} -doclet.ClassUse_FieldAnnotations=Fields in {1} with annotations of type {0} -doclet.ClassUse_MethodAnnotations=Methods in {1} with annotations of type {0} -doclet.ClassUse_MethodParameterAnnotations=Method parameters in {1} with annotations of type {0} -doclet.ClassUse_MethodReturnTypeParameter=Methods in {1} that return types with arguments of type {0} -doclet.ClassUse_Subclass=Subclasses of {0} in {1} -doclet.ClassUse_Subinterface=Subinterfaces of {0} in {1} -doclet.ClassUse_ImplementingClass=Classes in {1} that implement {0} -doclet.ClassUse_Field=Fields in {1} declared as {0} -doclet.ClassUse_MethodReturn=Methods in {1} that return {0} -doclet.ClassUse_MethodArgs=Methods in {1} with parameters of type {0} -doclet.ClassUse_MethodArgsTypeParameters=Method parameters in {1} with type arguments of type {0} -doclet.ClassUse_MethodThrows=Methods in {1} that throw {0} -doclet.ClassUse_ConstructorAnnotations=Constructors in {1} with annotations of type {0} -doclet.ClassUse_ConstructorParameterAnnotations=Constructor parameters in {1} with annotations of type {0} -doclet.ClassUse_ConstructorArgs=Constructors in {1} with parameters of type {0} -doclet.ClassUse_ConstructorArgsTypeParameters=Constructor parameters in {1} with type arguments of type {0} -doclet.ClassUse_ConstructorThrows=Constructors in {1} that throw {0} -doclet.ClassUse_No.usage.of.0=No usage of {0} -doclet.Window_ClassUse_Header=Uses of {0} {1} -doclet.ClassUse_Title=Uses of {0} -doclet.navClassUse=Use -doclet.Error_in_packagelist=Error in using -group option: {0} {1} -doclet.Groupname_already_used=In -group option, groupname already used: {0} -doclet.Same_package_name_used=Package name format used twice: {0} -doclet.exception_encountered=Exception encountered while processing {1}\n{0} -doclet.usage=Provided by Standard doclet:\n\ -\ -d Destination directory for output files\n\ -\ -use Create class and package usage pages\n\ -\ -version Include @version paragraphs\n\ -\ -author Include @author paragraphs\n\ -\ -docfilessubdirs Recursively copy doc-file subdirectories\n\ -\ -splitindex Split index into one file per letter\n\ -\ -windowtitle Browser window title for the documentation\n\ -\ -doctitle Include title for the overview page\n\ -\ -header Include header text for each page\n\ -\ -html4 Generate HTML 4.01 output\n\ -\ -html5 Generate HTML 5 output\n\ -\ -footer Include footer text for each page\n\ -\ -top Include top text for each page\n\ -\ -bottom Include bottom text for each page\n\ -\ -link Create links to javadoc output at \n\ -\ -linkoffline Link to docs at using package list at \n\ -\ -excludedocfilessubdir :.. Exclude any doc-files subdirectories with given name.\n\ -\ -group :.. Group specified packages together in overview page\n\ -\ -nocomment Suppress description and tags, generate only declarations.\n\ -\ -nodeprecated Do not include @deprecated information\n\ -\ -noqualifier ::... Exclude the list of qualifiers from the output.\n\ -\ -nosince Do not include @since information\n\ -\ -notimestamp Do not include hidden time stamp\n\ -\ -nodeprecatedlist Do not generate deprecated list\n\ -\ -notree Do not generate class hierarchy\n\ -\ -noindex Do not generate index\n\ -\ -nohelp Do not generate help link\n\ -\ -nonavbar Do not generate navigation bar\n\ -\ -serialwarn Generate warning about @serial tag\n\ -\ -tag ::

Specify single argument custom tags\n\ -\ -taglet The fully qualified name of Taglet to register\n\ -\ -tagletpath The path to Taglets\n\ -\ -charset Charset for cross-platform viewing of generated documentation.\n\ -\ -helpfile Include file that help link links to\n\ -\ -linksource Generate source in HTML\n\ -\ -sourcetab Specify the number of spaces each tab takes up in the source\n\ -\ -keywords Include HTML meta tags with package, class and member info\n\ -\ -stylesheetfile File to change style of the generated documentation\n\ -\ -docencoding Specify the character encoding for the output - - -# L10N: do not localize these words: all none accessibility html missing reference syntax -doclet.X.usage=Provided by standard doclet:\n\ -\ -Xdocrootparent Replaces all appearances of @docRoot followed\n\ -\ by /.. in doc comments with \n\ -\ -Xdoclint Enable recommended checks for problems in javadoc comments\n\ -\ -Xdoclint:(all|none|[-]) \n\ -\ Enable or disable specific checks for problems in javadoc comments,\n\ -\ where is one of accessibility, html, missing, reference, or syntax.\n\ -\ -Xdoclint/package:([-])\n\ -\ Enable or disable checks in specific packages. is a comma separated\n\ -\ list of package specifiers. Package specifier is either a qualified name of a package\n\ -\ or a package name prefix followed by .*, which expands to all sub-packages of\n\ -\ the given package. Prefix the package specifier with - to disable checks for\n\ -\ the specified packages.\n diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties +++ /dev/null @@ -1,187 +0,0 @@ -doclet.build_version=\u6A19\u6E96Doclet (\u65E7)\u30D0\u30FC\u30B8\u30E7\u30F3{0} -doclet.Contents=\u30B3\u30F3\u30C6\u30F3\u30C4 -doclet.Overview=\u6982\u8981 -doclet.Window_Overview=\u6982\u8981\u30EA\u30B9\u30C8 -doclet.Window_Overview_Summary=\u6982\u8981 -doclet.Package=\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.All_Packages=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.Tree=\u968E\u5C64\u30C4\u30EA\u30FC -doclet.Class_Hierarchy=\u30AF\u30E9\u30B9\u968E\u5C64 -doclet.Window_Class_Hierarchy=\u30AF\u30E9\u30B9\u968E\u5C64 -doclet.Interface_Hierarchy=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u968E\u5C64 -doclet.Enum_Hierarchy=\u5217\u6319\u578B\u968E\u5C64 -doclet.Annotation_Type_Hierarchy=\u6CE8\u91C8\u578B\u968E\u5C64 -doclet.Prev=\u524D -doclet.Next=\u6B21 -doclet.Prev_Class=\u524D\u306E\u30AF\u30E9\u30B9 -doclet.Next_Class=\u6B21\u306E\u30AF\u30E9\u30B9 -doclet.Prev_Package=\u524D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.Next_Package=\u6B21\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.Prev_Letter=\u524D\u306E\u6587\u5B57 -doclet.Next_Letter=\u6B21\u306E\u6587\u5B57 -doclet.Href_Class_Title={0}\u5185\u306E\u30AF\u30E9\u30B9 -doclet.Href_Interface_Title={0}\u5185\u306E\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Href_Annotation_Title={0}\u5185\u306E\u6CE8\u91C8 -doclet.Href_Enum_Title={0}\u5185\u306E\u5217\u6319\u578B -doclet.Href_Type_Param_Title={0}\u5185\u306E\u578B\u30D1\u30E9\u30E1\u30FC\u30BF -doclet.Href_Class_Or_Interface_Title={0}\u5185\u306E\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Summary=\u6982\u8981: -doclet.Detail=\u8A73\u7D30: -doclet.navNested=\u30CD\u30B9\u30C8 -doclet.navAnnotationTypeOptionalMember=\u30AA\u30D7\u30B7\u30E7\u30F3 -doclet.navAnnotationTypeRequiredMember=\u5FC5\u9808 -doclet.navAnnotationTypeMember=\u8981\u7D20 -doclet.navField=\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.navProperty=\u30D7\u30ED\u30D1\u30C6\u30A3 -doclet.navEnum=\u5217\u6319\u5B9A\u6570 -doclet.navConstructor=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.navMethod=\u30E1\u30BD\u30C3\u30C9 -doclet.Index=\u7D22\u5F15 -doclet.Window_Single_Index=\u7D22\u5F15 -doclet.Window_Split_Index={0}\u306E\u7D22\u5F15 -doclet.Help=\u30D8\u30EB\u30D7 -doclet.Skip_navigation_links=\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30EA\u30F3\u30AF\u3092\u30B9\u30AD\u30C3\u30D7 -doclet.Navigation=\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3 -doclet.New_Page=NewPage -doclet.navDeprecated=\u975E\u63A8\u5968 -doclet.Window_Deprecated_List=\u975E\u63A8\u5968API\u306E\u30EA\u30B9\u30C8 -doclet.Overrides=\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9: -doclet.in_class=\u30AF\u30E9\u30B9\u5185 -doclet.Static_variable_in={0}\u306Estatic\u5909\u6570 -doclet.Variable_in={0}\u306E\u5909\u6570 -doclet.Constructor_for={0}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.Static_method_in={0}\u306Estatic\u30E1\u30BD\u30C3\u30C9 -doclet.Search_tag_in={0}\u306E\u691C\u7D22\u30BF\u30B0 -doclet.Method_in={0}\u306E\u30E1\u30BD\u30C3\u30C9 -doclet.package=\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.MalformedURL=\u4E0D\u6B63\u306AURL: {0} -doclet.File_error=\u30D5\u30A1\u30A4\u30EB\u8AAD\u8FBC\u307F\u30A8\u30E9\u30FC: {0} -doclet.URL_error=URL\u53D6\u51FA\u3057\u30A8\u30E9\u30FC: {0} -doclet.see.class_or_package_not_found=\u30BF\u30B0{0}: \u53C2\u7167\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {1} -doclet.see.class_or_package_not_accessible=\u30BF\u30B0{0}: \u53C2\u7167\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093: {1} -doclet.Deprecated_API=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044API -doclet.Deprecated_Packages=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.Deprecated_Classes=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30AF\u30E9\u30B9 -doclet.Deprecated_Enums=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B -doclet.Deprecated_Interfaces=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Deprecated_Exceptions=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u4F8B\u5916 -doclet.Deprecated_Annotation_Types=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u6CE8\u91C8\u578B -doclet.Deprecated_Errors=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30E9\u30FC -doclet.Deprecated_Fields=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.Deprecated_Constructors=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.Deprecated_Methods=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30E1\u30BD\u30C3\u30C9 -doclet.Deprecated_Enum_Constants=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B\u5B9A\u6570 -doclet.Deprecated_Annotation_Type_Members=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u6CE8\u91C8\u578B\u306E\u8981\u7D20 -doclet.deprecated_packages=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.deprecated_classes=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30AF\u30E9\u30B9 -doclet.deprecated_enums=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B -doclet.deprecated_interfaces=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.deprecated_exceptions=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u4F8B\u5916 -doclet.deprecated_annotation_types=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u6CE8\u91C8\u578B -doclet.deprecated_errors=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30A8\u30E9\u30FC -doclet.deprecated_fields=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.deprecated_constructors=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.deprecated_methods=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30E1\u30BD\u30C3\u30C9 -doclet.deprecated_enum_constants=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u5217\u6319\u578B\u5B9A\u6570 -doclet.deprecated_annotation_type_members=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u6CE8\u91C8\u578B\u306E\u8981\u7D20 -doclet.Generated_Docs_Untitled=\u751F\u6210\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8(\u30BF\u30A4\u30C8\u30EB\u306A\u3057) -doclet.Other_Packages=\u305D\u306E\u4ED6\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.Package_Description=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306E\u8AAC\u660E -doclet.Description=\u8AAC\u660E -doclet.Specified_By=\u5B9A\u7FA9: -doclet.in_interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u5185 -doclet.Subclasses=\u76F4\u7CFB\u306E\u65E2\u77E5\u306E\u30B5\u30D6\u30AF\u30E9\u30B9: -doclet.Subinterfaces=\u65E2\u77E5\u306E\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8: -doclet.Implementing_Classes=\u65E2\u77E5\u306E\u5B9F\u88C5\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8: -doclet.Functional_Interface=\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Functional_Interface_Message=\u3053\u308C\u306F\u6A5F\u80FD\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306A\u306E\u3067\u3001\u30E9\u30E0\u30C0\u5F0F\u307E\u305F\u306F\u30E1\u30BD\u30C3\u30C9\u53C2\u7167\u306E\u5272\u5F53\u3066\u30BF\u30FC\u30B2\u30C3\u30C8\u3068\u3057\u3066\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 -doclet.also=\u540C\u69D8\u306B -doclet.Frames=\u30D5\u30EC\u30FC\u30E0 -doclet.No_Frames=\u30D5\u30EC\u30FC\u30E0\u306A\u3057 -doclet.Package_Hierarchies=\u30D1\u30C3\u30B1\u30FC\u30B8\u968E\u5C64: -doclet.Hierarchy_For_Package=\u30D1\u30C3\u30B1\u30FC\u30B8{0}\u306E\u968E\u5C64 -doclet.Hierarchy_For_All_Packages=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u968E\u5C64 -doclet.No_Script_Message=\u30D6\u30E9\u30A6\u30B6\u306EJavaScript\u304C\u7121\u52B9\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002 -doclet.Description_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u8AAC\u660E: -doclet.Description_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u30B3\u30D4\u30FC\u3055\u308C\u305F\u8AAC\u660E: -doclet.No_Non_Deprecated_Classes_To_Document=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3059\u308B\u975E\u63A8\u5968\u4EE5\u5916\u306E\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 -doclet.Interfaces_Italic=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u30A4\u30BF\u30EA\u30C3\u30AF) -doclet.Enclosing_Class=\u542B\u307E\u308C\u3066\u3044\u308B\u30AF\u30E9\u30B9: -doclet.Enclosing_Interface=\u542B\u307E\u308C\u3066\u3044\u308B\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: -doclet.Window_Source_title=\u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9 -doclet.Window_Help_title=API\u30D8\u30EB\u30D7 -doclet.Help_line_1=API\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u69CB\u6210 -doclet.Help_line_2=\u3053\u306EAPI(Application Programming Interface)\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u306F\u3001\u6B21\u306B\u8AAC\u660E\u3059\u308B\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306B\u3042\u308B\u9805\u76EE\u306B\u5BFE\u5FDC\u3059\u308B\u30DA\u30FC\u30B8\u304C\u542B\u307E\u308C\u307E\u3059\u3002 -doclet.Help_line_3={0}\u30DA\u30FC\u30B8\u306FAPI\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D5\u30ED\u30F3\u30C8\u30FB\u30DA\u30FC\u30B8\u3067\u3001\u5404\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u6982\u8981\u3092\u542B\u3080\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30EA\u30B9\u30C8\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u4E00\u9023\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u6982\u8981\u8AAC\u660E\u3082\u8868\u793A\u3055\u308C\u307E\u3059\u3002 -doclet.Help_line_4=\u5404\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u306F\u3001\u305D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8\u3068\u3001\u305D\u308C\u305E\u308C\u306E\u6982\u8981\u3092\u542B\u3080\u30DA\u30FC\u30B8\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u30DA\u30FC\u30B8\u306F6\u3064\u306E\u30AB\u30C6\u30B4\u30EA\u3067\u69CB\u6210\u3055\u308C\u307E\u3059\u3002 -doclet.Help_line_5=\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Help_line_6=\u5404\u30AF\u30E9\u30B9\u3001\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3001\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u306F\u500B\u5225\u306E\u30DA\u30FC\u30B8\u304C\u3042\u308A\u307E\u3059\u3002\u5404\u30DA\u30FC\u30B8\u306B\u306F\u6B21\u306E\u3088\u3046\u306B\u3001\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u8AAC\u660E\u3068\u3001\u6982\u8981\u8868\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u8A73\u7D30\u8AAC\u660E\u304C\u542B\u307E\u308C\u307E\u3059\u3002 -doclet.Help_line_7=\u30AF\u30E9\u30B9\u968E\u5C64\u8868\u793A -doclet.Help_line_8=\u76F4\u7CFB\u306E\u30B5\u30D6\u30AF\u30E9\u30B9 -doclet.Help_line_9=\u65E2\u77E5\u306E\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8 -doclet.Help_line_10=\u65E2\u77E5\u306E\u5B9F\u88C5\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8 -doclet.Help_line_11=\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u5BA3\u8A00 -doclet.Help_line_12=\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u8AAC\u660E -doclet.Help_line_13=\u5404\u6982\u8981\u30A8\u30F3\u30C8\u30EA\u306B\u306F\u3001\u305D\u306E\u9805\u76EE\u306E\u8A73\u7D30\u306A\u8AAC\u660E\u306E\u4E2D\u304B\u30891\u884C\u76EE\u306E\u6587\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002\u8A73\u7D30\u306A\u8AAC\u660E\u306F\u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9\u306B\u73FE\u308C\u308B\u9806\u306B\u4E26\u3079\u3089\u308C\u307E\u3059\u304C\u3001\u6982\u8981\u30A8\u30F3\u30C8\u30EA\u306F\u30A2\u30EB\u30D5\u30A1\u30D9\u30C3\u30C8\u9806\u306B\u4E26\u3079\u3089\u308C\u307E\u3059\u3002\u3053\u308C\u306B\u3088\u3063\u3066\u3001\u30D7\u30ED\u30B0\u30E9\u30DE\u304C\u8A2D\u5B9A\u3057\u305F\u8AD6\u7406\u7684\u306A\u30B0\u30EB\u30FC\u30D7\u5206\u3051\u304C\u4FDD\u6301\u3055\u308C\u307E\u3059\u3002 -doclet.Help_line_14=\u4F7F\u7528 -doclet.Help_line_15=\u5404\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u306F\u305D\u308C\u305E\u308C\u300C\u4F7F\u7528\u300D\u30DA\u30FC\u30B8\u304C\u3042\u308A\u307E\u3059\u3002\u3053\u306E\u30DA\u30FC\u30B8\u306B\u306F\u3001\u3069\u306E\u3088\u3046\u306A\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u3001\u30E1\u30BD\u30C3\u30C9\u3001\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304A\u3088\u3073\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3001\u7279\u5B9A\u306E\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4E00\u90E8\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u304B\u304C\u8A18\u8FF0\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u305F\u3068\u3048\u3070\u3001\u30AF\u30E9\u30B9A\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9A\u306E\u5834\u5408\u3001\u305D\u306E\u300C\u4F7F\u7528\u300D\u30DA\u30FC\u30B8\u306B\u306F\u3001A\u306E\u30B5\u30D6\u30AF\u30E9\u30B9\u3001A\u3068\u3057\u3066\u5BA3\u8A00\u3055\u308C\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u3001A\u3092\u8FD4\u3059\u30E1\u30BD\u30C3\u30C9\u3068\u3001\u578BA\u3092\u6301\u3064\u30E1\u30BD\u30C3\u30C9\u304A\u3088\u3073\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u304C\u542B\u307E\u308C\u307E\u3059\u3002\u3053\u306E\u30DA\u30FC\u30B8\u306B\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u306B\u306F\u3001\u307E\u305A\u305D\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306B\u79FB\u52D5\u3057\u3001\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306E\u300C\u4F7F\u7528\u300D\u30EA\u30F3\u30AF\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -doclet.Help_line_16=\u968E\u5C64\u30C4\u30EA\u30FC(\u30AF\u30E9\u30B9\u968E\u5C64) -doclet.Help_line_17_with_tree_link=\u3059\u3079\u3066\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u306F{0}\u30DA\u30FC\u30B8\u304C\u3042\u308A\u3001\u3055\u3089\u306B\u5404\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u968E\u5C64\u304C\u3042\u308A\u307E\u3059\u3002\u5404\u968E\u5C64\u30DA\u30FC\u30B8\u306F\u3001\u30AF\u30E9\u30B9\u306E\u30EA\u30B9\u30C8\u3068\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u30EA\u30B9\u30C8\u3092\u542B\u307F\u307E\u3059\u3002\u30AF\u30E9\u30B9\u306F{1}\u3092\u958B\u59CB\u70B9\u3068\u3059\u308B\u7D99\u627F\u69CB\u9020\u3067\u7DE8\u6210\u3055\u308C\u307E\u3059\u3002\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306F\u3001{1}\u304B\u3089\u306F\u7D99\u627F\u3057\u307E\u305B\u3093\u3002 -doclet.Help_line_18=\u6982\u8981\u30DA\u30FC\u30B8\u3092\u8868\u793A\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u300C\u968E\u5C64\u30C4\u30EA\u30FC\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u968E\u5C64\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002 -doclet.Help_line_19=\u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u307E\u305F\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3092\u8868\u793A\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u300C\u968E\u5C64\u30C4\u30EA\u30FC\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3068\u3001\u8A72\u5F53\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u307F\u306E\u968E\u5C64\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002 -doclet.Help_line_20_with_deprecated_api_link={0}\u30DA\u30FC\u30B8\u306F\u3001\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u3059\u3079\u3066\u306EAPI\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\u3002\u975E\u63A8\u5968API\u3068\u306F\u3001\u6A5F\u80FD\u6539\u826F\u306A\u3069\u306E\u7406\u7531\u304B\u3089\u4F7F\u7528\u3092\u304A\u85A6\u3081\u3067\u304D\u306A\u304F\u306A\u3063\u305FAPI\u306E\u3053\u3068\u3067\u3001\u901A\u5E38\u306F\u305D\u308C\u306B\u4EE3\u308F\u308BAPI\u304C\u63D0\u4F9B\u3055\u308C\u307E\u3059\u3002\u975E\u63A8\u5968API\u306F\u4ECA\u5F8C\u306E\u5B9F\u88C5\u3067\u524A\u9664\u3055\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002 -doclet.Help_line_21=\u7D22\u5F15 -doclet.Help_line_22={0}\u306B\u306F\u3001\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u3001\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3001\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u3001\u30E1\u30BD\u30C3\u30C9\u304A\u3088\u3073\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30A2\u30EB\u30D5\u30A1\u30D9\u30C3\u30C8\u9806\u306E\u30EA\u30B9\u30C8\u304C\u542B\u307E\u308C\u307E\u3059\u3002 -doclet.Help_line_23=\u524D/\u6B21 -doclet.Help_line_24=\u3053\u308C\u3089\u306E\u30EA\u30F3\u30AF\u306B\u3088\u308A\u3001\u524D\u307E\u305F\u306F\u6B21\u306E\u30AF\u30E9\u30B9\u3001\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u307E\u305F\u306F\u95A2\u9023\u30DA\u30FC\u30B8\u3078\u79FB\u52D5\u3067\u304D\u307E\u3059\u3002 -doclet.Help_line_25=\u30D5\u30EC\u30FC\u30E0/\u30D5\u30EC\u30FC\u30E0\u306A\u3057 -doclet.Help_line_26=\u3053\u308C\u3089\u306E\u30EA\u30F3\u30AF\u306FHTML\u30D5\u30EC\u30FC\u30E0\u306E\u8868\u793A\u3068\u975E\u8868\u793A\u3092\u5207\u308A\u66FF\u3048\u307E\u3059\u3002\u3059\u3079\u3066\u306E\u30DA\u30FC\u30B8\u306F\u30D5\u30EC\u30FC\u30E0\u3042\u308A\u3067\u3082\u3001\u30D5\u30EC\u30FC\u30E0\u306A\u3057\u3067\u3082\u8868\u793A\u3067\u304D\u307E\u3059\u3002 -doclet.Help_line_27={0}\u30EA\u30F3\u30AF\u306B\u306F\u3001\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u975Estatic\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u578B\u3092\u9664\u304F)\u304C\u8868\u793A\u3055\u308C\u307E\u3059\u3002 -doclet.Help_line_28=\u76F4\u5217\u5316\u53EF\u80FD\u307E\u305F\u306F\u5916\u90E8\u5316\u53EF\u80FD\u306A\u5404\u30AF\u30E9\u30B9\u306F\u3001\u76F4\u5217\u5316\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u30E1\u30BD\u30C3\u30C9\u306E\u8AAC\u660E\u3092\u542B\u307F\u307E\u3059\u3002\u3053\u306E\u60C5\u5831\u306F\u3001API\u3092\u4F7F\u7528\u3059\u308B\u958B\u767A\u8005\u3067\u306F\u306A\u304F\u3001\u518D\u5B9F\u88C5\u3092\u884C\u3046\u62C5\u5F53\u8005\u306B\u5F79\u7ACB\u3061\u307E\u3059\u3002\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u306B\u30EA\u30F3\u30AF\u304C\u306A\u3044\u5834\u5408\u3001\u76F4\u5217\u5316\u3055\u308C\u305F\u30AF\u30E9\u30B9\u306B\u79FB\u52D5\u3057\u3066\u3001\u30AF\u30E9\u30B9\u8A18\u8FF0\u306E\u300C\u95A2\u9023\u9805\u76EE\u300D\u30BB\u30AF\u30B7\u30E7\u30F3\u306B\u3042\u308B\u300C\u76F4\u5217\u5316\u3055\u308C\u305F\u5F62\u5F0F\u300D\u3092\u30AF\u30EA\u30C3\u30AF\u3059\u308B\u3053\u3068\u306B\u3088\u308A\u3001\u3053\u306E\u60C5\u5831\u3092\u8868\u793A\u3067\u304D\u307E\u3059\u3002 -doclet.Help_line_29={0}\u30DA\u30FC\u30B8\u306B\u306F\u3001static final\u30D5\u30A3\u30FC\u30EB\u30C9\u3068\u305D\u306E\u5024\u306E\u30EA\u30B9\u30C8\u304C\u3042\u308A\u307E\u3059\u3002 -doclet.Help_line_30=\u3053\u306E\u30D8\u30EB\u30D7\u30FB\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u6A19\u6E96doclet\u3092\u4F7F\u7528\u3057\u3066\u751F\u6210\u3055\u308C\u305FAPI\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306B\u9069\u7528\u3055\u308C\u307E\u3059\u3002 -doclet.Help_enum_line_1=\u5404\u5217\u6319\u578B\u306B\u306F\u3001\u305D\u308C\u81EA\u8EAB\u306E\u500B\u5225\u306E\u30DA\u30FC\u30B8\u3068\u6B21\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059: -doclet.Help_enum_line_2=\u5217\u6319\u578B\u306E\u5BA3\u8A00 -doclet.Help_enum_line_3=\u5217\u6319\u578B\u306E\u8AAC\u660E -doclet.Help_annotation_type_line_1=\u5404\u6CE8\u91C8\u578B\u306B\u306F\u3001\u305D\u308C\u81EA\u8EAB\u306E\u500B\u5225\u306E\u30DA\u30FC\u30B8\u3068\u6B21\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u304C\u3042\u308A\u307E\u3059: -doclet.Help_annotation_type_line_2=\u6CE8\u91C8\u578B\u306E\u5BA3\u8A00 -doclet.Help_annotation_type_line_3=\u6CE8\u91C8\u578B\u306E\u8AAC\u660E -doclet.ClassUse_Packages.that.use.0={0}\u3092\u4F7F\u7528\u3057\u3066\u3044\u308B\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.ClassUse_Uses.of.0.in.1={1}\u3067\u306E{0}\u306E\u4F7F\u7528 -doclet.ClassUse_Classes.in.0.used.by.1={1}\u306B\u3088\u308A\u4F7F\u7528\u3055\u308C\u308B{0}\u306E\u30AF\u30E9\u30B9 -doclet.ClassUse_PackageAnnotation={0}\u578B\u306E\u6CE8\u91C8\u3092\u6301\u3064\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.ClassUse_Annotation={0}\u578B\u306E\u6CE8\u91C8\u3092\u6301\u3064{1}\u306E\u30E1\u30BD\u30C3\u30C9 -doclet.ClassUse_TypeParameter={0}\u578B\u306E\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064{1}\u306E\u30AF\u30E9\u30B9 -doclet.ClassUse_MethodTypeParameter={0}\u578B\u306E\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064{1}\u306E\u30E1\u30BD\u30C3\u30C9 -doclet.ClassUse_FieldTypeParameter={0}\u578B\u306E\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064{1}\u306E\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.ClassUse_FieldAnnotations={0}\u578B\u306E\u6CE8\u91C8\u3092\u6301\u3064{1}\u306E\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.ClassUse_MethodAnnotations={0}\u578B\u306E\u6CE8\u91C8\u3092\u6301\u3064{1}\u306E\u30E1\u30BD\u30C3\u30C9 -doclet.ClassUse_MethodParameterAnnotations={0}\u578B\u306E\u6CE8\u91C8\u3092\u6301\u3064{1}\u306E\u30E1\u30BD\u30C3\u30C9\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF -doclet.ClassUse_MethodReturnTypeParameter={0}\u578B\u306E\u5F15\u6570\u3092\u6301\u3064\u578B\u3092\u8FD4\u3059{1}\u306E\u30E1\u30BD\u30C3\u30C9 -doclet.ClassUse_Subclass={1}\u3067\u306E{0}\u306E\u30B5\u30D6\u30AF\u30E9\u30B9 -doclet.ClassUse_Subinterface={1}\u3067\u306E{0}\u306E\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.ClassUse_ImplementingClass={0}\u3092\u5B9F\u88C5\u3057\u3066\u3044\u308B{1}\u306E\u30AF\u30E9\u30B9 -doclet.ClassUse_Field={0}\u3068\u3057\u3066\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B{1}\u306E\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.ClassUse_MethodReturn={0}\u3092\u8FD4\u3059{1}\u306E\u30E1\u30BD\u30C3\u30C9 -doclet.ClassUse_MethodArgs={0}\u578B\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064{1}\u306E\u30E1\u30BD\u30C3\u30C9 -doclet.ClassUse_MethodArgsTypeParameters={0}\u578B\u306E\u578B\u5F15\u6570\u3092\u6301\u3064{1}\u306E\u30E1\u30BD\u30C3\u30C9\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF -doclet.ClassUse_MethodThrows={0}\u3092\u30B9\u30ED\u30FC\u3059\u308B{1}\u306E\u30E1\u30BD\u30C3\u30C9 -doclet.ClassUse_ConstructorAnnotations={0}\u578B\u306E\u6CE8\u91C8\u3092\u6301\u3064{1}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.ClassUse_ConstructorParameterAnnotations={0}\u578B\u306E\u6CE8\u91C8\u3092\u6301\u3064{1}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF -doclet.ClassUse_ConstructorArgs={0}\u578B\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6301\u3064{1}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.ClassUse_ConstructorArgsTypeParameters={0}\u578B\u306E\u578B\u5F15\u6570\u3092\u6301\u3064{1}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u30FB\u30D1\u30E9\u30E1\u30FC\u30BF -doclet.ClassUse_ConstructorThrows={0}\u3092\u30B9\u30ED\u30FC\u3059\u308B{1}\u306E\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.ClassUse_No.usage.of.0={0}\u306F\u3069\u3053\u304B\u3089\u3082\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u305B\u3093 -doclet.Window_ClassUse_Header={0} {1}\u306E\u4F7F\u7528 -doclet.ClassUse_Title={0}\u306E\u4F7F\u7528 -doclet.navClassUse=\u4F7F\u7528 -doclet.Error_in_packagelist=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u4F7F\u7528\u65B9\u6CD5\u306E\u30A8\u30E9\u30FC: {0} {1} -doclet.Groupname_already_used=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u304A\u3044\u3066\u3001\u3059\u3067\u306B\u30B0\u30EB\u30FC\u30D7\u540D\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0} -doclet.Same_package_name_used=\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u5F62\u5F0F\u304C2\u56DE\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0} -doclet.exception_encountered={1}\u306E\u51E6\u7406\u4E2D\u306B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\n{0} -doclet.usage=\u6A19\u6E96\u306Edoclet\u306B\u3088\u308A\u63D0\u4F9B\u3055\u308C\u308B\u3082\u306E:\n -d \u51FA\u529B\u30D5\u30A1\u30A4\u30EB\u306E\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\n -use \u30AF\u30E9\u30B9\u3068\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u4F7F\u7528\u30DA\u30FC\u30B8\u3092\u4F5C\u6210\u3059\u308B\n -version @version\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n -author @author\u30D1\u30E9\u30B0\u30E9\u30D5\u3092\u542B\u3081\u308B\n -docfilessubdirs doc-file\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u518D\u5E30\u7684\u306B\u30B3\u30D4\u30FC\u3059\u308B\n -splitindex 1\u5B57\u3054\u3068\u306B1\u30D5\u30A1\u30A4\u30EB\u306B\u7D22\u5F15\u3092\u5206\u5272\u3059\u308B\n -windowtitle \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u7528\u306E\u30D6\u30E9\u30A6\u30B6\u30FB\u30A6\u30A3\u30F3\u30C9\u30A6\u30FB\u30BF\u30A4\u30C8\u30EB\n -doctitle \u6982\u8981\u30DA\u30FC\u30B8\u306B\u30BF\u30A4\u30C8\u30EB\u3092\u542B\u3081\u308B\n -header \u5404\u30DA\u30FC\u30B8\u306B\u30D8\u30C3\u30C0\u30FC\u3092\u542B\u3081\u308B\n -html4 HTML 4.01\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n -html5 HTML 5\u51FA\u529B\u3092\u751F\u6210\u3059\u308B\n -footer \u5404\u30DA\u30FC\u30B8\u306B\u30D5\u30C3\u30BF\u30FC\u3092\u542B\u3081\u308B\n -top \u5404\u30DA\u30FC\u30B8\u306B\u4E0A\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n -bottom \u5404\u30DA\u30FC\u30B8\u306B\u4E0B\u90E8\u30C6\u30AD\u30B9\u30C8\u3092\u542B\u3081\u308B\n -link \u306Bjavadoc\u51FA\u529B\u3078\u306E\u30EA\u30F3\u30AF\u3092\u4F5C\u6210\u3059\u308B\n -linkoffline \u306B\u3042\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u30FB\u30EA\u30B9\u30C8\u3092\u4F7F\u7528\u3057\u3066\u306Edocs\u306B\u30EA\u30F3\u30AF\u3059\u308B\n -excludedocfilessubdir :.. \u6307\u5B9A\u3055\u308C\u305F\u540D\u524D\u306Edoc-files\u30B5\u30D6\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u3059\u3079\u3066\u9664\u5916\u3059\u308B\n -group :.. \u6307\u5B9A\u3059\u308B\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u6982\u8981\u30DA\u30FC\u30B8\u306B\u304A\u3044\u3066\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\n -nocomment \u8A18\u8FF0\u304A\u3088\u3073\u30BF\u30B0\u3092\u6291\u5236\u3057\u3066\u5BA3\u8A00\u306E\u307F\u3092\u751F\u6210\u3059\u308B\n -nodeprecated @deprecated\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n -noqualifier ::... \u51FA\u529B\u304B\u3089\u4FEE\u98FE\u5B50\u306E\u30EA\u30B9\u30C8\u3092\u9664\u5916\u3059\u308B\n -nosince @since\u60C5\u5831\u3092\u9664\u5916\u3059\u308B\n -notimestamp \u975E\u8868\u793A\u306E\u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u3092\u9664\u5916\u3059\u308B\n -nodeprecatedlist \u975E\u63A8\u5968\u306E\u30EA\u30B9\u30C8\u3092\u751F\u6210\u3057\u306A\u3044\n -notree \u30AF\u30E9\u30B9\u968E\u5C64\u3092\u751F\u6210\u3057\u306A\u3044\n -noindex \u7D22\u5F15\u3092\u751F\u6210\u3057\u306A\u3044\n -nohelp \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u3092\u751F\u6210\u3057\u306A\u3044\n -nonavbar \u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3\u30FB\u30D0\u30FC\u3092\u751F\u6210\u3057\u306A\u3044\n -serialwarn @serial\u30BF\u30B0\u306B\u95A2\u3059\u308B\u8B66\u544A\u3092\u751F\u6210\u3059\u308B\n -tag ::
\u5358\u4E00\u306E\u5F15\u6570\u3092\u6301\u3064\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u3092\u6307\u5B9A\u3059\u308B\n \ --taglet \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u5B8C\u5168\u4FEE\u98FE\u540D\u3092\u767B\u9332\u3059\u308B\n -tagletpath \u30BF\u30B0\u30EC\u30C3\u30C8\u306E\u30D1\u30B9\n -charset \u751F\u6210\u3055\u308C\u308B\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30AF\u30ED\u30B9\u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u3067\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\n -helpfile \u30D8\u30EB\u30D7\u30FB\u30EA\u30F3\u30AF\u306E\u30EA\u30F3\u30AF\u5148\u30D5\u30A1\u30A4\u30EB\u3092\u542B\u3081\u308B\n- linksource HTML\u5F62\u5F0F\u3067\u30BD\u30FC\u30B9\u3092\u751F\u6210\u3059\u308B\n -sourcetab \u30BD\u30FC\u30B9\u5185\u306E\u30BF\u30D6\u306E\u7A7A\u767D\u6587\u5B57\u306E\u6570\u3092\u6307\u5B9A\u3059\u308B\n -keywords HTML\u306Emeta\u30BF\u30B0\u306B\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30E1\u30F3\u30D0\u30FC\u306E\u60C5\u5831\u3092\u542B\u3081\u308B\n -stylesheetfile \u751F\u6210\u3055\u308C\u305F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30B9\u30BF\u30A4\u30EB\u5909\u66F4\u7528\u30D5\u30A1\u30A4\u30EB\n -docencoding \u51FA\u529B\u306E\u6587\u5B57\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3059\u308B - - -# L10N: do not localize these words: all none accessibility html missing reference syntax -doclet.X.usage=\u6A19\u6E96\u306Edoclet\u306B\u3088\u308A\u63D0\u4F9B\u3055\u308C\u308B\u3082\u306E:\n -Xdocrootparent doc\u30B3\u30E1\u30F3\u30C8\u5185\u306E/..\u304C\u5F8C\u306B\u7D9A\u304F@docRoot\u306E\u3059\u3079\u3066\u3092\n \u3067\u7F6E\u63DB\u3057\u307E\u3059\n -Xdoclint javadoc\u30B3\u30E1\u30F3\u30C8\u5185\u306E\u554F\u984C\u306B\u5BFE\u3059\u308B\u63A8\u5968\u3055\u308C\u308B\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3057\u307E\u3059\n -Xdoclint:(all|none|[-]) \n javadoc\u30B3\u30E1\u30F3\u30C8\u5185\u306E\u554F\u984C\u306B\u5BFE\u3059\u308B\u7279\u5B9A\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\n \u3053\u3053\u3067\u3001\u306Faccessibility\u3001html\u3001missing\u3001reference\u307E\u305F\u306Fsyntax\u306E\u3044\u305A\u308C\u304B\u3067\u3059\u3002\n -Xdoclint/package:([-])\n \u7279\u5B9A\u306E\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u307E\u305F\u306F\u7121\u52B9\u306B\u3057\u307E\u3059\u3002\u306F\n \u30AB\u30F3\u30DE\u3067\u533A\u5207\u3089\u308C\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306E\u30EA\u30B9\u30C8\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306F\u3001\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n \u4FEE\u98FE\u3055\u308C\u305F\u540D\u524D\u3001\u307E\u305F\u306F\u30D1\u30C3\u30B1\u30FC\u30B8\u540D\u306E\u63A5\u982D\u8F9E\u306E\u5F8C\u306B''.*''\u3092\u6307\u5B9A(\u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\n \u3059\u3079\u3066\u306E\u30B5\u30D6\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u62E1\u5F35)\u3057\u305F\u3082\u306E\u3067\u3059\u3002\u30D1\u30C3\u30B1\u30FC\u30B8\u6307\u5B9A\u5B50\u306E\u524D\u306B'-'\u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\n \u6307\u5B9A\u3057\u305F\u30D1\u30C3\u30B1\u30FC\u30B8\u306B\u95A2\u3059\u308B\u30C1\u30A7\u30C3\u30AF\u3092\u7121\u52B9\u306B\u3067\u304D\u307E\u3059\u3002\n diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties +++ /dev/null @@ -1,186 +0,0 @@ -doclet.build_version=\u6807\u51C6 Doclet (\u65E7) \u7248\u672C {0} -doclet.Contents=\u76EE\u5F55 -doclet.Overview=\u6982\u89C8 -doclet.Window_Overview=\u6982\u89C8\u5217\u8868 -doclet.Window_Overview_Summary=\u6982\u89C8 -doclet.Package=\u7A0B\u5E8F\u5305 -doclet.All_Packages=\u6240\u6709\u7A0B\u5E8F\u5305 -doclet.Tree=\u6811 -doclet.Class_Hierarchy=\u7C7B\u5206\u5C42\u7ED3\u6784 -doclet.Window_Class_Hierarchy=\u7C7B\u5206\u5C42\u7ED3\u6784 -doclet.Interface_Hierarchy=\u63A5\u53E3\u5206\u5C42\u7ED3\u6784 -doclet.Enum_Hierarchy=\u679A\u4E3E\u5206\u5C42\u7ED3\u6784 -doclet.Annotation_Type_Hierarchy=\u6CE8\u91CA\u7C7B\u578B\u5206\u5C42\u7ED3\u6784 -doclet.Prev=\u4E0A\u4E00\u4E2A -doclet.Next=\u4E0B\u4E00\u4E2A -doclet.Prev_Class=\u4E0A\u4E00\u4E2A\u7C7B -doclet.Next_Class=\u4E0B\u4E00\u4E2A\u7C7B -doclet.Prev_Package=\u4E0A\u4E00\u4E2A\u7A0B\u5E8F\u5305 -doclet.Next_Package=\u4E0B\u4E00\u4E2A\u7A0B\u5E8F\u5305 -doclet.Prev_Letter=\u4E0A\u4E00\u4E2A\u5B57\u6BCD -doclet.Next_Letter=\u4E0B\u4E00\u4E2A\u5B57\u6BCD -doclet.Href_Class_Title={0}\u4E2D\u7684\u7C7B -doclet.Href_Interface_Title={0}\u4E2D\u7684\u63A5\u53E3 -doclet.Href_Annotation_Title={0}\u4E2D\u7684\u6CE8\u91CA -doclet.Href_Enum_Title={0}\u4E2D\u7684\u679A\u4E3E -doclet.Href_Type_Param_Title={0}\u4E2D\u7684\u7C7B\u578B\u53C2\u6570 -doclet.Href_Class_Or_Interface_Title={0}\u4E2D\u7684\u7C7B\u6216\u63A5\u53E3 -doclet.Summary=\u6982\u8981: -doclet.Detail=\u8BE6\u7EC6\u8D44\u6599: -doclet.navNested=\u5D4C\u5957 -doclet.navAnnotationTypeOptionalMember=\u53EF\u9009 -doclet.navAnnotationTypeRequiredMember=\u5FC5\u9700 -doclet.navAnnotationTypeMember=\u5143\u7D20 -doclet.navField=\u5B57\u6BB5 -doclet.navProperty=\u5C5E\u6027 -doclet.navEnum=\u679A\u4E3E\u5E38\u91CF -doclet.navConstructor=\u6784\u9020\u5668 -doclet.navMethod=\u65B9\u6CD5 -doclet.Index=\u7D22\u5F15 -doclet.Window_Single_Index=\u7D22\u5F15 -doclet.Window_Split_Index={0} - \u7D22\u5F15 -doclet.Help=\u5E2E\u52A9 -doclet.Skip_navigation_links=\u8DF3\u8FC7\u5BFC\u822A\u94FE\u63A5 -doclet.Navigation=\u5BFC\u822A -doclet.New_Page=NewPage -doclet.navDeprecated=\u5DF2\u8FC7\u65F6 -doclet.Window_Deprecated_List=\u5DF2\u8FC7\u65F6\u7684\u5217\u8868 -doclet.Overrides=\u8986\u76D6: -doclet.in_class=\u5728\u7C7B\u4E2D -doclet.Static_variable_in={0}\u4E2D\u7684\u9759\u6001\u53D8\u91CF -doclet.Variable_in={0}\u4E2D\u7684\u53D8\u91CF -doclet.Constructor_for={0}\u7684\u6784\u9020\u5668 -doclet.Static_method_in={0}\u4E2D\u7684\u9759\u6001\u65B9\u6CD5 -doclet.Search_tag_in={0}\u4E2D\u7684\u641C\u7D22\u6807\u8BB0 -doclet.Method_in={0}\u4E2D\u7684\u65B9\u6CD5 -doclet.package=\u7A0B\u5E8F\u5305 -doclet.MalformedURL=\u683C\u5F0F\u9519\u8BEF\u7684 URL: {0} -doclet.File_error=\u8BFB\u53D6\u6587\u4EF6\u65F6\u51FA\u9519: {0} -doclet.URL_error=\u83B7\u53D6 URL \u65F6\u51FA\u9519: {0} -doclet.see.class_or_package_not_found=\u6807\u8BB0{0}: \u627E\u4E0D\u5230\u5F15\u7528: {1} -doclet.see.class_or_package_not_accessible=\u6807\u8BB0{0}: \u65E0\u6CD5\u8BBF\u95EE\u5F15\u7528: {1} -doclet.Deprecated_API=\u5DF2\u8FC7\u65F6\u7684 API -doclet.Deprecated_Packages=\u5DF2\u8FC7\u65F6\u7A0B\u5E8F\u5305 -doclet.Deprecated_Classes=\u5DF2\u8FC7\u65F6\u7684\u7C7B -doclet.Deprecated_Enums=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E -doclet.Deprecated_Interfaces=\u5DF2\u8FC7\u65F6\u7684\u63A5\u53E3 -doclet.Deprecated_Exceptions=\u5DF2\u8FC7\u65F6\u7684\u5F02\u5E38\u9519\u8BEF -doclet.Deprecated_Annotation_Types=\u5DF2\u8FC7\u65F6\u7684\u6CE8\u91CA\u7C7B\u578B -doclet.Deprecated_Errors=\u5DF2\u8FC7\u65F6\u7684\u9519\u8BEF -doclet.Deprecated_Fields=\u5DF2\u8FC7\u65F6\u7684\u5B57\u6BB5 -doclet.Deprecated_Constructors=\u5DF2\u8FC7\u65F6\u7684\u6784\u9020\u5668 -doclet.Deprecated_Methods=\u5DF2\u8FC7\u65F6\u7684\u65B9\u6CD5 -doclet.Deprecated_Enum_Constants=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E\u5E38\u91CF -doclet.Deprecated_Annotation_Type_Members=\u5DF2\u8FC7\u65F6\u7684\u6CE8\u91CA\u7C7B\u578B\u5143\u7D20 -doclet.deprecated_packages=\u5DF2\u8FC7\u65F6\u7A0B\u5E8F\u5305 -doclet.deprecated_classes=\u5DF2\u8FC7\u65F6\u7684\u7C7B -doclet.deprecated_enums=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E -doclet.deprecated_interfaces=\u5DF2\u8FC7\u65F6\u7684\u63A5\u53E3 -doclet.deprecated_exceptions=\u5DF2\u8FC7\u65F6\u7684\u5F02\u5E38\u9519\u8BEF -doclet.deprecated_annotation_types=\u5DF2\u8FC7\u65F6\u7684\u6CE8\u91CA\u7C7B\u578B -doclet.deprecated_errors=\u5DF2\u8FC7\u65F6\u7684\u9519\u8BEF -doclet.deprecated_fields=\u5DF2\u8FC7\u65F6\u7684\u5B57\u6BB5 -doclet.deprecated_constructors=\u5DF2\u8FC7\u65F6\u7684\u6784\u9020\u5668 -doclet.deprecated_methods=\u5DF2\u8FC7\u65F6\u7684\u65B9\u6CD5 -doclet.deprecated_enum_constants=\u5DF2\u8FC7\u65F6\u7684\u679A\u4E3E\u5E38\u91CF -doclet.deprecated_annotation_type_members=\u5DF2\u8FC7\u65F6\u7684\u6CE8\u91CA\u7C7B\u578B\u5143\u7D20 -doclet.Generated_Docs_Untitled=\u751F\u6210\u7684\u6587\u6863 (\u65E0\u6807\u9898) -doclet.Other_Packages=\u5176\u4ED6\u7A0B\u5E8F\u5305 -doclet.Package_Description=\u7A0B\u5E8F\u5305{0}\u7684\u8BF4\u660E -doclet.Description=\u8BF4\u660E -doclet.Specified_By=\u6307\u5B9A\u8005: -doclet.in_interface=\u5728\u63A5\u53E3\u4E2D -doclet.Subclasses=\u76F4\u63A5\u5DF2\u77E5\u5B50\u7C7B: -doclet.Subinterfaces=\u6240\u6709\u5DF2\u77E5\u5B50\u63A5\u53E3: -doclet.Implementing_Classes=\u6240\u6709\u5DF2\u77E5\u5B9E\u73B0\u7C7B: -doclet.Functional_Interface=\u51FD\u6570\u63A5\u53E3: -doclet.Functional_Interface_Message=\u8FD9\u662F\u4E00\u4E2A\u51FD\u6570\u63A5\u53E3, \u56E0\u6B64\u53EF\u7528\u4F5C lambda \u8868\u8FBE\u5F0F\u6216\u65B9\u6CD5\u5F15\u7528\u7684\u8D4B\u503C\u76EE\u6807\u3002 -doclet.also=\u5E76 -doclet.Frames=\u6846\u67B6 -doclet.No_Frames=\u65E0\u6846\u67B6 -doclet.Package_Hierarchies=\u7A0B\u5E8F\u5305\u5206\u5C42\u7ED3\u6784: -doclet.Hierarchy_For_Package=\u7A0B\u5E8F\u5305{0}\u7684\u5206\u5C42\u7ED3\u6784 -doclet.Hierarchy_For_All_Packages=\u6240\u6709\u7A0B\u5E8F\u5305\u7684\u5206\u5C42\u7ED3\u6784 -doclet.No_Script_Message=\u60A8\u7684\u6D4F\u89C8\u5668\u5DF2\u7981\u7528 JavaScript\u3002 -doclet.Description_From_Interface=\u4ECE\u63A5\u53E3\u590D\u5236\u7684\u8BF4\u660E: -doclet.Description_From_Class=\u4ECE\u7C7B\u590D\u5236\u7684\u8BF4\u660E: -doclet.No_Non_Deprecated_Classes_To_Document=\u627E\u4E0D\u5230\u53EF\u4EE5\u6587\u6863\u5316\u7684\u672A\u8FC7\u65F6\u7684\u7C7B\u3002 -doclet.Interfaces_Italic=\u63A5\u53E3 (\u659C\u4F53) -doclet.Enclosing_Class=\u5C01\u95ED\u7C7B: -doclet.Enclosing_Interface=\u5C01\u95ED\u63A5\u53E3: -doclet.Window_Source_title=\u6E90\u4EE3\u7801 -doclet.Window_Help_title=API \u5E2E\u52A9 -doclet.Help_line_1=\u6B64 API \u6587\u6863\u7684\u7EC4\u7EC7\u65B9\u5F0F -doclet.Help_line_2=\u6B64 API (\u5E94\u7528\u7A0B\u5E8F\u7F16\u7A0B\u63A5\u53E3) \u6587\u6863\u5305\u542B\u5BF9\u5E94\u4E8E\u5BFC\u822A\u680F\u4E2D\u7684\u9879\u76EE\u7684\u9875\u9762, \u5982\u4E0B\u6240\u8FF0\u3002 -doclet.Help_line_3={0} \u9875\u9762\u662F\u6B64 API \u6587\u6863\u7684\u9996\u9875, \u63D0\u4F9B\u4E86\u6240\u6709\u7A0B\u5E8F\u5305\u7684\u5217\u8868\u53CA\u5176\u6982\u8981\u3002\u6B64\u9875\u9762\u4E5F\u53EF\u80FD\u5305\u542B\u8FD9\u4E9B\u7A0B\u5E8F\u5305\u7684\u603B\u4F53\u8BF4\u660E\u3002 -doclet.Help_line_4=\u6BCF\u4E2A\u7A0B\u5E8F\u5305\u90FD\u6709\u4E00\u4E2A\u9875\u9762, \u5176\u4E2D\u5305\u542B\u5B83\u7684\u7C7B\u548C\u63A5\u53E3\u7684\u5217\u8868\u53CA\u5176\u6982\u8981\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5305\u542B\u516D\u4E2A\u7C7B\u522B: -doclet.Help_line_5=\u7C7B/\u63A5\u53E3 -doclet.Help_line_6=\u6BCF\u4E2A\u7C7B, \u63A5\u53E3, \u5D4C\u5957\u7C7B\u548C\u5D4C\u5957\u63A5\u53E3\u90FD\u6709\u5404\u81EA\u7684\u9875\u9762\u3002\u5176\u4E2D\u6BCF\u4E2A\u9875\u9762\u90FD\u7531\u4E09\u90E8\u5206 (\u7C7B/\u63A5\u53E3\u8BF4\u660E, \u6982\u8981\u8868, \u4EE5\u53CA\u8BE6\u7EC6\u7684\u6210\u5458\u8BF4\u660E) \u7EC4\u6210: -doclet.Help_line_7=\u7C7B\u7EE7\u627F\u56FE -doclet.Help_line_8=\u76F4\u63A5\u5B50\u7C7B -doclet.Help_line_9=\u6240\u6709\u5DF2\u77E5\u5B50\u63A5\u53E3 -doclet.Help_line_10=\u6240\u6709\u5DF2\u77E5\u5B9E\u73B0\u7C7B -doclet.Help_line_11=\u7C7B/\u63A5\u53E3\u58F0\u660E -doclet.Help_line_12=\u7C7B/\u63A5\u53E3\u8BF4\u660E -doclet.Help_line_13=\u6BCF\u4E2A\u6982\u8981\u6761\u76EE\u90FD\u5305\u542B\u8BE5\u9879\u76EE\u7684\u8BE6\u7EC6\u8BF4\u660E\u7684\u7B2C\u4E00\u53E5\u3002\u6982\u8981\u6761\u76EE\u6309\u5B57\u6BCD\u987A\u5E8F\u6392\u5217, \u800C\u8BE6\u7EC6\u8BF4\u660E\u5219\u6309\u5176\u5728\u6E90\u4EE3\u7801\u4E2D\u51FA\u73B0\u7684\u987A\u5E8F\u6392\u5217\u3002\u8FD9\u6837\u4FDD\u6301\u4E86\u7A0B\u5E8F\u5458\u6240\u5EFA\u7ACB\u7684\u903B\u8F91\u5206\u7EC4\u3002 -doclet.Help_line_14=\u4F7F\u7528 -doclet.Help_line_15=\u6BCF\u4E2A\u5DF2\u6587\u6863\u5316\u7684\u7A0B\u5E8F\u5305, \u7C7B\u548C\u63A5\u53E3\u90FD\u6709\u5404\u81EA\u7684\u201C\u4F7F\u7528\u201D\u9875\u9762\u3002\u6B64\u9875\u9762\u4ECB\u7ECD\u4E86\u4F7F\u7528\u7ED9\u5B9A\u7C7B\u6216\u7A0B\u5E8F\u5305\u7684\u4EFB\u4F55\u90E8\u5206\u7684\u7A0B\u5E8F\u5305, \u7C7B, \u65B9\u6CD5, \u6784\u9020\u5668\u548C\u5B57\u6BB5\u3002\u5BF9\u4E8E\u7ED9\u5B9A\u7684\u7C7B\u6216\u63A5\u53E3 A, \u5176\u201C\u4F7F\u7528\u201D\u9875\u9762\u5305\u542B A \u7684\u5B50\u7C7B, \u58F0\u660E\u4E3A A \u7684\u5B57\u6BB5, \u8FD4\u56DE A \u7684\u65B9\u6CD5, \u4EE5\u53CA\u5E26\u6709\u7C7B\u578B\u4E3A A \u7684\u53C2\u6570\u7684\u65B9\u6CD5\u548C\u6784\u9020\u5668\u3002\u8BBF\u95EE\u6B64\u9875\u9762\u7684\u65B9\u6CD5\u662F: \u9996\u5148\u8F6C\u81F3\u7A0B\u5E8F\u5305, \u7C7B\u6216\u63A5\u53E3, \u7136\u540E\u5355\u51FB\u5BFC\u822A\u680F\u4E2D\u7684 "\u4F7F\u7528" \u94FE\u63A5\u3002 -doclet.Help_line_16=\u6811 (\u7C7B\u5206\u5C42\u7ED3\u6784) -doclet.Help_line_17_with_tree_link=\u5BF9\u4E8E\u6240\u6709\u7A0B\u5E8F\u5305, \u6709\u4E00\u4E2A{0}\u9875\u9762, \u4EE5\u53CA\u6BCF\u4E2A\u7A0B\u5E8F\u5305\u7684\u5206\u5C42\u7ED3\u6784\u3002\u6BCF\u4E2A\u5206\u5C42\u7ED3\u6784\u9875\u9762\u90FD\u5305\u542B\u7C7B\u7684\u5217\u8868\u548C\u63A5\u53E3\u7684\u5217\u8868\u3002\u4ECE{1}\u5F00\u59CB, \u6309\u7EE7\u627F\u7ED3\u6784\u5BF9\u7C7B\u8FDB\u884C\u6392\u5217\u3002\u63A5\u53E3\u4E0D\u4ECE{1}\u7EE7\u627F\u3002 -doclet.Help_line_18=\u67E5\u770B\u201C\u6982\u89C8\u201D\u9875\u9762\u65F6, \u5355\u51FB "\u6811" \u5C06\u663E\u793A\u6240\u6709\u7A0B\u5E8F\u5305\u7684\u5206\u5C42\u7ED3\u6784\u3002 -doclet.Help_line_19=\u67E5\u770B\u7279\u5B9A\u7A0B\u5E8F\u5305, \u7C7B\u6216\u63A5\u53E3\u9875\u9762\u65F6, \u5355\u51FB "\u6811" \u5C06\u4EC5\u663E\u793A\u8BE5\u7A0B\u5E8F\u5305\u7684\u5206\u5C42\u7ED3\u6784\u3002 -doclet.Help_line_20_with_deprecated_api_link={0} \u9875\u9762\u5217\u51FA\u4E86\u6240\u6709\u5DF2\u8FC7\u65F6\u7684 API\u3002\u4E00\u822C\u7531\u4E8E\u8FDB\u884C\u4E86\u6539\u8FDB\u5E76\u4E14\u901A\u5E38\u63D0\u4F9B\u4E86\u66FF\u4EE3\u7684 API, \u6240\u4EE5\u5EFA\u8BAE\u4E0D\u8981\u4F7F\u7528\u5DF2\u8FC7\u65F6\u7684 API\u3002\u5728\u5C06\u6765\u7684\u5B9E\u73B0\u8FC7\u7A0B\u4E2D, \u53EF\u80FD\u4F1A\u5220\u9664\u5DF2\u8FC7\u65F6\u7684 API\u3002 -doclet.Help_line_21=\u7D22\u5F15 -doclet.Help_line_22={0} \u5305\u542B\u6309\u5B57\u6BCD\u987A\u5E8F\u6392\u5217\u7684\u6240\u6709\u7C7B, \u63A5\u53E3, \u6784\u9020\u5668, \u65B9\u6CD5\u548C\u5B57\u6BB5\u7684\u5217\u8868\u3002 -doclet.Help_line_23=\u4E0A\u4E00\u4E2A/\u4E0B\u4E00\u4E2A -doclet.Help_line_24=\u8FD9\u4E9B\u94FE\u63A5\u4F7F\u60A8\u53EF\u4EE5\u8F6C\u81F3\u4E0B\u4E00\u4E2A\u6216\u4E0A\u4E00\u4E2A\u7C7B, \u63A5\u53E3, \u7A0B\u5E8F\u5305\u6216\u76F8\u5173\u9875\u9762\u3002 -doclet.Help_line_25=\u6846\u67B6/\u65E0\u6846\u67B6 -doclet.Help_line_26=\u8FD9\u4E9B\u94FE\u63A5\u7528\u4E8E\u663E\u793A\u548C\u9690\u85CF HTML \u6846\u67B6\u3002\u6240\u6709\u9875\u9762\u5747\u5177\u6709\u6709\u6846\u67B6\u548C\u65E0\u6846\u67B6\u4E24\u79CD\u663E\u793A\u65B9\u5F0F\u3002 -doclet.Help_line_27={0}\u94FE\u63A5\u663E\u793A\u6240\u6709\u7C7B\u548C\u63A5\u53E3 (\u9664\u4E86\u975E\u9759\u6001\u5D4C\u5957\u7C7B\u578B)\u3002 -doclet.Help_line_28=\u6BCF\u4E2A\u53EF\u5E8F\u5217\u5316\u6216\u53EF\u5916\u90E8\u5316\u7684\u7C7B\u90FD\u6709\u5176\u5E8F\u5217\u5316\u5B57\u6BB5\u548C\u65B9\u6CD5\u7684\u8BF4\u660E\u3002\u6B64\u4FE1\u606F\u5BF9\u91CD\u65B0\u5B9E\u73B0\u8005\u6709\u7528, \u800C\u5BF9\u4F7F\u7528 API \u7684\u5F00\u53D1\u8005\u5219\u6CA1\u6709\u4EC0\u4E48\u7528\u5904\u3002\u5C3D\u7BA1\u5BFC\u822A\u680F\u4E2D\u6CA1\u6709\u94FE\u63A5, \u4F46\u60A8\u53EF\u4EE5\u901A\u8FC7\u4E0B\u5217\u65B9\u5F0F\u83B7\u53D6\u6B64\u4FE1\u606F: \u8F6C\u81F3\u4EFB\u4F55\u5E8F\u5217\u5316\u7C7B, \u7136\u540E\u5355\u51FB\u7C7B\u8BF4\u660E\u7684 "\u53E6\u8BF7\u53C2\u9605" \u90E8\u5206\u4E2D\u7684 "\u5E8F\u5217\u5316\u8868\u683C"\u3002 -doclet.Help_line_29={0}\u9875\u9762\u5217\u51FA\u4E86\u9759\u6001\u6700\u7EC8\u5B57\u6BB5\u53CA\u5176\u503C\u3002 -doclet.Help_line_30=\u6B64\u5E2E\u52A9\u6587\u4EF6\u9002\u7528\u4E8E\u4F7F\u7528\u6807\u51C6 doclet \u751F\u6210\u7684 API \u6587\u6863\u3002 -doclet.Help_enum_line_1=\u6BCF\u4E2A\u679A\u4E3E\u90FD\u6709\u5404\u81EA\u7684\u9875\u9762, \u5176\u4E2D\u5305\u542B\u4EE5\u4E0B\u90E8\u5206: -doclet.Help_enum_line_2=\u679A\u4E3E\u58F0\u660E -doclet.Help_enum_line_3=\u679A\u4E3E\u8BF4\u660E -doclet.Help_annotation_type_line_1=\u6BCF\u4E2A\u6CE8\u91CA\u7C7B\u578B\u90FD\u6709\u5404\u81EA\u7684\u9875\u9762, \u5176\u4E2D\u5305\u542B\u4EE5\u4E0B\u90E8\u5206: -doclet.Help_annotation_type_line_2=\u6CE8\u91CA\u7C7B\u578B\u58F0\u660E -doclet.Help_annotation_type_line_3=\u6CE8\u91CA\u7C7B\u578B\u8BF4\u660E -doclet.ClassUse_Packages.that.use.0=\u4F7F\u7528{0}\u7684\u7A0B\u5E8F\u5305 -doclet.ClassUse_Uses.of.0.in.1={1}\u4E2D{0}\u7684\u4F7F\u7528 -doclet.ClassUse_Classes.in.0.used.by.1={1}\u4F7F\u7528\u7684{0}\u4E2D\u7684\u7C7B -doclet.ClassUse_PackageAnnotation=\u6CE8\u91CA\u7C7B\u578B\u4E3A{0}\u7684\u7A0B\u5E8F\u5305 -doclet.ClassUse_Annotation=\u6CE8\u91CA\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u7C7B -doclet.ClassUse_TypeParameter=\u7C7B\u578B\u53C2\u6570\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u7C7B -doclet.ClassUse_MethodTypeParameter=\u7C7B\u578B\u53C2\u6570\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u65B9\u6CD5 -doclet.ClassUse_FieldTypeParameter=\u7C7B\u578B\u53C2\u6570\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u5B57\u6BB5 -doclet.ClassUse_FieldAnnotations=\u6CE8\u91CA\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u5B57\u6BB5 -doclet.ClassUse_MethodAnnotations=\u6CE8\u91CA\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u65B9\u6CD5 -doclet.ClassUse_MethodParameterAnnotations=\u6CE8\u91CA\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u65B9\u6CD5\u53C2\u6570 -doclet.ClassUse_MethodReturnTypeParameter=\u8FD4\u56DE\u53D8\u91CF\u7C7B\u578B\u4E3A{0}\u7684\u7C7B\u578B\u7684{1}\u4E2D\u7684\u65B9\u6CD5 -doclet.ClassUse_Subclass={1}\u4E2D{0}\u7684\u5B50\u7C7B -doclet.ClassUse_Subinterface={1}\u4E2D{0}\u7684\u5B50\u63A5\u53E3 -doclet.ClassUse_ImplementingClass=\u5B9E\u73B0{0}\u7684{1}\u4E2D\u7684\u7C7B -doclet.ClassUse_Field=\u58F0\u660E\u4E3A{0}\u7684{1}\u4E2D\u7684\u5B57\u6BB5 -doclet.ClassUse_MethodReturn=\u8FD4\u56DE{0}\u7684{1}\u4E2D\u7684\u65B9\u6CD5 -doclet.ClassUse_MethodArgs=\u53C2\u6570\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u65B9\u6CD5 -doclet.ClassUse_MethodArgsTypeParameters=\u7C7B\u578B\u53D8\u91CF\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u65B9\u6CD5\u53C2\u6570 -doclet.ClassUse_MethodThrows=\u629B\u51FA{0}\u7684{1}\u4E2D\u7684\u65B9\u6CD5 -doclet.ClassUse_ConstructorAnnotations=\u6CE8\u91CA\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u6784\u9020\u5668 -doclet.ClassUse_ConstructorParameterAnnotations=\u6CE8\u91CA\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u6784\u9020\u5668\u53C2\u6570 -doclet.ClassUse_ConstructorArgs=\u53C2\u6570\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u6784\u9020\u5668 -doclet.ClassUse_ConstructorArgsTypeParameters=\u7C7B\u578B\u53D8\u91CF\u7C7B\u578B\u4E3A{0}\u7684{1}\u4E2D\u7684\u6784\u9020\u5668\u53C2\u6570 -doclet.ClassUse_ConstructorThrows=\u629B\u51FA{0}\u7684{1}\u4E2D\u7684\u6784\u9020\u5668 -doclet.ClassUse_No.usage.of.0=\u6CA1\u6709{0}\u7684\u7528\u6CD5 -doclet.Window_ClassUse_Header={0} {1}\u7684\u4F7F\u7528 -doclet.ClassUse_Title={0}\u7684\u4F7F\u7528 -doclet.navClassUse=\u4F7F\u7528 -doclet.Error_in_packagelist=\u4F7F\u7528 -group \u9009\u9879\u65F6\u51FA\u9519: {0} {1} -doclet.Groupname_already_used=\u5728 -group \u9009\u9879\u4E2D, groupname \u5DF2\u4F7F\u7528: {0} -doclet.Same_package_name_used=\u7A0B\u5E8F\u5305\u540D\u79F0\u5F62\u5F0F\u4F7F\u7528\u4E86\u4E24\u6B21: {0} -doclet.exception_encountered=\u5904\u7406{1}\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF\n{0} -doclet.usage=\u901A\u8FC7\u6807\u51C6 doclet \u63D0\u4F9B:\n -d \u8F93\u51FA\u6587\u4EF6\u7684\u76EE\u6807\u76EE\u5F55\n -use \u521B\u5EFA\u7C7B\u548C\u7A0B\u5E8F\u5305\u7528\u6CD5\u9875\u9762\n -version \u5305\u542B @version \u6BB5\n -author \u5305\u542B @author \u6BB5\n -docfilessubdirs \u9012\u5F52\u590D\u5236\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\n -splitindex \u5C06\u7D22\u5F15\u5206\u4E3A\u6BCF\u4E2A\u5B57\u6BCD\u5BF9\u5E94\u4E00\u4E2A\u6587\u4EF6\n -windowtitle \u6587\u6863\u7684\u6D4F\u89C8\u5668\u7A97\u53E3\u6807\u9898\n -doctitle \u5305\u542B\u6982\u89C8\u9875\u9762\u7684\u6807\u9898\n -header \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u7709\u6587\u672C\n -html4 \u751F\u6210 HTML 4.01 \u8F93\u51FA\n -html5 \u751F\u6210 HTML 5 \u8F93\u51FA\n -footer \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9875\u811A\u6587\u672C\n -top \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u9876\u90E8\u6587\u672C\n -bottom \u5305\u542B\u6BCF\u4E2A\u9875\u9762\u7684\u5E95\u90E8\u6587\u672C\n -link \u521B\u5EFA\u6307\u5411\u4F4D\u4E8E \u7684 javadoc \u8F93\u51FA\u7684\u94FE\u63A5\n -linkoffline \u5229\u7528\u4F4D\u4E8E \u7684\u7A0B\u5E8F\u5305\u5217\u8868\u94FE\u63A5\u81F3\u4F4D\u4E8E \u7684\u6587\u6863\n -excludedocfilessubdir :.. \u6392\u9664\u5177\u6709\u7ED9\u5B9A\u540D\u79F0\u7684\u6240\u6709\u6587\u6863\u6587\u4EF6\u5B50\u76EE\u5F55\u3002\n -group :.. \u5728\u6982\u89C8\u9875\u9762\u4E2D, \u5C06\u6307\u5B9A\u7684\u7A0B\u5E8F\u5305\u5206\u7EC4\n -nocomment \u4E0D\u751F\u6210\u8BF4\u660E\u548C\u6807\u8BB0, \u53EA\u751F\u6210\u58F0\u660E\u3002\n -nodeprecated \u4E0D\u5305\u542B @deprecated \u4FE1\u606F\n -noqualifier ::... \u8F93\u51FA\u4E2D\u4E0D\u5305\u62EC\u6307\u5B9A\u9650\u5B9A\u7B26\u7684\u5217\u8868\u3002\n -nosince \u4E0D\u5305\u542B @since \u4FE1\u606F\n -notimestamp \u4E0D\u5305\u542B\u9690\u85CF\u65F6\u95F4\u6233\n -nodeprecatedlist \u4E0D\u751F\u6210\u5DF2\u8FC7\u65F6\u7684\u5217\u8868\n -notree \u4E0D\u751F\u6210\u7C7B\u5206\u5C42\u7ED3\u6784\n -noindex \u4E0D\u751F\u6210\u7D22\u5F15\n -nohelp \u4E0D\u751F\u6210\u5E2E\u52A9\u94FE\u63A5\n -nonavbar \u4E0D\u751F\u6210\u5BFC\u822A\u680F\n -serialwarn \u751F\u6210\u6709\u5173 @serial \u6807\u8BB0\u7684\u8B66\u544A\n -tag ::
\u6307\u5B9A\u5355\u4E2A\u53C2\u6570\u5B9A\u5236\u6807\u8BB0\n -taglet \u8981\u6CE8\u518C\u7684 Taglet \u7684\u5168\u9650\u5B9A\u540D\u79F0\n -tagletpath Taglet \u7684\u8DEF\u5F84\n -charset \u7528\u4E8E\u8DE8\u5E73\u53F0\u67E5\u770B\u751F\u6210\u7684\u6587\u6863\u7684\u5B57\u7B26\u96C6\u3002\n -helpfile \u5305\u542B\u5E2E\u52A9\u94FE\u63A5\u6240\u94FE\u63A5\u5230\u7684\u6587\u4EF6\n -linksource \u4EE5 HTML \u683C\u5F0F\u751F\u6210\u6E90\u6587\u4EF6\n -sourcetab \u6307\u5B9A\u6E90\u4E2D\u6BCF\u4E2A\u5236\u8868\u7B26\u5360\u636E\u7684\u7A7A\u683C\u6570\n -keywords \u4F7F\u7A0B\u5E8F\u5305, \u7C7B\u548C\u6210\u5458\u4FE1\u606F\u9644\u5E26 HTML \u5143\u6807\u8BB0\n -stylesheetfile \u7528\u4E8E\u66F4\u6539\u751F\u6210\u6587\u6863\u7684\u6837\u5F0F\u7684\u6587\u4EF6\n -docencoding \u6307\u5B9A\u8F93\u51FA\u7684\u5B57\u7B26\u7F16\u7801 - - -# L10N: do not localize these words: all none accessibility html missing reference syntax -doclet.X.usage=\u901A\u8FC7\u6807\u51C6 doclet \u63D0\u4F9B:\n -Xdocrootparent \u4F7F\u7528 \u66FF\u6362\u6587\u6863\u6CE8\u91CA\u4E2D\u51FA\u73B0\u7684\n \u6240\u6709\u5176\u540E\u8DDF\u968F /.. \u7684 @docRoot\n -Xdoclint \u4E3A javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u5EFA\u8BAE\u7684\u68C0\u67E5\n -Xdoclint:(all|none|[-]) \n \u5BF9 javadoc \u6CE8\u91CA\u4E2D\u7684\u95EE\u9898\u542F\u7528\u6216\u7981\u7528\u7279\u5B9A\u68C0\u67E5\u3002\n \u5176\u4E2D \u662F accessibility, html, missing, reference \u6216 syntax \u4E4B\u4E00\u3002\n -Xdoclint/package:([-])\n \u5728\u7279\u5B9A\u7684\u7A0B\u5E8F\u5305\u4E2D\u542F\u7528\u6216\u7981\u7528\u68C0\u67E5\u3002 \u662F\u9017\u53F7\u5206\u9694\u7684\n \u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u5217\u8868\u3002\u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u662F\u7A0B\u5E8F\u5305\u7684\u9650\u5B9A\u540D\u79F0\n \u6216\u7A0B\u5E8F\u5305\u540D\u79F0\u524D\u7F00\u540E\u8DDF .*, \u5B83\u6269\u5C55\u5230\u7ED9\u5B9A\u7A0B\u5E8F\u5305\u7684\n \u6240\u6709\u5B50\u7A0B\u5E8F\u5305\u3002\u5728\u7A0B\u5E8F\u5305\u8BF4\u660E\u7B26\u524D\u9762\u52A0\u4E0A - \u53EF\u4EE5\u4E3A\n \u6307\u5B9A\u7A0B\u5E8F\u5305\u7981\u7528\u68C0\u67E5\u3002\n diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import javax.tools.StandardLocation; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.builders.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * An abstract implementation of a Doclet. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - */ -@Deprecated -public abstract class AbstractDoclet { - - /** - * The global configuration information for this run. - */ - public Configuration configuration; - /* - * a handle to our utility methods - */ - protected Utils utils; - - /** - * The only doclet that may use this toolkit is {@value} - */ - private static final String TOOLKIT_DOCLET_NAME = - com.sun.tools.doclets.formats.html.HtmlDoclet.class.getName(); - - /** - * Verify that the only doclet that is using this toolkit is - * {@value #TOOLKIT_DOCLET_NAME}. - */ - private boolean isValidDoclet() { - if (!getClass().getName().equals(TOOLKIT_DOCLET_NAME)) { - configuration.message.error("doclet.Toolkit_Usage_Violation", - TOOLKIT_DOCLET_NAME); - return false; - } - return true; - } - - /** - * The method that starts the execution of the doclet. - * - * @param root the {@link RootDoc} that points to the source to document. - * @return true if the doclet executed without error. False otherwise. - */ - public boolean startDoclet(RootDoc root) { - configuration = configuration(); - configuration.root = root; - utils = configuration.utils; - if (!isValidDoclet()) { - return false; - } - try { - startGeneration(root); - } catch (Configuration.Fault f) { - root.printError(f.getMessage()); - return false; - } catch (FatalError fe) { - return false; - } catch (DocletAbortException e) { - e.printStackTrace(); - Throwable cause = e.getCause(); - if (cause != null) { - if (cause.getLocalizedMessage() != null) { - root.printError(cause.getLocalizedMessage()); - } else { - root.printError(cause.toString()); - } - } - return false; - } catch (Exception exc) { - return false; - } - return true; - } - - /** - * Indicate that this doclet supports the 1.5 language features. - * @return JAVA_1_5, indicating that the new features are supported. - */ - public static LanguageVersion languageVersion() { - return LanguageVersion.JAVA_1_5; - } - - - /** - * Create the configuration instance and returns it. - * @return the configuration of the doclet. - */ - public abstract Configuration configuration(); - - /** - * Start the generation of files. Call generate methods in the individual - * writers, which will in turn generate the documentation files. Call the - * TreeWriter generation first to ensure the Class Hierarchy is built - * first and then can be used in the later generation. - * - * @see com.sun.javadoc.RootDoc - */ - private void startGeneration(RootDoc root) throws Configuration.Fault, Exception { - if (root.classes().length == 0) { - configuration.message. - error("doclet.No_Public_Classes_To_Document"); - return; - } - configuration.setOptions(); - configuration.getDocletSpecificMsg().notice("doclet.build_version", - configuration.getDocletSpecificBuildDate()); - ClassTree classtree = new ClassTree(configuration, configuration.nodeprecated); - - generateClassFiles(root, classtree); - configuration.utils.copyDocFiles(configuration, StandardLocation.SOURCE_PATH, DocPaths.DOC_FILES); - - PackageListWriter.generate(configuration); - generatePackageFiles(classtree); - - generateOtherFiles(root, classtree); - configuration.tagletManager.printReport(); - } - - /** - * Generate additional documentation that is added to the API documentation. - * - * @param root the RootDoc of source to document. - * @param classtree the data structure representing the class tree. - */ - protected void generateOtherFiles(RootDoc root, ClassTree classtree) throws Exception { - BuilderFactory builderFactory = configuration.getBuilderFactory(); - AbstractBuilder constantsSummaryBuilder = builderFactory.getConstantsSummaryBuider(); - constantsSummaryBuilder.build(); - AbstractBuilder serializedFormBuilder = builderFactory.getSerializedFormBuilder(); - serializedFormBuilder.build(); - } - - /** - * Generate the package documentation. - * - * @param classtree the data structure representing the class tree. - */ - protected abstract void generatePackageFiles(ClassTree classtree) throws Exception; - - /** - * Generate the class documentation. - * - * @param classtree the data structure representing the class tree. - */ - protected abstract void generateClassFiles(ClassDoc[] arr, ClassTree classtree); - - /** - * Iterate through all classes and construct documentation for them. - * - * @param root the RootDoc of source to document. - * @param classtree the data structure representing the class tree. - */ - protected void generateClassFiles(RootDoc root, ClassTree classtree) { - generateClassFiles(classtree); - PackageDoc[] packages = root.specifiedPackages(); - for (PackageDoc pkg : packages) { - generateClassFiles(pkg.allClasses(), classtree); - } - } - - /** - * Generate the class files for single classes specified on the command line. - * - * @param classtree the data structure representing the class tree. - */ - private void generateClassFiles(ClassTree classtree) { - String[] packageNames = configuration.classDocCatalog.packageNames(); - for (String packageName : packageNames) { - generateClassFiles(configuration.classDocCatalog.allClasses( - packageName), classtree); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeFieldWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeFieldWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeFieldWriter.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import com.sun.javadoc.*; - -/** - * The interface for writing annotation type field output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * - * @author Bhavesh Patel - * @since 1.8 - */ - -@Deprecated -public interface AnnotationTypeFieldWriter { - - /** - * Add the annotation type member tree header. - * - * @return content tree for the member tree header - */ - public Content getMemberTreeHeader(); - - /** - * Add the annotation type field details marker. - * - * @param memberDetails the content tree representing field details marker - */ - public void addAnnotationFieldDetailsMarker(Content memberDetails); - - /** - * Add the annotation type details tree header. - * - * @param classDoc the annotation type being documented - * @param memberDetailsTree the content tree representing member details - */ - public void addAnnotationDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree); - - /** - * Get the annotation type documentation tree header. - * - * @param member the annotation type being documented - * @param annotationDetailsTree the content tree representing annotation type details - * @return content tree for the annotation type documentation header - */ - public Content getAnnotationDocTreeHeader(MemberDoc member, - Content annotationDetailsTree); - - /** - * Get the annotation type details tree. - * - * @param annotationDetailsTree the content tree representing annotation type details - * @return content tree for the annotation type details - */ - public Content getAnnotationDetails(Content annotationDetailsTree); - - /** - * Get the annotation type documentation. - * - * @param annotationDocTree the content tree representing annotation type documentation - * @param isLastContent true if the content to be added is the last content - * @return content tree for the annotation type documentation - */ - public Content getAnnotationDoc(Content annotationDocTree, boolean isLastContent); - - /** - * Get the signature for the given member. - * - * @param member the member being documented - * @return content tree for the annotation type signature - */ - public Content getSignature(MemberDoc member); - - /** - * Add the deprecated output for the given member. - * - * @param member the member being documented - * @param annotationDocTree content tree to which the deprecated information will be added - */ - public void addDeprecated(MemberDoc member, Content annotationDocTree); - - /** - * Add the comments for the given member. - * - * @param member the member being documented - * @param annotationDocTree the content tree to which the comments will be added - */ - public void addComments(MemberDoc member, Content annotationDocTree); - - /** - * Add the tags for the given member. - * - * @param member the member being documented - * @param annotationDocTree the content tree to which the tags will be added - */ - public void addTags(MemberDoc member, Content annotationDocTree); - - /** - * Close the writer. - */ - public void close() throws IOException; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import com.sun.javadoc.*; - -/** - * The interface for writing annotation type optional member output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface AnnotationTypeOptionalMemberWriter extends - AnnotationTypeRequiredMemberWriter { - - /** - * Add the the default value documentation. - * - * @param member the member being documented - * @param annotationDocTree content tree to which the default value will be added - */ - public void addDefaultValueInfo(MemberDoc member, Content annotationDocTree); -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import com.sun.javadoc.*; - -/** - * The interface for writing annotation type required member output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface AnnotationTypeRequiredMemberWriter { - - /** - * Add the annotation type member tree header. - * - * @return content tree for the member tree header - */ - public Content getMemberTreeHeader(); - - /** - * Add the annotation type details marker. - * - * @param memberDetails the content tree representing details marker - */ - public void addAnnotationDetailsMarker(Content memberDetails); - - /** - * Add the annotation type details tree header. - * - * @param classDoc the annotation type being documented - * @param memberDetailsTree the content tree representing member details - */ - public void addAnnotationDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree); - - /** - * Get the annotation type documentation tree header. - * - * @param member the annotation type being documented - * @param annotationDetailsTree the content tree representing annotation type details - * @return content tree for the annotation type documentation header - */ - public Content getAnnotationDocTreeHeader(MemberDoc member, - Content annotationDetailsTree); - - /** - * Get the annotation type details tree. - * - * @param annotationDetailsTree the content tree representing annotation type details - * @return content tree for the annotation type details - */ - public Content getAnnotationDetails(Content annotationDetailsTree); - - /** - * Get the annotation type documentation. - * - * @param annotationDocTree the content tree representing annotation type documentation - * @param isLastContent true if the content to be added is the last content - * @return content tree for the annotation type documentation - */ - public Content getAnnotationDoc(Content annotationDocTree, boolean isLastContent); - - /** - * Get the signature for the given member. - * - * @param member the member being documented - * @return content tree for the annotation type signature - */ - public Content getSignature(MemberDoc member); - - /** - * Add the deprecated output for the given member. - * - * @param member the member being documented - * @param annotationDocTree content tree to which the deprecated information will be added - */ - public void addDeprecated(MemberDoc member, Content annotationDocTree); - - /** - * Add the comments for the given member. - * - * @param member the member being documented - * @param annotationDocTree the content tree to which the comments will be added - */ - public void addComments(MemberDoc member, Content annotationDocTree); - - /** - * Add the tags for the given member. - * - * @param member the member being documented - * @param annotationDocTree the content tree to which the tags will be added - */ - public void addTags(MemberDoc member, Content annotationDocTree); - - /** - * Close the writer. - */ - public void close() throws IOException; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import com.sun.javadoc.*; - -/** - * The interface for writing annotation type output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface AnnotationTypeWriter { - - /** - * Get the header of the page. - * - * @param header the header string to write - * @return a content tree for the header documentation - */ - public Content getHeader(String header); - - /** - * Get the annotation content header. - * - * @return annotation content header that needs to be added to the documentation - */ - public Content getAnnotationContentHeader(); - - /** - * Get the annotation information tree header. - * - * @return annotation information tree header that needs to be added to the documentation - */ - public Content getAnnotationInfoTreeHeader(); - - /** - * Get the annotation information. - * - * @param annotationInfoTree content tree containing the annotation information - * @return a content tree for the annotation - */ - public Content getAnnotationInfo(Content annotationInfoTree); - - /** - * Add the signature of the current annotation type. - * - * @param modifiers the modifiers for the signature - * @param annotationInfoTree the annotation content tree to which the signature will be added - */ - public void addAnnotationTypeSignature(String modifiers, Content annotationInfoTree); - - /** - * Build the annotation type description. - * - * @param annotationInfoTree content tree to which the description will be added - */ - public void addAnnotationTypeDescription(Content annotationInfoTree); - - /** - * Add the tag information for the current annotation type. - * - * @param annotationInfoTree content tree to which the tag information will be added - */ - public void addAnnotationTypeTagInfo(Content annotationInfoTree); - - /** - * If this annotation is deprecated, add the appropriate information. - * - * @param annotationInfoTree content tree to which the deprecated information will be added - */ - public void addAnnotationTypeDeprecationInfo (Content annotationInfoTree); - - /** - * Get the member tree header for the annotation type. - * - * @return a content tree for the member tree header - */ - public Content getMemberTreeHeader(); - - /** - * Add the annotation content tree to the documentation content tree. - * - * @param contentTree content tree to which the annotation content will be added - * @param annotationContentTree annotation content tree which will be added to the content tree - */ - public void addAnnotationContentTree(Content contentTree, Content annotationContentTree); - - /** - * Get the member tree. - * - * @param memberTree the content tree that will be modified and returned - * @return a content tree for the member - */ - public Content getMemberTree(Content memberTree); - - /** - * Get the member summary tree. - * - * @param memberTree the content tree that will be used to build the summary tree - * @return a content tree for the member summary - */ - public Content getMemberSummaryTree(Content memberTree); - - /** - * Get the member details tree. - * - * @param memberTree the content tree that will be used to build the details tree - * @return a content tree for the member details - */ - public Content getMemberDetailsTree(Content memberTree); - - /** - * Add the footer of the page. - * - * @param contentTree content tree to which the footer will be added - */ - public void addFooter(Content contentTree); - - /** - * Print the document. - * - * @param contentTree content tree that will be printed as a document - */ - public void printDocument(Content contentTree) throws IOException; - - /** - * Close the writer. - */ - public void close() throws IOException; - - /** - * Return the {@link AnnotationTypeDoc} being documented. - * - * @return the AnnotationTypeDoc being documented. - */ - public AnnotationTypeDoc getAnnotationTypeDoc(); -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import com.sun.javadoc.*; - -/** - * The interface for writing class output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface ClassWriter { - - /** - * Get the header of the page. - * - * @param header the header string to write - * @return header content that needs to be added to the documentation - */ - public Content getHeader(String header); - - /** - * Get the class content header. - * - * @return class content header that needs to be added to the documentation - */ - public Content getClassContentHeader(); - - /** - * Add the class tree documentation. - * - * @param classContentTree class content tree to which the documentation will be added - */ - public void addClassTree(Content classContentTree); - - /** - * Get the class information tree header. - * - * @return class informaion tree header that needs to be added to the documentation - */ - public Content getClassInfoTreeHeader(); - - /** - * Add the type parameter information. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addTypeParamInfo(Content classInfoTree); - - /** - * Add all super interfaces if this is an interface. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addSuperInterfacesInfo(Content classInfoTree); - - /** - * Add all implemented interfaces if this is a class. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addImplementedInterfacesInfo(Content classInfoTree); - - /** - * Add all the classes that extend this one. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addSubClassInfo(Content classInfoTree); - - /** - * Add all the interfaces that extend this one. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addSubInterfacesInfo(Content classInfoTree); - - /** - * If this is an interface, add all classes that implement this - * interface. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addInterfaceUsageInfo(Content classInfoTree); - - /** - * If this is an functional interface, display appropriate message. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addFunctionalInterfaceInfo(Content classInfoTree); - - /** - * If this is an inner class or interface, add the enclosing class or - * interface. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addNestedClassInfo (Content classInfoTree); - - /** - * Get the class information. - * - * @param classInfoTree content tree conatining the class information - * @return a content tree for the class - */ - public Content getClassInfo(Content classInfoTree); - - /** - * If this class is deprecated, add the appropriate information. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addClassDeprecationInfo (Content classInfoTree); - - /** - * Add the signature of the current class content tree. - * - * @param modifiers the modifiers for the signature - * @param classInfoTree the class content tree to which the signature will be added - */ - public void addClassSignature(String modifiers, Content classInfoTree); - - /** - * Build the class description. - * - * @param classInfoTree content tree to which the documentation will be added - */ - public void addClassDescription(Content classInfoTree); - - /** - * Add the tag information for the current class. - * - * @param classInfoTree content tree to which the tag information will be added - */ - public void addClassTagInfo(Content classInfoTree); - - /** - * Get the member tree header for the class. - * - * @return a content tree for the member tree header - */ - public Content getMemberTreeHeader(); - - /** - * Add the class content tree. - * - * @param contentTree content tree to which the class content will be added - * @param classContentTree class content tree which will be added to the content tree - */ - public void addClassContentTree(Content contentTree, Content classContentTree); - - /** - * Add the footer of the page. - * - * @param contentTree content tree to which the footer will be added - */ - public void addFooter(Content contentTree); - - /** - * Print the document. - * - * @param contentTree content tree that will be printed as a document - */ - public void printDocument(Content contentTree) throws IOException; - - /** - * Close the writer. - */ - public void close() throws IOException; - - /** - * Return the classDoc being documented. - * - * @return the classDoc being documented. - */ - public ClassDoc getClassDoc(); - - /** - * Get the member summary tree. - * - * @param memberTree the content tree used to build the summary tree - * @return a content tree for the member summary - */ - public Content getMemberSummaryTree(Content memberTree); - - /** - * Get the member details tree. - * - * @param memberTree the content tree used to build the details tree - * @return a content tree for the member details - */ - public Content getMemberDetailsTree(Content memberTree); -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java +++ /dev/null @@ -1,892 +0,0 @@ -/* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import javax.tools.JavaFileManager; -import javax.tools.JavaFileManager.Location; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.builders.BuilderFactory; -import com.sun.tools.doclets.internal.toolkit.taglets.*; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.javac.util.StringUtils; - -/** - * Configure the output based on the options. Doclets should sub-class - * Configuration, to configure and add their own options. This class contains - * all user options which are supported by the 1.1 doclet and the standard - * doclet. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Robert Field. - * @author Atul Dambalkar. - * @author Jamie Ho - */ -@Deprecated -public abstract class Configuration { - - /** - * Exception used to report a problem during setOptions. - */ - public static class Fault extends Exception { - private static final long serialVersionUID = 0; - - Fault(String msg) { - super(msg); - } - - Fault(String msg, Exception cause) { - super(msg, cause); - } - } - - /** - * The factory for builders. - */ - protected BuilderFactory builderFactory; - - /** - * The taglet manager. - */ - public TagletManager tagletManager; - - /** - * The path to the builder XML input file. - */ - public String builderXMLPath; - - /** - * The default path to the builder XML. - */ - private static final String DEFAULT_BUILDER_XML = "resources/doclet.xml"; - - /** - * The path to Taglets - */ - public String tagletpath = ""; - - /** - * This is true if option "-serialwarn" is used. Defualt value is false to - * suppress excessive warnings about serial tag. - */ - public boolean serialwarn = false; - - /** - * The specified amount of space between tab stops. - */ - public int sourcetab; - - public String tabSpaces; - - /** - * True if we should generate browsable sources. - */ - public boolean linksource = false; - - /** - * True if command line option "-nosince" is used. Default value is - * false. - */ - public boolean nosince = false; - - /** - * True if we should recursively copy the doc-file subdirectories - */ - public boolean copydocfilesubdirs = false; - - /** - * The META charset tag used for cross-platform viewing. - */ - public String charset = ""; - - /** - * True if user wants to add member names as meta keywords. - * Set to false because meta keywords are ignored in general - * by most Internet search engines. - */ - public boolean keywords = false; - - /** - * The meta tag keywords instance. - */ - public final MetaKeywords metakeywords; - - /** - * The list of doc-file subdirectories to exclude - */ - protected Set excludedDocFileDirs; - - /** - * The list of qualifiers to exclude - */ - protected Set excludedQualifiers; - - /** - * The Root of the generated Program Structure from the Doclet API. - */ - public RootDoc root; - - /** - * An utility class for commonly used helpers - */ - public Utils utils; - /** - * Destination directory name, in which doclet will generate the entire - * documentation. Default is current directory. - */ - public String destDirName = ""; - - /** - * Destination directory name, in which doclet will copy the doc-files to. - */ - public String docFileDestDirName = ""; - - /** - * Encoding for this document. Default is default encoding for this - * platform. - */ - public String docencoding = null; - - /** - * True if user wants to suppress descriptions and tags. - */ - public boolean nocomment = false; - - /** - * Encoding for this document. Default is default encoding for this - * platform. - */ - public String encoding = null; - - /** - * Generate author specific information for all the classes if @author - * tag is used in the doc comment and if -author option is used. - * showauthor is set to true if -author option is used. - * Default is don't show author information. - */ - public boolean showauthor = false; - - /** - * Generate documentation for JavaFX getters and setters automatically - * by copying it from the appropriate property definition. - */ - public boolean javafx = false; - - /** - * Generate version specific information for the all the classes - * if @version tag is used in the doc comment and if -version option is - * used. showversion is set to true if -version option is - * used.Default is don't show version information. - */ - public boolean showversion = false; - - /** - * Don't generate deprecated API information at all, if -nodeprecated - * option is used. nodepracted is set to true if - * -nodeprecated option is used. Default is generate deprected API - * information. - */ - public boolean nodeprecated = false; - - /** - * The catalog of classes specified on the command-line - */ - public ClassDocCatalog classDocCatalog; - - /** - * Message Retriever for the doclet, to retrieve message from the resource - * file for this Configuration, which is common for 1.1 and standard - * doclets. - * - * TODO: Make this private!!! - */ - public MessageRetriever message = null; - - /** - * True if user wants to suppress time stamp in output. - * Default is false. - */ - public boolean notimestamp= false; - - /** - * The package grouping instance. - */ - public final Group group = new Group(this); - - /** - * The tracker of external package links. - */ - public final Extern extern = new Extern(this); - - /** - * Return the build date for the doclet. - */ - public abstract String getDocletSpecificBuildDate(); - - /** - * This method should be defined in all those doclets(configurations), - * which want to derive themselves from this Configuration. This method - * can be used to set its own command line options. - * - * @param options The array of option names and values. - * @throws DocletAbortException - */ - public abstract void setSpecificDocletOptions(String[][] options) throws Fault; - - /** - * Return the doclet specific {@link MessageRetriever} - * @return the doclet specific MessageRetriever. - */ - public abstract MessageRetriever getDocletSpecificMsg(); - - /** - * A sorted set of packages specified on the command-line merged with a - * collection of packages that contain the classes specified on the - * command-line. - */ - public SortedSet packages; - - public boolean exportInternalAPI; - - /** - * Constructor. Constructs the message retriever with resource file. - */ - public Configuration() { - message = - new MessageRetriever(this, - "com.sun.tools.doclets.internal.toolkit.resources.doclets"); - excludedDocFileDirs = new HashSet<>(); - excludedQualifiers = new HashSet<>(); - setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH); - utils = new Utils(); - metakeywords = new MetaKeywords(this); - } - - /** - * Return the builder factory for this doclet. - * - * @return the builder factory for this doclet. - */ - public BuilderFactory getBuilderFactory() { - if (builderFactory == null) { - builderFactory = new BuilderFactory(this); - } - return builderFactory; - } - - /** - * This method should be defined in all those doclets - * which want to inherit from this Configuration. This method - * should return the number of arguments to the command line - * option (including the option name). For example, - * -notimestamp is a single-argument option, so this method would - * return 1. - * - * @param option Command line option under consideration. - * @return number of arguments to option (including the - * option name). Zero return means option not known. - * Negative value means error occurred. - */ - public int optionLength(String option) { - option = StringUtils.toLowerCase(option); - switch (option) { - case "-author": - case "-docfilessubdirs": - case "-javafx": - case "-keywords": - case "-linksource": - case "-nocomment": - case "-nodeprecated": - case "-nosince": - case "-notimestamp": - case "-quiet": - case "-xnodate": - case "-version": - case "-xdaccessinternalapi": - return 1; - case "-d": - case "-docencoding": - case "-encoding": - case "-excludedocfilessubdir": - case "-link": - case "-sourcetab": - case "-noqualifier": - case "-output": - case "-sourcepath": - case "-tag": - case "-taglet": - case "-tagletpath": - return 2; - case "-group": - case "-linkoffline": - return 3; - default: - return -1; // indicate we don't know about it - } - } - - /** - * Perform error checking on the given options. - * - * @param options the given options to check. - * @param reporter the reporter used to report errors. - */ - public abstract boolean validOptions(String options[][], - DocErrorReporter reporter); - - private void initPackages() { - packages = new TreeSet<>(Arrays.asList(root.specifiedPackages())); - for (ClassDoc aClass : root.specifiedClasses()) { - packages.add(aClass.containingPackage()); - } - } - - /** - * Set the command line options supported by this configuration. - * - * @param options the two dimensional array of options. - */ - public void setOptions(String[][] options) throws Fault { - LinkedHashSet customTagStrs = new LinkedHashSet<>(); - - // Some options, specifically -link and -linkoffline, require that - // the output directory has already been created: so do that first. - for (String[] os : options) { - String opt = StringUtils.toLowerCase(os[0]); - if (opt.equals("-d")) { - destDirName = addTrailingFileSep(os[1]); - docFileDestDirName = destDirName; - ensureOutputDirExists(); - break; - } - } - - for (String[] os : options) { - String opt = StringUtils.toLowerCase(os[0]); - if (opt.equals("-docfilessubdirs")) { - copydocfilesubdirs = true; - } else if (opt.equals("-docencoding")) { - docencoding = os[1]; - } else if (opt.equals("-encoding")) { - encoding = os[1]; - } else if (opt.equals("-author")) { - showauthor = true; - } else if (opt.equals("-javafx")) { - javafx = true; - } else if (opt.equals("-nosince")) { - nosince = true; - } else if (opt.equals("-version")) { - showversion = true; - } else if (opt.equals("-nodeprecated")) { - nodeprecated = true; - } else if (opt.equals("-excludedocfilessubdir")) { - addToSet(excludedDocFileDirs, os[1]); - } else if (opt.equals("-noqualifier")) { - addToSet(excludedQualifiers, os[1]); - } else if (opt.equals("-linksource")) { - linksource = true; - } else if (opt.equals("-sourcetab")) { - linksource = true; - try { - setTabWidth(Integer.parseInt(os[1])); - } catch (NumberFormatException e) { - //Set to -1 so that warning will be printed - //to indicate what is valid argument. - sourcetab = -1; - } - if (sourcetab <= 0) { - message.warning("doclet.sourcetab_warning"); - setTabWidth(DocletConstants.DEFAULT_TAB_STOP_LENGTH); - } - } else if (opt.equals("-notimestamp")) { - notimestamp = true; - } else if (opt.equals("-nocomment")) { - nocomment = true; - } else if (opt.equals("-tag") || opt.equals("-taglet")) { - customTagStrs.add(os); - } else if (opt.equals("-tagletpath")) { - tagletpath = os[1]; - } else if (opt.equals("-keywords")) { - keywords = true; - } else if (opt.equals("-serialwarn")) { - serialwarn = true; - } else if (opt.equals("-group")) { - group.checkPackageGroups(os[1], os[2]); - } else if (opt.equals("-link")) { - String url = os[1]; - extern.link(url, url, root, false); - } else if (opt.equals("-linkoffline")) { - String url = os[1]; - String pkglisturl = os[2]; - extern.link(url, pkglisturl, root, true); - } else if (opt.equals("-xdaccessinternalapi")) { - exportInternalAPI = true; - } - } - if (docencoding == null) { - docencoding = encoding; - } - - classDocCatalog = new ClassDocCatalog(root.specifiedClasses(), this); - initTagletManager(customTagStrs); - } - - /** - * Set the command line options supported by this configuration. - * - * @throws DocletAbortException - */ - public void setOptions() throws Fault { - initPackages(); - setOptions(root.options()); - setSpecificDocletOptions(root.options()); - } - - private void ensureOutputDirExists() throws Fault { - DocFile destDir = DocFile.createFileForDirectory(this, destDirName); - if (!destDir.exists()) { - //Create the output directory (in case it doesn't exist yet) - root.printNotice(getText("doclet.dest_dir_create", destDirName)); - destDir.mkdirs(); - } else if (!destDir.isDirectory()) { - throw new Fault(getText( - "doclet.destination_directory_not_directory_0", - destDir.getPath())); - } else if (!destDir.canWrite()) { - throw new Fault(getText( - "doclet.destination_directory_not_writable_0", - destDir.getPath())); - } - } - - - /** - * Initialize the taglet manager. The strings to initialize the simple custom tags should - * be in the following format: "[tag name]:[location str]:[heading]". - * @param customTagStrs the set two dimensional arrays of strings. These arrays contain - * either -tag or -taglet arguments. - */ - private void initTagletManager(Set customTagStrs) { - tagletManager = (tagletManager == null) - ? new TagletManager(nosince, showversion, showauthor, javafx, exportInternalAPI, message) - : tagletManager; - for (String[] args : customTagStrs) { - if (args[0].equals("-taglet")) { - tagletManager.addCustomTag(args[1], getFileManager(), tagletpath); - continue; - } - String[] tokens = tokenize(args[1], - TagletManager.SIMPLE_TAGLET_OPT_SEPARATOR, 3); - if (tokens.length == 1) { - String tagName = args[1]; - if (tagletManager.isKnownCustomTag(tagName)) { - //reorder a standard tag - tagletManager.addNewSimpleCustomTag(tagName, null, ""); - } else { - //Create a simple tag with the heading that has the same name as the tag. - StringBuilder heading = new StringBuilder(tagName + ":"); - heading.setCharAt(0, Character.toUpperCase(tagName.charAt(0))); - tagletManager.addNewSimpleCustomTag(tagName, heading.toString(), "a"); - } - } else if (tokens.length == 2) { - //Add simple taglet without heading, probably to excluding it in the output. - tagletManager.addNewSimpleCustomTag(tokens[0], tokens[1], ""); - } else if (tokens.length >= 3) { - tagletManager.addNewSimpleCustomTag(tokens[0], tokens[2], tokens[1]); - } else { - message.error("doclet.Error_invalid_custom_tag_argument", args[1]); - } - } - } - - /** - * Given a string, return an array of tokens. The separator can be escaped - * with the '\' character. The '\' character may also be escaped by the - * '\' character. - * - * @param s the string to tokenize. - * @param separator the separator char. - * @param maxTokens the maximum number of tokens returned. If the - * max is reached, the remaining part of s is appended - * to the end of the last token. - * - * @return an array of tokens. - */ - private String[] tokenize(String s, char separator, int maxTokens) { - List tokens = new ArrayList<>(); - StringBuilder token = new StringBuilder (); - boolean prevIsEscapeChar = false; - for (int i = 0; i < s.length(); i += Character.charCount(i)) { - int currentChar = s.codePointAt(i); - if (prevIsEscapeChar) { - // Case 1: escaped character - token.appendCodePoint(currentChar); - prevIsEscapeChar = false; - } else if (currentChar == separator && tokens.size() < maxTokens-1) { - // Case 2: separator - tokens.add(token.toString()); - token = new StringBuilder(); - } else if (currentChar == '\\') { - // Case 3: escape character - prevIsEscapeChar = true; - } else { - // Case 4: regular character - token.appendCodePoint(currentChar); - } - } - if (token.length() > 0) { - tokens.add(token.toString()); - } - return tokens.toArray(new String[] {}); - } - - private void addToSet(Set s, String str){ - StringTokenizer st = new StringTokenizer(str, ":"); - String current; - while(st.hasMoreTokens()){ - current = st.nextToken(); - s.add(current); - } - } - - /** - * Add a trailing file separator, if not found. Remove superfluous - * file separators if any. Preserve the front double file separator for - * UNC paths. - * - * @param path Path under consideration. - * @return String Properly constructed path string. - */ - public static String addTrailingFileSep(String path) { - String fs = System.getProperty("file.separator"); - String dblfs = fs + fs; - int indexDblfs; - while ((indexDblfs = path.indexOf(dblfs, 1)) >= 0) { - path = path.substring(0, indexDblfs) + - path.substring(indexDblfs + fs.length()); - } - if (!path.endsWith(fs)) - path += fs; - return path; - } - - /** - * This checks for the validity of the options used by the user. - * This works exactly like - * {@link com.sun.javadoc.Doclet#validOptions(String[][], - * DocErrorReporter)}. This will validate the options which are shared - * by our doclets. For example, this method will flag an error using - * the DocErrorReporter if user has used "-nohelp" and "-helpfile" option - * together. - * - * @param options options used on the command line. - * @param reporter used to report errors. - * @return true if all the options are valid. - */ - public boolean generalValidOptions(String options[][], - DocErrorReporter reporter) { - boolean docencodingfound = false; - String encoding = ""; - for (int oi = 0; oi < options.length; oi++) { - String[] os = options[oi]; - String opt = StringUtils.toLowerCase(os[0]); - if (opt.equals("-docencoding")) { - docencodingfound = true; - if (!checkOutputFileEncoding(os[1], reporter)) { - return false; - } - } else if (opt.equals("-encoding")) { - encoding = os[1]; - } - } - if (!docencodingfound && encoding.length() > 0) { - if (!checkOutputFileEncoding(encoding, reporter)) { - return false; - } - } - return true; - } - - /** - * Check the validity of the given Source or Output File encoding on this - * platform. - * - * @param docencoding output file encoding. - * @param reporter used to report errors. - */ - private boolean checkOutputFileEncoding(String docencoding, - DocErrorReporter reporter) { - OutputStream ost= new ByteArrayOutputStream(); - OutputStreamWriter osw = null; - try { - osw = new OutputStreamWriter(ost, docencoding); - } catch (UnsupportedEncodingException exc) { - reporter.printError(getText("doclet.Encoding_not_supported", - docencoding)); - return false; - } finally { - try { - if (osw != null) { - osw.close(); - } - } catch (IOException exc) { - } - } - return true; - } - - /** - * Return true if the given doc-file subdirectory should be excluded and - * false otherwise. - * @param docfilesubdir the doc-files subdirectory to check. - */ - public boolean shouldExcludeDocFileDir(String docfilesubdir){ - if (excludedDocFileDirs.contains(docfilesubdir)) { - return true; - } else { - return false; - } - } - - /** - * Return true if the given qualifier should be excluded and false otherwise. - * @param qualifier the qualifier to check. - */ - public boolean shouldExcludeQualifier(String qualifier){ - if (excludedQualifiers.contains("all") || - excludedQualifiers.contains(qualifier) || - excludedQualifiers.contains(qualifier + ".*")) { - return true; - } else { - int index = -1; - while ((index = qualifier.indexOf(".", index + 1)) != -1) { - if (excludedQualifiers.contains(qualifier.substring(0, index + 1) + "*")) { - return true; - } - } - return false; - } - } - - /** - * Return the qualified name of the ClassDoc if it's qualifier is not excluded. Otherwise, - * return the unqualified ClassDoc name. - * @param cd the ClassDoc to check. - */ - public String getClassName(ClassDoc cd) { - PackageDoc pd = cd.containingPackage(); - if (pd != null && shouldExcludeQualifier(cd.containingPackage().name())) { - return cd.name(); - } else { - return cd.qualifiedName(); - } - } - - public String getText(String key) { - // Check the doclet specific properties file. - MessageRetriever docletMessage = getDocletSpecificMsg(); - if (docletMessage.containsKey(key)) { - return docletMessage.getText(key); - } - // Check the shared properties file. - return message.getText(key); - } - - public String getText(String key, String a1) { - // Check the doclet specific properties file. - MessageRetriever docletMessage = getDocletSpecificMsg(); - if (docletMessage.containsKey(key)) { - return docletMessage.getText(key, a1); - } - // Check the shared properties file. - return message.getText(key, a1); - } - - public String getText(String key, String a1, String a2) { - // Check the doclet specific properties file. - MessageRetriever docletMessage = getDocletSpecificMsg(); - if (docletMessage.containsKey(key)) { - return docletMessage.getText(key, a1, a2); - } - // Check the shared properties file. - return message.getText(key, a1, a2); - } - - public String getText(String key, String a1, String a2, String a3) { - // Check the doclet specific properties file. - MessageRetriever docletMessage = getDocletSpecificMsg(); - if (docletMessage.containsKey(key)) { - return docletMessage.getText(key, a1, a2, a3); - } - // Check the shared properties file. - return message.getText(key, a1, a2, a3); - } - - public abstract Content newContent(); - - /** - * Get the configuration string as a content. - * - * @param key the key to look for in the configuration file - * @return a content tree for the text - */ - public Content getResource(String key) { - Content c = newContent(); - c.addContent(getText(key)); - return c; - } - - /** - * Get the configuration string as a content. - * - * @param key the key to look for in the configuration file - * @param o string or content argument added to configuration text - * @return a content tree for the text - */ - public Content getResource(String key, Object o) { - return getResource(key, o, null, null); - } - - /** - * Get the configuration string as a content. - * - * @param key the key to look for in the configuration file - * @param o string or content argument added to configuration text - * @return a content tree for the text - */ - public Content getResource(String key, Object o1, Object o2) { - return getResource(key, o1, o2, null); - } - - /** - * Get the configuration string as a content. - * - * @param key the key to look for in the configuration file - * @param o1 string or content argument added to configuration text - * @param o2 string or content argument added to configuration text - * @return a content tree for the text - */ - public Content getResource(String key, Object o0, Object o1, Object o2) { - Content c = newContent(); - Pattern p = Pattern.compile("\\{([012])\\}"); - String text = getText(key); - Matcher m = p.matcher(text); - int start = 0; - while (m.find(start)) { - c.addContent(text.substring(start, m.start())); - - Object o = null; - switch (m.group(1).charAt(0)) { - case '0': o = o0; break; - case '1': o = o1; break; - case '2': o = o2; break; - } - - if (o == null) { - c.addContent("{" + m.group(1) + "}"); - } else if (o instanceof String) { - c.addContent((String) o); - } else if (o instanceof Content) { - c.addContent((Content) o); - } - - start = m.end(); - } - - c.addContent(text.substring(start)); - return c; - } - - - /** - * Return true if the ClassDoc element is getting documented, depending upon - * -nodeprecated option and the deprecation information. Return true if - * -nodeprecated is not used. Return false if -nodeprecated is used and if - * either ClassDoc element is deprecated or the containing package is deprecated. - * - * @param cd the ClassDoc for which the page generation is checked - */ - public boolean isGeneratedDoc(ClassDoc cd) { - if (!nodeprecated) { - return true; - } - return !(utils.isDeprecated(cd) || utils.isDeprecated(cd.containingPackage())); - } - - /** - * Return the doclet specific instance of a writer factory. - * @return the {@link WriterFactory} for the doclet. - */ - public abstract WriterFactory getWriterFactory(); - - /** - * Return the input stream to the builder XML. - * - * @return the input steam to the builder XML. - * @throws FileNotFoundException when the given XML file cannot be found. - */ - public InputStream getBuilderXML() throws IOException { - return builderXMLPath == null ? - Configuration.class.getResourceAsStream(DEFAULT_BUILDER_XML) : - DocFile.createFileForInput(this, builderXMLPath).openInputStream(); - } - - /** - * Return the Locale for this document. - */ - public abstract Locale getLocale(); - - /** - * Return the current file manager. - */ - public abstract JavaFileManager getFileManager(); - - /** - * Return the comparator that will be used to sort member documentation. - * To no do any sorting, return null. - * - * @return the {@link java.util.Comparator} used to sort members. - */ - public abstract Comparator getMemberComparator(); - - private void setTabWidth(int n) { - sourcetab = n; - tabSpaces = String.format("%" + n + "s", ""); - } - - public abstract boolean showMessage(SourcePosition pos, String key); - - public abstract Location getLocationForPackage(PackageDoc pd); -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; - -/** - * The interface for writing constants summary output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface ConstantsSummaryWriter { - - /** - * Close the writer. - */ - public abstract void close() throws IOException; - - /** - * Get the header for the constant summary documentation. - * - * @return header that needs to be added to the documentation - */ - public abstract Content getHeader(); - - /** - * Get the header for the constant content list. - * - * @return content header that needs to be added to the documentation - */ - public abstract Content getContentsHeader(); - - /** - * Adds the given package name link to the constant content list tree. - * - * @param pkg the {@link PackageDoc} to index. - * @param parsedPackageName the parsed package name. We only Write the - * first 2 directory levels of the package - * name. For example, java.lang.ref would be - * indexed as java.lang.*. - * @param WriteedPackageHeaders the set of package headers that have already - * been indexed. We don't want to index - * something more than once. - * @param contentListTree the content tree to which the link will be added - */ - public abstract void addLinkToPackageContent(PackageDoc pkg, String parsedPackageName, - Set WriteedPackageHeaders, Content contentListTree); - - /** - * Add the content list to the documentation tree. - * - * @param contentTree the tree to which the contents list will be added - * @param contentListTree the content that will be added to the list - */ - public abstract void addContentsList(Content contentTree, Content contentListTree); - - /** - * Get the constant summaries for the document. - * - * @return constant summaries header to be added to the documentation tree - */ - public abstract Content getConstantSummaries(); - - /** - * Adds the given package name. - * - * @param parsedPackageName the parsed package name. We only Write the - * first 2 directory levels of the package - * name. For example, java.lang.ref would be - * indexed as java.lang.*. - * @param summariesTree the summaries documentation tree - * @param first true if the first package is listed - * be written - */ - public abstract void addPackageName(String parsedPackageName, Content summariesTree, boolean first); - - /** - * Get the class summary header for the constants summary. - * - * @return the header content for the class constants summary - */ - public abstract Content getClassConstantHeader(); - - /** - * Add the content list to the documentation summaries tree. - * - * @param summariesTree the tree to which the class constants list will be added - * @param classConstantTree the class constant tree that will be added to the list - */ - public abstract void addClassConstant(Content summariesTree, Content classConstantTree); - - /** - * Adds the constant member table to the documentation tree. - * - * @param cd the class whose constants are being documented. - * @param fields the constants being documented. - * @param classConstantTree the documentation tree to which theconstant member - * table content will be added - */ - public abstract void addConstantMembers(ClassDoc cd, List fields, - Content classConstantTree); - - /** - * Add the summaries list to the content tree. - * - * @param contentTree the tree to which the summaries list will be added - * @param summariesTree the summaries content tree that will be added to the list - */ - public abstract void addConstantSummaries(Content contentTree, Content summariesTree); - - /** - * Adds the footer for the summary documentation. - * - * @param contentTree content tree to which the footer will be added - */ - public abstract void addFooter(Content contentTree); - - /** - * Print the constants summary document. - * - * @param contentTree content tree which should be printed - */ - public abstract void printDocument(Content contentTree) throws IOException; - -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import com.sun.javadoc.*; - -/** - * The interface for writing constructor output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface ConstructorWriter { - - /** - * Get the constructor details tree header. - * - * @param classDoc the class being documented - * @param memberDetailsTree the content tree representing member details - * @return content tree for the constructor details header - */ - public Content getConstructorDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree); - - /** - * Get the constructor documentation tree header. - * - * @param constructor the constructor being documented - * @param constructorDetailsTree the content tree representing constructor details - * @return content tree for the constructor documentation header - */ - public Content getConstructorDocTreeHeader(ConstructorDoc constructor, - Content constructorDetailsTree); - - /** - * Get the signature for the given constructor. - * - * @param constructor the constructor being documented - * @return content tree for the constructor signature - */ - public Content getSignature(ConstructorDoc constructor); - - /** - * Add the deprecated output for the given constructor. - * - * @param constructor the constructor being documented - * @param constructorDocTree content tree to which the deprecated information will be added - */ - public void addDeprecated(ConstructorDoc constructor, Content constructorDocTree); - - /** - * Add the comments for the given constructor. - * - * @param constructor the constructor being documented - * @param constructorDocTree the content tree to which the comments will be added - */ - public void addComments(ConstructorDoc constructor, Content constructorDocTree); - - /** - * Add the tags for the given constructor. - * - * @param constructor the constructor being documented - * @param constructorDocTree the content tree to which the tags will be added - */ - public void addTags(ConstructorDoc constructor, Content constructorDocTree); - - /** - * Get the constructor details tree. - * - * @param memberDetailsTree the content tree representing member details - * @return content tree for the constructor details - */ - public Content getConstructorDetails(Content memberDetailsTree); - - /** - * Get the constructor documentation. - * - * @param constructorDocTree the content tree representing constructor documentation - * @param isLastContent true if the content to be added is the last content - * @return content tree for the constructor documentation - */ - public Content getConstructorDoc(Content constructorDocTree, boolean isLastContent); - - /** - * Let the writer know whether a non public constructor was found. - * - * @param foundNonPubConstructor true if we found a non public constructor. - */ - public void setFoundNonPubConstructor(boolean foundNonPubConstructor); - - /** - * Close the writer. - */ - public void close() throws IOException; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/Content.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; -import java.util.Objects; - -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * A class to create content for javadoc output pages. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - */ -@Deprecated -public abstract class Content { - - /** - * Returns a string representation of the content. - * - * @return string representation of the content - */ - @Override - public String toString() { - StringWriter out = new StringWriter(); - try { - write(out, true); - } catch (IOException e) { - // cannot happen from StringWriter - throw new DocletAbortException(e); - } - return out.toString(); - } - - /** - * Adds content to the existing content. - * - * @param content content that needs to be added - */ - public abstract void addContent(Content content); - - /** - * Adds a string content to the existing content. - * - * @param stringContent the string content to be added - */ - public abstract void addContent(String stringContent); - - /** - * Writes content to a writer. - * - */ - public abstract boolean write(Writer writer, boolean atNewline) throws IOException ; - - /** - * Returns true if the content is empty. - * - * @return true if no content to be displayed else return false - */ - public abstract boolean isEmpty(); - - /** - * Returns true if the content is valid. - * - * @return true if the content is valid else return false - */ - public boolean isValid() { - return !isEmpty(); - } - - /** - * Return the number of characters of plain text content in this object - * (optional operation.) - * @return the number of characters of plain text content in this - */ - public int charCount() { - return 0; - } - - /** - * Checks for null values. - * - * @param t reference type to check for null values - * @return the reference type if not null or else throws a null pointer exception - */ - protected static T nullCheck(T t) { - return Objects.requireNonNull(t); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import com.sun.javadoc.*; - -/** - * The interface for writing enum constant output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface EnumConstantWriter { - - /** - * Get the enum constants details tree header. - * - * @param classDoc the class being documented - * @param memberDetailsTree the content tree representing member details - * @return content tree for the enum constants details header - */ - public Content getEnumConstantsDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree); - - /** - * Get the enum constants documentation tree header. - * - * @param enumConstant the enum constant being documented - * @param enumConstantsDetailsTree the content tree representing enum constant details - * @return content tree for the enum constant documentation header - */ - public Content getEnumConstantsTreeHeader(FieldDoc enumConstant, - Content enumConstantsDetailsTree); - - /** - * Get the signature for the given enum constant. - * - * @param enumConstant the enum constant being documented - * @return content tree for the enum constant signature - */ - public Content getSignature(FieldDoc enumConstant); - - /** - * Add the deprecated output for the given enum constant. - * - * @param enumConstant the enum constant being documented - * @param enumConstantsTree content tree to which the deprecated information will be added - */ - public void addDeprecated(FieldDoc enumConstant, Content enumConstantsTree); - - /** - * Add the comments for the given enum constant. - * - * @param enumConstant the enum constant being documented - * @param enumConstantsTree the content tree to which the comments will be added - */ - public void addComments(FieldDoc enumConstant, Content enumConstantsTree); - - /** - * Add the tags for the given enum constant. - * - * @param enumConstant the enum constant being documented - * @param enumConstantsTree the content tree to which the tags will be added - */ - public void addTags(FieldDoc enumConstant, Content enumConstantsTree); - - /** - * Get the enum constants details tree. - * - * @param memberDetailsTree the content tree representing member details - * @return content tree for the enum constant details - */ - public Content getEnumConstantsDetails(Content memberDetailsTree); - - /** - * Get the enum constants documentation. - * - * @param enumConstantsTree the content tree representing enum constants documentation - * @param isLastContent true if the content to be added is the last content - * @return content tree for the enum constants documentation - */ - public Content getEnumConstants(Content enumConstantsTree, boolean isLastContent); - - /** - * Close the writer. - */ - public void close() throws IOException; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import com.sun.javadoc.*; - -/** - * The interface for writing field output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface FieldWriter { - - /** - * Get the field details tree header. - * - * @param classDoc the class being documented - * @param memberDetailsTree the content tree representing member details - * @return content tree for the field details header - */ - public Content getFieldDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree); - - /** - * Get the field documentation tree header. - * - * @param field the constructor being documented - * @param fieldDetailsTree the content tree representing field details - * @return content tree for the field documentation header - */ - public Content getFieldDocTreeHeader(FieldDoc field, - Content fieldDetailsTree); - - /** - * Get the signature for the given field. - * - * @param field the field being documented - * @return content tree for the field signature - */ - public Content getSignature(FieldDoc field); - - /** - * Add the deprecated output for the given field. - * - * @param field the field being documented - * @param fieldDocTree content tree to which the deprecated information will be added - */ - public void addDeprecated(FieldDoc field, Content fieldDocTree); - - /** - * Add the comments for the given field. - * - * @param field the field being documented - * @param fieldDocTree the content tree to which the comments will be added - */ - public void addComments(FieldDoc field, Content fieldDocTree); - - /** - * Add the tags for the given field. - * - * @param field the field being documented - * @param fieldDocTree the content tree to which the tags will be added - */ - public void addTags(FieldDoc field, Content fieldDocTree); - - /** - * Get the field details tree. - * - * @param memberDetailsTree the content tree representing member details - * @return content tree for the field details - */ - public Content getFieldDetails(Content memberDetailsTree); - - /** - * Get the field documentation. - * - * @param fieldDocTree the content tree representing field documentation - * @param isLastContent true if the content to be added is the last content - * @return content tree for the field documentation - */ - public Content getFieldDoc(Content fieldDocTree, boolean isLastContent); - - /** - * Close the writer. - */ - public void close() throws IOException; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import java.util.*; -import com.sun.javadoc.*; - -/** - * The interface for writing member summary output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface MemberSummaryWriter { - - /** - * Get the member summary header for the given class. - * - * @param classDoc the class the summary belongs to - * @param memberSummaryTree the content tree to which the member summary will be added - * @return a content tree for the member summary header - */ - public Content getMemberSummaryHeader(ClassDoc classDoc, - Content memberSummaryTree); - - /** - * Get the summary table for the given class. - * - * @param classDoc the class the summary table belongs to - * @param tableContents list of contents that will be added to the summary table - * @return a content tree for the member summary table - */ - public Content getSummaryTableTree(ClassDoc classDoc, - List tableContents); - - /** - * Add the member summary for the given class and member. - * - * @param classDoc the class the summary belongs to - * @param member the member that is documented - * @param firstSentenceTags the tags for the sentence being documented - * @param tableContents list of contents to which the summary will be added - * @param counter the counter for determining id and style for the table row - */ - public void addMemberSummary(ClassDoc classDoc, ProgramElementDoc member, - Tag[] firstSentenceTags, List tableContents, int counter); - - /** - * Get the inherited member summary header for the given class. - * - * @param classDoc the class the summary belongs to - * @return a content tree containing the inherited summary header - */ - public Content getInheritedSummaryHeader(ClassDoc classDoc); - - /** - * Add the inherited member summary for the given class and member. - * - * @param classDoc the class the inherited member belongs to - * @param member the inherited member that is being documented - * @param isFirst true if this is the first member in the list - * @param isLast true if this is the last member in the list - * @param linksTree the content tree to which the links will be added - */ - public void addInheritedMemberSummary(ClassDoc classDoc, - ProgramElementDoc member, boolean isFirst, boolean isLast, - Content linksTree); - - /** - * Get inherited summary links. - * - * @return a content tree containing the inherited summary links - */ - public Content getInheritedSummaryLinksTree(); - - /** - * Add the member tree to the member summary tree. - * - * @param memberSummaryTree the content tree representing the member summary - * @param memberTree the content tree representing the member - */ - public void addMemberTree(Content memberSummaryTree, Content memberTree); - - /** - * Get the member tree. - * - * @param memberTree the content tree representing the member - * @return a content tree for the member - */ - public Content getMemberTree(Content memberTree); - - /** - * Close the writer. - */ - public void close() throws IOException; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import com.sun.javadoc.*; - -/** - * The interface for writing method output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface MethodWriter { - - /** - * Get the method details tree header. - * - * @param classDoc the class being documented - * @param memberDetailsTree the content tree representing member details - * @return content tree for the method details header - */ - public Content getMethodDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree); - - /** - * Get the method documentation tree header. - * - * @param method the method being documented - * @param methodDetailsTree the content tree representing method details - * @return content tree for the method documentation header - */ - public Content getMethodDocTreeHeader(MethodDoc method, - Content methodDetailsTree); - - /** - * Get the signature for the given method. - * - * @param method the method being documented - * @return content tree for the method signature - */ - public Content getSignature(MethodDoc method); - - /** - * Add the deprecated output for the given method. - * - * @param method the method being documented - * @param methodDocTree content tree to which the deprecated information will be added - */ - public void addDeprecated(MethodDoc method, Content methodDocTree); - - /** - * Add the comments for the given method. - * - * @param holder the holder type (not erasure) of the method - * @param method the method being documented - * @param methodDocTree the content tree to which the comments will be added - */ - public void addComments(Type holder, MethodDoc method, Content methodDocTree); - - /** - * Add the tags for the given method. - * - * @param method the method being documented - * @param methodDocTree the content tree to which the tags will be added - */ - public void addTags(MethodDoc method, Content methodDocTree); - - /** - * Get the method details tree. - * - * @param methodDetailsTree the content tree representing method details - * @return content tree for the method details - */ - public Content getMethodDetails(Content methodDetailsTree); - - /** - * Get the method documentation. - * - * @param methodDocTree the content tree representing method documentation - * @param isLastContent true if the content to be added is the last content - * @return content tree for the method documentation - */ - public Content getMethodDoc(Content methodDocTree, boolean isLastContent); - - /** - * Close the writer. - */ - public void close() throws IOException; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; - -/** - * The interface for writing class output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface NestedClassWriter { - - /** - * Close the writer. - */ - public void close() throws IOException; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; - -import com.sun.javadoc.*; - -/** - * The interface for writing package summary output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ - -@Deprecated -public interface PackageSummaryWriter { - - /** - * Get the header for the summary. - * - * @param heading Package name. - * @return the header to be added to the content tree - */ - public abstract Content getPackageHeader(String heading); - - /** - * Get the header for the package content. - * - * @return a content tree for the package content header - */ - public abstract Content getContentHeader(); - - /** - * Get the header for the package summary. - * - * @return a content tree with the package summary header - */ - public abstract Content getSummaryHeader(); - - /** - * Adds the table of classes to the documentation tree. - * - * @param classes the array of classes to document. - * @param label the label for this table. - * @param tableSummary the summary string for the table - * @param tableHeader array of table headers - * @param summaryContentTree the content tree to which the summaries will be added - */ - public abstract void addClassesSummary(ClassDoc[] classes, String label, - String tableSummary, String[] tableHeader, Content summaryContentTree); - - /** - * Adds the package description from the "packages.html" file to the documentation - * tree. - * - * @param packageContentTree the content tree to which the package description - * will be added - */ - public abstract void addPackageDescription(Content packageContentTree); - - /** - * Adds the tag information from the "packages.html" file to the documentation - * tree. - * - * @param packageContentTree the content tree to which the package tags will - * be added - */ - public abstract void addPackageTags(Content packageContentTree); - - /** - * Adds the tag information from the "packages.html" or "package-info.java" file to the - * documentation tree. - * - * @param contentTree the content tree to which the package content tree will be added - * @param packageContentTree the package content tree to be added - */ - public abstract void addPackageContent(Content contentTree, Content packageContentTree); - - /** - * Adds the footer to the documentation tree. - * - * @param contentTree the tree to which the footer will be added - */ - public abstract void addPackageFooter(Content contentTree); - - /** - * Print the package summary document. - * - * @param contentTree the content tree that will be printed - */ - public abstract void printDocument(Content contentTree) throws IOException; - - /** - * Close the writer. - */ - public abstract void close() throws IOException; - -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/PropertyWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/PropertyWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/PropertyWriter.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; -import com.sun.javadoc.*; - -/** - * The interface for writing property output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.7 - */ - -@Deprecated -public interface PropertyWriter { - - /** - * Get the property details tree header. - * - * @param classDoc the class being documented - * @param memberDetailsTree the content tree representing member details - * @return content tree for the property details header - */ - public Content getPropertyDetailsTreeHeader(ClassDoc classDoc, - Content memberDetailsTree); - - /** - * Get the property documentation tree header. - * - * @param property the property being documented - * @param propertyDetailsTree the content tree representing property details - * @return content tree for the property documentation header - */ - public Content getPropertyDocTreeHeader(MethodDoc property, - Content propertyDetailsTree); - - /** - * Get the signature for the given property. - * - * @param property the property being documented - * @return content tree for the property signature - */ - public Content getSignature(MethodDoc property); - - /** - * Add the deprecated output for the given property. - * - * @param property the property being documented - * @param propertyDocTree content tree to which the deprecated information will be added - */ - public void addDeprecated(MethodDoc property, Content propertyDocTree); - - /** - * Add the comments for the given property. - * - * @param property the property being documented - * @param propertyDocTree the content tree to which the comments will be added - */ - public void addComments(MethodDoc property, Content propertyDocTree); - - /** - * Add the tags for the given property. - * - * @param property the property being documented - * @param propertyDocTree the content tree to which the tags will be added - */ - public void addTags(MethodDoc property, Content propertyDocTree); - - /** - * Get the property details tree. - * - * @param memberDetailsTree the content tree representing member details - * @return content tree for the property details - */ - public Content getPropertyDetails(Content memberDetailsTree); - - /** - * Get the property documentation. - * - * @param propertyDocTree the content tree representing property documentation - * @param isLastContent true if the content to be added is the last content - * @return content tree for the property documentation - */ - public Content getPropertyDoc(Content propertyDocTree, boolean isLastContent); - - /** - * Close the writer. - */ - public void close() throws IOException; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import java.io.*; - -import com.sun.javadoc.*; - -/** - * The interface for writing serialized form output. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @since 1.5 - */ - -@Deprecated -public interface SerializedFormWriter { - - /** - * Get the header. - * - * @param header the header to write. - * @return the header content tree - */ - public Content getHeader(String header); - - /** - * Get the serialized form summaries header. - * - * @return the serialized form summary header tree - */ - public Content getSerializedSummariesHeader(); - - /** - * Get the package serialized form header. - * - * @return the package serialized form header tree - */ - public Content getPackageSerializedHeader(); - - /** - * Add the serialized tree per package to the serialized summaries tree. - * - * @param serializedSummariesTree the serialized tree to which the package serialized tree will be added - * @param packageSerializedTree the serialized tree per package that needs to be added - */ - public void addPackageSerializedTree(Content serializedSummariesTree, Content packageSerializedTree); - - /** - * Get the given package header. - * - * @param packageName the package header to write - * @return a content tree for the package header - */ - public Content getPackageHeader(String packageName); - - /** - * Get the serialized class header. - * - * @return a content tree for the serialized class header - */ - public Content getClassSerializedHeader(); - - /** - * Get the heading for the serializable class. - * - * @param classDoc the class being processed - * @return a content tree for the class heading - */ - public Content getClassHeader(ClassDoc classDoc); - - /** - * Get the serial UID info header. - * - * @return a content tree for the serial uid info header - */ - public Content getSerialUIDInfoHeader(); - - /** - * Adds the serial UID info. - * - * @param header the header that will show up before the UID. - * @param serialUID the serial UID to print. - * @param serialUidTree the serial UID tree to which the content will be added. - */ - public void addSerialUIDInfo(String header, String serialUID, - Content serialUidTree); - - /** - * Get the class serialize content header. - * - * @return a content tree for the class serialize content header - */ - public Content getClassContentHeader(); - - /** - * Return an instance of a SerialFieldWriter. - * - * @return an instance of a SerialFieldWriter. - */ - public SerialFieldWriter getSerialFieldWriter(ClassDoc classDoc); - - /** - * Return an instance of a SerialMethodWriter. - * - * @return an instance of a SerialMethodWriter. - */ - public SerialMethodWriter getSerialMethodWriter(ClassDoc classDoc); - - /** - * Close the writer. - */ - public abstract void close() throws IOException; - - /** - * Get the serialized content. - * - * @param serializedTreeContent content for serialized data - * @return a content tree for serialized information - */ - public Content getSerializedContent(Content serializedTreeContent); - - /** - * Add the footer. - * - * @param serializedTree the serialized tree to be added - */ - public void addFooter(Content serializedTree); - - /** - * Print the serialized form document. - * - * @param serializedTree the content tree that will be printed - */ - public abstract void printDocument(Content serializedTree) throws IOException; - - /** - * Write the serialized form for a given field. - */ - public interface SerialFieldWriter { - - /** - * Get the serializable field header. - * - * @return serialized fields header content tree - */ - public Content getSerializableFieldsHeader(); - - /** - * Get the field content header. - * - * @param isLastContent true if this is the last content to be documented - * @return fields header content tree - */ - public Content getFieldsContentHeader(boolean isLastContent); - - /** - * Get the fields content. - * - * @param heading the heading to write. - * @param contentTree content tree to which the heading will be added - * @return serializable fields content tree - */ - public Content getSerializableFields(String heading, Content contentTree); - - /** - * Adds the deprecated information for this member. - * - * @param field the field to document. - * @param contentTree content tree to which the deprecated information will be added - */ - public void addMemberDeprecatedInfo(FieldDoc field, Content contentTree); - - /** - * Adds the description text for this member. - * - * @param field the field to document. - * @param contentTree content tree to which the member description will be added - */ - public void addMemberDescription(FieldDoc field, Content contentTree); - - /** - * Adds the description text for this member represented by the tag. - * - * @param serialFieldTag the field to document (represented by tag). - * @param contentTree content tree to which the member description will be added - */ - public void addMemberDescription(SerialFieldTag serialFieldTag, Content contentTree); - - /** - * Adds the tag information for this member. - * - * @param field the field to document. - * @param contentTree content tree to which the member tags will be added - */ - public void addMemberTags(FieldDoc field, Content contentTree); - - /** - * Adds the member header. - * - * @param fieldType the type of the field. - * @param fieldTypeStr the type of the field in string format. We will - * print this out if we can't link to the type. - * @param fieldDimensions the dimensions of the field. - * @param fieldName the name of the field. - * @param contentTree content tree to which the member header will be added - */ - public void addMemberHeader(ClassDoc fieldType, String fieldTypeStr, - String fieldDimensions, String fieldName, Content contentTree); - - /** - * Check to see if overview details should be printed. If - * nocomment option set or if there is no text to be printed - * for deprecation info, inline comment or tags, - * do not print overview details. - * - * @param field the field to check overview details for. - * @return true if overview details need to be printed - */ - public boolean shouldPrintOverview(FieldDoc field); - } - - /** - * Write the serialized form for a given field. - */ - public interface SerialMethodWriter { - - /** - * Get the serializable method header. - * - * @return serializable methods content tree - */ - public Content getSerializableMethodsHeader(); - - /** - * Get the method content header. - * - * @param isLastContent true if this is the last content to be documented - * @return methods content tree - */ - public Content getMethodsContentHeader(boolean isLastContent); - - /** - * Write the given heading. - * - * @param heading the heading to write - * @param serializableMethodTree content tree which will be added - * @return serializable methods content tree - */ - public Content getSerializableMethods(String heading, Content serializableMethodTree); - - /** - * Write a warning that no serializable methods exist. - * - * @param msg the warning to print - * @return no customization message tree - */ - public Content getNoCustomizationMsg(String msg); - - /** - * Adds the header. - * - * @param member the member to write the header for - * @param methodsContentTree content tree to which the header will be added - */ - public void addMemberHeader(MethodDoc member, Content methodsContentTree); - - /** - * Adds the deprecated information for this member. - * - * @param member the member to write the deprecated information for - * @param methodsContentTree content tree to which the deprecated - * information will be added - */ - public void addDeprecatedMemberInfo(MethodDoc member, Content methodsContentTree); - - /** - * Adds the description for this member. - * - * @param member the member to write the information for - * @param methodsContentTree content tree to which the member - * information will be added - */ - public void addMemberDescription(MethodDoc member, Content methodsContentTree); - - /** - * Adds the tag information for this member. - * - * @param member the member to write the tags information for - * @param methodsContentTree content tree to which the tags - * information will be added - */ - public void addMemberTags(MethodDoc member, Content methodsContentTree); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * The interface for a factory creates writers. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @since 1.4 - */ - -@Deprecated -public interface WriterFactory { - - /** - * Return the writer for the constant summary. - * - * @return the writer for the constant summary. Return null if this - * writer is not supported by the doclet. - */ - public abstract ConstantsSummaryWriter getConstantsSummaryWriter() - throws Exception; - - /** - * Return the writer for the package summary. - * - * @param packageDoc the package being documented. - * @param prevPkg the previous package that was documented. - * @param nextPkg the next package being documented. - * @return the writer for the package summary. Return null if this - * writer is not supported by the doclet. - */ - public abstract PackageSummaryWriter getPackageSummaryWriter(PackageDoc - packageDoc, PackageDoc prevPkg, PackageDoc nextPkg) - throws Exception; - - /** - * Return the writer for a class. - * - * @param classDoc the class being documented. - * @param prevClass the previous class that was documented. - * @param nextClass the next class being documented. - * @param classTree the class tree. - * @return the writer for the class. Return null if this - * writer is not supported by the doclet. - */ - public abstract ClassWriter getClassWriter(ClassDoc classDoc, - ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) - throws Exception; - - /** - * Return the writer for an annotation type. - * - * @param annotationType the type being documented. - * @param prevType the previous type that was documented. - * @param nextType the next type being documented. - * @return the writer for the annotation type. Return null if this - * writer is not supported by the doclet. - */ - public abstract AnnotationTypeWriter getAnnotationTypeWriter( - AnnotationTypeDoc annotationType, Type prevType, Type nextType) - throws Exception; - - /** - * Return the method writer for a given class. - * - * @param classWriter the writer for the class being documented. - * @return the method writer for the give class. Return null if this - * writer is not supported by the doclet. - */ - public abstract MethodWriter getMethodWriter(ClassWriter classWriter) - throws Exception; - - /** - * Return the annotation type field writer for a given annotation type. - * - * @param annotationTypeWriter the writer for the annotation type - * being documented. - * @return the member writer for the given annotation type. Return null if - * this writer is not supported by the doclet. - */ - public abstract AnnotationTypeFieldWriter - getAnnotationTypeFieldWriter( - AnnotationTypeWriter annotationTypeWriter) throws Exception; - - /** - * Return the annotation type optional member writer for a given annotation - * type. - * - * @param annotationTypeWriter the writer for the annotation type - * being documented. - * @return the member writer for the given annotation type. Return null if - * this writer is not supported by the doclet. - */ - public abstract AnnotationTypeOptionalMemberWriter - getAnnotationTypeOptionalMemberWriter( - AnnotationTypeWriter annotationTypeWriter) throws Exception; - - /** - * Return the annotation type required member writer for a given annotation type. - * - * @param annotationTypeWriter the writer for the annotation type - * being documented. - * @return the member writer for the given annotation type. Return null if - * this writer is not supported by the doclet. - */ - public abstract AnnotationTypeRequiredMemberWriter - getAnnotationTypeRequiredMemberWriter( - AnnotationTypeWriter annotationTypeWriter) throws Exception; - - /** - * Return the enum constant writer for a given class. - * - * @param classWriter the writer for the class being documented. - * @return the enum constant writer for the give class. Return null if this - * writer is not supported by the doclet. - */ - public abstract EnumConstantWriter getEnumConstantWriter( - ClassWriter classWriter) throws Exception; - - /** - * Return the field writer for a given class. - * - * @param classWriter the writer for the class being documented. - * @return the field writer for the give class. Return null if this - * writer is not supported by the doclet. - */ - public abstract FieldWriter getFieldWriter(ClassWriter classWriter) - throws Exception; - - /** - * Return the property writer for a given class. - * - * @param classWriter the writer for the class being documented. - * @return the property writer for the give class. Return null if this - * writer is not supported by the doclet. - */ - public abstract PropertyWriter getPropertyWriter(ClassWriter classWriter) - throws Exception; - - /** - * Return the constructor writer for a given class. - * - * @param classWriter the writer for the class being documented. - * @return the method writer for the give class. Return null if this - * writer is not supported by the doclet. - */ - public abstract ConstructorWriter getConstructorWriter( - ClassWriter classWriter) - throws Exception; - - /** - * Return the specified member summary writer for a given class. - * - * @param classWriter the writer for the class being documented. - * @param memberType the {@link VisibleMemberMap} member type indicating - * the type of member summary that should be returned. - * @return the summary writer for the give class. Return null if this - * writer is not supported by the doclet. - * - * @see VisibleMemberMap - * @throws IllegalArgumentException if memberType is unknown. - */ - public abstract MemberSummaryWriter getMemberSummaryWriter( - ClassWriter classWriter, int memberType) - throws Exception; - - /** - * Return the specified member summary writer for a given annotation type. - * - * @param annotationTypeWriter the writer for the annotation type being - * documented. - * @param memberType the {@link VisibleMemberMap} member type indicating - * the type of member summary that should be returned. - * @return the summary writer for the give class. Return null if this - * writer is not supported by the doclet. - * - * @see VisibleMemberMap - * @throws IllegalArgumentException if memberType is unknown. - */ - public abstract MemberSummaryWriter getMemberSummaryWriter( - AnnotationTypeWriter annotationTypeWriter, int memberType) - throws Exception; - - /** - * Return the writer for the serialized form. - * - * @return the writer for the serialized form. - */ - public SerializedFormWriter getSerializedFormWriter() throws Exception; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.io.*; -import java.lang.reflect.*; -import java.util.*; - -import com.sun.javadoc.PackageDoc; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * The superclass for all builders. A builder is a class that provides - * the structure and content of API documentation. A builder is completely - * doclet independent which means that any doclet can use builders to - * construct documentation, as long as it impelements the appropriate - * writer interfaces. For example, if a doclet wanted to use - * {@link ConstantsSummaryBuilder} to build a constant summary, all it has to - * do is implement the ConstantsSummaryWriter interface and pass it to the - * builder using a WriterFactory. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @since 1.5 - */ - -@Deprecated -public abstract class AbstractBuilder { - public static class Context { - /** - * The configuration used in this run of the doclet. - */ - final Configuration configuration; - - /** - * Keep track of which packages we have seen for - * efficiency purposes. We don't want to copy the - * doc files multiple times for a single package. - */ - final Set containingPackagesSeen; - - /** - * Shared parser for the builder XML file - */ - final LayoutParser layoutParser; - - Context(Configuration configuration, - Set containingPackagesSeen, - LayoutParser layoutParser) { - this.configuration = configuration; - this.containingPackagesSeen = containingPackagesSeen; - this.layoutParser = layoutParser; - } - } - - /** - * The configuration used in this run of the doclet. - */ - protected final Configuration configuration; - - protected final Utils utils; - - /** - * Keep track of which packages we have seen for - * efficiency purposes. We don't want to copy the - * doc files multiple times for a single package. - */ - protected final Set containingPackagesSeen; - - protected final LayoutParser layoutParser; - - /** - * True if we want to print debug output. - */ - protected static final boolean DEBUG = false; - - /** - * Construct a Builder. - * @param configuration the configuration used in this run - * of the doclet. - */ - public AbstractBuilder(Context c) { - this.configuration = c.configuration; - this.utils = configuration.utils; - this.containingPackagesSeen = c.containingPackagesSeen; - this.layoutParser = c.layoutParser; - } - - /** - * Return the name of this builder. - * - * @return the name of the builder. - */ - public abstract String getName(); - - /** - * Build the documentation. - * - * @throws IOException if there is a problem writing the output - */ - public abstract void build() throws IOException; - - /** - * Build the documentation, as specified by the given XML element. - * - * @param node the XML element that specifies which component to document. - * @param contentTree content tree to which the documentation will be added - */ - protected void build(XMLNode node, Content contentTree) { - String component = node.name; - try { - invokeMethod("build" + component, - new Class[]{XMLNode.class, Content.class}, - new Object[]{node, contentTree}); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - configuration.root.printError("Unknown element: " + component); - throw new DocletAbortException(e); - } catch (InvocationTargetException e) { - Throwable cause = e.getCause(); - if (cause instanceof FatalError) { - throw (FatalError) cause; - } else if (cause instanceof DocletAbortException) { - throw (DocletAbortException) cause; - } else { - throw new DocletAbortException(cause); - } - } catch (Exception e) { - e.printStackTrace(); - configuration.root.printError("Exception " + - e.getClass().getName() + - " thrown while processing element: " + component); - throw new DocletAbortException(e); - } - } - - /** - * Build the documentation, as specified by the children of the given XML element. - * - * @param node the XML element that specifies which components to document. - * @param contentTree content tree to which the documentation will be added - */ - protected void buildChildren(XMLNode node, Content contentTree) { - for (XMLNode child : node.children) - build(child, contentTree); - } - - /** - * Given the name and parameters, invoke the method in the builder. This - * method is required to invoke the appropriate build method as instructed - * by the builder XML file. - * - * @param methodName the name of the method that we would like to invoke. - * @param paramClasses the types for each parameter. - * @param params the parameters of the method. - */ - protected void invokeMethod(String methodName, Class[] paramClasses, - Object[] params) - throws Exception { - if (DEBUG) { - configuration.root.printError("DEBUG: " + this.getClass().getName() + "." + methodName); - } - Method method = this.getClass().getMethod(methodName, paramClasses); - method.invoke(this, params); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.Set; - -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * The superclass for all member builders. Member builders are only executed - * within Class Builders. They essentially build sub-components. For example, - * method documentation is a sub-component of class documentation. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @since 1.5 - */ -@Deprecated -public abstract class AbstractMemberBuilder extends AbstractBuilder { - - /** - * Construct a SubBuilder. - * @param configuration the configuration used in this run - * of the doclet. - */ - public AbstractMemberBuilder(Context context) { - super(context); - } - - /** - * This method is not supported by sub-builders. - * - * @throws DocletAbortException this method will always throw a - * DocletAbortException because it is not supported. - */ - public void build() throws DocletAbortException { - //You may not call the build method in a subbuilder. - throw new DocletAbortException("not supported"); - } - - - /** - * Build the sub component if there is anything to document. - * - * @param node the XML element that specifies which components to document. - * @param contentTree content tree to which the documentation will be added - */ - @Override - public void build(XMLNode node, Content contentTree) { - if (hasMembersToDocument()) { - super.build(node, contentTree); - } - } - - /** - * Return true if this subbuilder has anything to document. - * - * @return true if this subbuilder has anything to document. - */ - public abstract boolean hasMembersToDocument(); -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; - -/** - * Builds the summary for a given annotation type. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class AnnotationTypeBuilder extends AbstractBuilder { - - /** - * The root element of the annotation type XML is {@value}. - */ - public static final String ROOT = "AnnotationTypeDoc"; - - /** - * The annotation type being documented. - */ - private final AnnotationTypeDoc annotationTypeDoc; - - /** - * The doclet specific writer. - */ - private final AnnotationTypeWriter writer; - - /** - * The content tree for the annotation documentation. - */ - private Content contentTree; - - /** - * Construct a new ClassBuilder. - * - * @param context the build context. - * @param annotationTypeDoc the class being documented. - * @param writer the doclet specific writer. - */ - private AnnotationTypeBuilder(Context context, - AnnotationTypeDoc annotationTypeDoc, - AnnotationTypeWriter writer) { - super(context); - this.annotationTypeDoc = annotationTypeDoc; - this.writer = writer; - } - - /** - * Construct a new ClassBuilder. - * - * @param context the build context. - * @param annotationTypeDoc the class being documented. - * @param writer the doclet specific writer. - */ - public static AnnotationTypeBuilder getInstance(Context context, - AnnotationTypeDoc annotationTypeDoc, - AnnotationTypeWriter writer) - throws Exception { - return new AnnotationTypeBuilder(context, annotationTypeDoc, writer); - } - - /** - * {@inheritDoc} - */ - public void build() throws IOException { - build(layoutParser.parseXML(ROOT), contentTree); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return ROOT; - } - - /** - * Build the annotation type documentation. - * - * @param node the XML element that specifies which components to document - * @param contentTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeDoc(XMLNode node, Content contentTree) throws Exception { - contentTree = writer.getHeader(configuration.getText("doclet.AnnotationType") + - " " + annotationTypeDoc.name()); - Content annotationContentTree = writer.getAnnotationContentHeader(); - buildChildren(node, annotationContentTree); - writer.addAnnotationContentTree(contentTree, annotationContentTree); - writer.addFooter(contentTree); - writer.printDocument(contentTree); - writer.close(); - copyDocFiles(); - } - - /** - * Copy the doc files for the current ClassDoc if necessary. - */ - private void copyDocFiles() { - PackageDoc containingPackage = annotationTypeDoc.containingPackage(); - if((configuration.packages == null || - !configuration.packages.contains(containingPackage) && - !containingPackagesSeen.contains(containingPackage))){ - //Only copy doc files dir if the containing package is not - //documented AND if we have not documented a class from the same - //package already. Otherwise, we are making duplicate copies. - utils.copyDocFiles(configuration, containingPackage); - containingPackagesSeen.add(containingPackage); - } - } - - /** - * Build the annotation information tree documentation. - * - * @param node the XML element that specifies which components to document - * @param annotationContentTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeInfo(XMLNode node, Content annotationContentTree) { - Content annotationInfoTree = writer.getAnnotationInfoTreeHeader(); - buildChildren(node, annotationInfoTree); - annotationContentTree.addContent(writer.getAnnotationInfo(annotationInfoTree)); - } - - /** - * If this annotation is deprecated, build the appropriate information. - * - * @param node the XML element that specifies which components to document - * @param annotationInfoTree the content tree to which the documentation will be added - */ - public void buildDeprecationInfo (XMLNode node, Content annotationInfoTree) { - writer.addAnnotationTypeDeprecationInfo(annotationInfoTree); - } - - /** - * Build the signature of the current annotation type. - * - * @param node the XML element that specifies which components to document - * @param annotationInfoTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeSignature(XMLNode node, Content annotationInfoTree) { - StringBuilder modifiers = new StringBuilder( - annotationTypeDoc.modifiers() + " "); - writer.addAnnotationTypeSignature(utils.replaceText( - modifiers.toString(), "interface", "@interface"), annotationInfoTree); - } - - /** - * Build the annotation type description. - * - * @param node the XML element that specifies which components to document - * @param annotationInfoTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeDescription(XMLNode node, Content annotationInfoTree) { - writer.addAnnotationTypeDescription(annotationInfoTree); - } - - /** - * Build the tag information for the current annotation type. - * - * @param node the XML element that specifies which components to document - * @param annotationInfoTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeTagInfo(XMLNode node, Content annotationInfoTree) { - writer.addAnnotationTypeTagInfo(annotationInfoTree); - } - - /** - * Build the member summary contents of the page. - * - * @param node the XML element that specifies which components to document - * @param annotationContentTree the content tree to which the documentation will be added - */ - public void buildMemberSummary(XMLNode node, Content annotationContentTree) - throws Exception { - Content memberSummaryTree = writer.getMemberTreeHeader(); - configuration.getBuilderFactory(). - getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree); - annotationContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); - } - - /** - * Build the member details contents of the page. - * - * @param node the XML element that specifies which components to document - * @param annotationContentTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeMemberDetails(XMLNode node, Content annotationContentTree) { - Content memberDetailsTree = writer.getMemberTreeHeader(); - buildChildren(node, memberDetailsTree); - if (memberDetailsTree.isValid()) { - annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); - } - } - - /** - * Build the annotation type field documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeFieldDetails(XMLNode node, Content memberDetailsTree) - throws Exception { - configuration.getBuilderFactory(). - getAnnotationTypeFieldsBuilder(writer).buildChildren(node, memberDetailsTree); - } - - /** - * Build the annotation type optional member documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeOptionalMemberDetails(XMLNode node, Content memberDetailsTree) - throws Exception { - configuration.getBuilderFactory(). - getAnnotationTypeOptionalMemberBuilder(writer).buildChildren(node, memberDetailsTree); - } - - /** - * Build the annotation type required member documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeRequiredMemberDetails(XMLNode node, Content memberDetailsTree) - throws Exception { - configuration.getBuilderFactory(). - getAnnotationTypeRequiredMemberBuilder(writer).buildChildren(node, memberDetailsTree); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeFieldBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeFieldBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeFieldBuilder.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Builds documentation for annotation type fields. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Bhavesh Patel - * @since 1.8 - */ -@Deprecated -public class AnnotationTypeFieldBuilder extends AbstractMemberBuilder { - - /** - * The annotation type whose members are being documented. - */ - protected ClassDoc classDoc; - - /** - * The visible members for the given class. - */ - protected VisibleMemberMap visibleMemberMap; - - /** - * The writer to output the member documentation. - */ - protected AnnotationTypeFieldWriter writer; - - /** - * The list of members being documented. - */ - protected List members; - - /** - * The index of the current member that is being documented at this point - * in time. - */ - protected int currentMemberIndex; - - /** - * Construct a new AnnotationTypeFieldsBuilder. - * - * @param context the build context. - * @param classDoc the class whose members are being documented. - * @param writer the doclet specific writer. - * @param memberType the type of member that is being documented. - */ - protected AnnotationTypeFieldBuilder(Context context, - ClassDoc classDoc, - AnnotationTypeFieldWriter writer, - int memberType) { - super(context); - this.classDoc = classDoc; - this.writer = writer; - this.visibleMemberMap = new VisibleMemberMap(classDoc, memberType, - configuration); - this.members = new ArrayList<>(this.visibleMemberMap.getMembersFor(classDoc)); - if (configuration.getMemberComparator() != null) { - Collections.sort(this.members, configuration.getMemberComparator()); - } - } - - - /** - * Construct a new AnnotationTypeFieldBuilder. - * - * @param context the build context. - * @param classDoc the class whose members are being documented. - * @param writer the doclet specific writer. - */ - public static AnnotationTypeFieldBuilder getInstance( - Context context, ClassDoc classDoc, - AnnotationTypeFieldWriter writer) { - return new AnnotationTypeFieldBuilder(context, classDoc, - writer, VisibleMemberMap.ANNOTATION_TYPE_FIELDS); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return "AnnotationTypeFieldDetails"; - } - - /** - * Returns a list of members that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @return a list of members that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Returns the visible member map for the members of this class. - * - * @return the visible member map for the members of this class. - */ - public VisibleMemberMap getVisibleMemberMap() { - return visibleMemberMap; - } - - /** - * summaryOrder.size() - */ - public boolean hasMembersToDocument() { - return members.size() > 0; - } - - /** - * Build the annotation type field documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeField(XMLNode node, Content memberDetailsTree) { - buildAnnotationTypeMember(node, memberDetailsTree); - } - - /** - * Build the member documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) { - if (writer == null) { - return; - } - int size = members.size(); - if (size > 0) { - writer.addAnnotationFieldDetailsMarker(memberDetailsTree); - for (currentMemberIndex = 0; currentMemberIndex < size; - currentMemberIndex++) { - Content detailsTree = writer.getMemberTreeHeader(); - writer.addAnnotationDetailsTreeHeader(classDoc, detailsTree); - Content annotationDocTree = writer.getAnnotationDocTreeHeader( - (MemberDoc) members.get(currentMemberIndex), - detailsTree); - buildChildren(node, annotationDocTree); - detailsTree.addContent(writer.getAnnotationDoc( - annotationDocTree, (currentMemberIndex == size - 1))); - memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree)); - } - } - } - - /** - * Build the signature. - * - * @param node the XML element that specifies which components to document - * @param annotationDocTree the content tree to which the documentation will be added - */ - public void buildSignature(XMLNode node, Content annotationDocTree) { - annotationDocTree.addContent( - writer.getSignature((MemberDoc) members.get(currentMemberIndex))); - } - - /** - * Build the deprecation information. - * - * @param node the XML element that specifies which components to document - * @param annotationDocTree the content tree to which the documentation will be added - */ - public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) { - writer.addDeprecated((MemberDoc) members.get(currentMemberIndex), - annotationDocTree); - } - - /** - * Build the comments for the member. Do nothing if - * {@link Configuration#nocomment} is set to true. - * - * @param node the XML element that specifies which components to document - * @param annotationDocTree the content tree to which the documentation will be added - */ - public void buildMemberComments(XMLNode node, Content annotationDocTree) { - if(! configuration.nocomment){ - writer.addComments((MemberDoc) members.get(currentMemberIndex), - annotationDocTree); - } - } - - /** - * Build the tag information. - * - * @param node the XML element that specifies which components to document - * @param annotationDocTree the content tree to which the documentation will be added - */ - public void buildTagInfo(XMLNode node, Content annotationDocTree) { - writer.addTags((MemberDoc) members.get(currentMemberIndex), - annotationDocTree); - } - - /** - * Return the annotation type field writer for this builder. - * - * @return the annotation type field writer for this builder. - */ - public AnnotationTypeFieldWriter getWriter() { - return writer; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Builds documentation for optional annotation type members. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class AnnotationTypeOptionalMemberBuilder extends - AnnotationTypeRequiredMemberBuilder { - - - /** - * Construct a new AnnotationTypeMemberBuilder. - * - * @param context the build context. - * @param classDoc the class whose members are being documented. - * @param writer the doclet specific writer. - */ - private AnnotationTypeOptionalMemberBuilder(Context context, - ClassDoc classDoc, - AnnotationTypeOptionalMemberWriter writer) { - super(context, classDoc, writer, - VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL); - } - - - /** - * Construct a new AnnotationTypeMemberBuilder. - * - * @param context the build context. - * @param classDoc the class whose members are being documented. - * @param writer the doclet specific writer. - */ - public static AnnotationTypeOptionalMemberBuilder getInstance( - Context context, ClassDoc classDoc, - AnnotationTypeOptionalMemberWriter writer) { - return new AnnotationTypeOptionalMemberBuilder(context, - classDoc, writer); - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "AnnotationTypeOptionalMemberDetails"; - } - - /** - * Build the annotation type optional member documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeOptionalMember(XMLNode node, Content memberDetailsTree) { - buildAnnotationTypeMember(node, memberDetailsTree); - } - - /** - * Build the default value for this optional member. - * - * @param node the XML element that specifies which components to document - * @param annotationDocTree the content tree to which the documentation will be added - */ - public void buildDefaultValueInfo(XMLNode node, Content annotationDocTree) { - ((AnnotationTypeOptionalMemberWriter) writer).addDefaultValueInfo( - (MemberDoc) members.get(currentMemberIndex), - annotationDocTree); - } - - /** - * {@inheritDoc} - */ - @Override - public AnnotationTypeRequiredMemberWriter getWriter() { - return writer; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Builds documentation for required annotation type members. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { - - /** - * The annotation type whose members are being documented. - */ - protected ClassDoc classDoc; - - /** - * The visible members for the given class. - */ - protected VisibleMemberMap visibleMemberMap; - - /** - * The writer to output the member documentation. - */ - protected AnnotationTypeRequiredMemberWriter writer; - - /** - * The list of members being documented. - */ - protected List members; - - /** - * The index of the current member that is being documented at this point - * in time. - */ - protected int currentMemberIndex; - - /** - * Construct a new AnnotationTypeRequiredMemberBuilder. - * - * @param context the build context. - * @param classDoc the class whose members are being documented. - * @param writer the doclet specific writer. - */ - protected AnnotationTypeRequiredMemberBuilder(Context context, - ClassDoc classDoc, - AnnotationTypeRequiredMemberWriter writer, - int memberType) { - super(context); - this.classDoc = classDoc; - this.writer = writer; - this.visibleMemberMap = new VisibleMemberMap(classDoc, memberType, - configuration); - this.members = new ArrayList<>(this.visibleMemberMap.getMembersFor(classDoc)); - if (configuration.getMemberComparator() != null) { - Collections.sort(this.members, configuration.getMemberComparator()); - } - } - - - /** - * Construct a new AnnotationTypeMemberBuilder. - * - * @param context the build context. - * @param classDoc the class whose members are being documented. - * @param writer the doclet specific writer. - */ - public static AnnotationTypeRequiredMemberBuilder getInstance( - Context context, ClassDoc classDoc, - AnnotationTypeRequiredMemberWriter writer) { - return new AnnotationTypeRequiredMemberBuilder(context, classDoc, - writer, - VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return "AnnotationTypeRequiredMemberDetails"; - } - - /** - * Returns a list of members that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @return a list of members that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Returns the visible member map for the members of this class. - * - * @return the visible member map for the members of this class. - */ - public VisibleMemberMap getVisibleMemberMap() { - return visibleMemberMap; - } - - /** - * summaryOrder.size() - */ - public boolean hasMembersToDocument() { - return members.size() > 0; - } - - /** - * Build the annotation type required member documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeRequiredMember(XMLNode node, Content memberDetailsTree) { - buildAnnotationTypeMember(node, memberDetailsTree); - } - - /** - * Build the member documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeMember(XMLNode node, Content memberDetailsTree) { - if (writer == null) { - return; - } - int size = members.size(); - if (size > 0) { - writer.addAnnotationDetailsMarker(memberDetailsTree); - for (currentMemberIndex = 0; currentMemberIndex < size; - currentMemberIndex++) { - Content detailsTree = writer.getMemberTreeHeader(); - writer.addAnnotationDetailsTreeHeader(classDoc, detailsTree); - Content annotationDocTree = writer.getAnnotationDocTreeHeader( - (MemberDoc) members.get(currentMemberIndex), detailsTree); - buildChildren(node, annotationDocTree); - detailsTree.addContent(writer.getAnnotationDoc( - annotationDocTree, (currentMemberIndex == size - 1))); - memberDetailsTree.addContent(writer.getAnnotationDetails(detailsTree)); - } - } - } - - /** - * Build the signature. - * - * @param node the XML element that specifies which components to document - * @param annotationDocTree the content tree to which the documentation will be added - */ - public void buildSignature(XMLNode node, Content annotationDocTree) { - annotationDocTree.addContent( - writer.getSignature((MemberDoc) members.get(currentMemberIndex))); - } - - /** - * Build the deprecation information. - * - * @param node the XML element that specifies which components to document - * @param annotationDocTree the content tree to which the documentation will be added - */ - public void buildDeprecationInfo(XMLNode node, Content annotationDocTree) { - writer.addDeprecated((MemberDoc) members.get(currentMemberIndex), - annotationDocTree); - } - - /** - * Build the comments for the member. Do nothing if - * {@link Configuration#nocomment} is set to true. - * - * @param node the XML element that specifies which components to document - * @param annotationDocTree the content tree to which the documentation will be added - */ - public void buildMemberComments(XMLNode node, Content annotationDocTree) { - if(! configuration.nocomment){ - writer.addComments((MemberDoc) members.get(currentMemberIndex), - annotationDocTree); - } - } - - /** - * Build the tag information. - * - * @param node the XML element that specifies which components to document - * @param annotationDocTree the content tree to which the documentation will be added - */ - public void buildTagInfo(XMLNode node, Content annotationDocTree) { - writer.addTags((MemberDoc) members.get(currentMemberIndex), - annotationDocTree); - } - - /** - * Return the annotation type required member writer for this builder. - * - * @return the annotation type required member constant writer for this - * builder. - */ - public AnnotationTypeRequiredMemberWriter getWriter() { - return writer; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.HashSet; -import java.util.Set; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * The factory for constructing builders. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @since 1.4 - */ - -@Deprecated -public class BuilderFactory { - - /** - * The current configuration of the doclet. - */ - private final Configuration configuration; - - /** - * The factory to retrieve the required writers from. - */ - private final WriterFactory writerFactory; - - private final AbstractBuilder.Context context; - - /** - * Construct a builder factory using the given configuration. - * @param configuration the configuration for the current doclet - * being executed. - */ - public BuilderFactory (Configuration configuration) { - this.configuration = configuration; - this.writerFactory = configuration.getWriterFactory(); - - Set containingPackagesSeen = new HashSet<>(); - context = new AbstractBuilder.Context(configuration, containingPackagesSeen, - LayoutParser.getInstance(configuration)); - } - - /** - * Return the builder that builds the constant summary. - * @return the builder that builds the constant summary. - */ - public AbstractBuilder getConstantsSummaryBuider() throws Exception { - return ConstantsSummaryBuilder.getInstance(context, - writerFactory.getConstantsSummaryWriter()); - } - - /** - * Return the builder that builds the package summary. - * - * @param pkg the package being documented. - * @param prevPkg the previous package being documented. - * @param nextPkg the next package being documented. - * @return the builder that builds the constant summary. - */ - public AbstractBuilder getPackageSummaryBuilder(PackageDoc pkg, PackageDoc prevPkg, - PackageDoc nextPkg) throws Exception { - return PackageSummaryBuilder.getInstance(context, pkg, - writerFactory.getPackageSummaryWriter(pkg, prevPkg, nextPkg)); - } - - /** - * Return the builder for the class. - * - * @param classDoc the class being documented. - * @param prevClass the previous class that was documented. - * @param nextClass the next class being documented. - * @param classTree the class tree. - * @return the writer for the class. Return null if this - * writer is not supported by the doclet. - */ - public AbstractBuilder getClassBuilder(ClassDoc classDoc, - ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) - throws Exception { - return ClassBuilder.getInstance(context, classDoc, - writerFactory.getClassWriter(classDoc, prevClass, nextClass, - classTree)); - } - - /** - * Return the builder for the annotation type. - * - * @param annotationType the annotation type being documented. - * @param prevType the previous type that was documented. - * @param nextType the next type being documented. - * @return the writer for the annotation type. Return null if this - * writer is not supported by the doclet. - */ - public AbstractBuilder getAnnotationTypeBuilder( - AnnotationTypeDoc annotationType, - Type prevType, Type nextType) - throws Exception { - return AnnotationTypeBuilder.getInstance(context, annotationType, - writerFactory.getAnnotationTypeWriter(annotationType, prevType, nextType)); - } - - /** - * Return an instance of the method builder for the given class. - * - * @return an instance of the method builder for the given class. - */ - public AbstractBuilder getMethodBuilder(ClassWriter classWriter) - throws Exception { - return MethodBuilder.getInstance(context, - classWriter.getClassDoc(), - writerFactory.getMethodWriter(classWriter)); - } - - /** - * Return an instance of the annotation type fields builder for the given - * class. - * - * @return an instance of the annotation type field builder for the given - * annotation type. - */ - public AbstractBuilder getAnnotationTypeFieldsBuilder( - AnnotationTypeWriter annotationTypeWriter) - throws Exception { - return AnnotationTypeFieldBuilder.getInstance(context, - annotationTypeWriter.getAnnotationTypeDoc(), - writerFactory.getAnnotationTypeFieldWriter( - annotationTypeWriter)); - } - - /** - * Return an instance of the annotation type member builder for the given - * class. - * - * @return an instance of the annotation type member builder for the given - * annotation type. - */ - public AbstractBuilder getAnnotationTypeOptionalMemberBuilder( - AnnotationTypeWriter annotationTypeWriter) - throws Exception { - return AnnotationTypeOptionalMemberBuilder.getInstance(context, - annotationTypeWriter.getAnnotationTypeDoc(), - writerFactory.getAnnotationTypeOptionalMemberWriter( - annotationTypeWriter)); - } - - /** - * Return an instance of the annotation type member builder for the given - * class. - * - * @return an instance of the annotation type member builder for the given - * annotation type. - */ - public AbstractBuilder getAnnotationTypeRequiredMemberBuilder( - AnnotationTypeWriter annotationTypeWriter) - throws Exception { - return AnnotationTypeRequiredMemberBuilder.getInstance(context, - annotationTypeWriter.getAnnotationTypeDoc(), - writerFactory.getAnnotationTypeRequiredMemberWriter( - annotationTypeWriter)); - } - - /** - * Return an instance of the enum constants builder for the given class. - * - * @return an instance of the enum constants builder for the given class. - */ - public AbstractBuilder getEnumConstantsBuilder(ClassWriter classWriter) - throws Exception { - return EnumConstantBuilder.getInstance(context, classWriter.getClassDoc(), - writerFactory.getEnumConstantWriter(classWriter)); - } - - /** - * Return an instance of the field builder for the given class. - * - * @return an instance of the field builder for the given class. - */ - public AbstractBuilder getFieldBuilder(ClassWriter classWriter) - throws Exception { - return FieldBuilder.getInstance(context, classWriter.getClassDoc(), - writerFactory.getFieldWriter(classWriter)); - } - - /** - * Return an instance of the property builder for the given class. - * - * @return an instance of the field builder for the given class. - */ - public AbstractBuilder getPropertyBuilder(ClassWriter classWriter) throws Exception { - final PropertyWriter propertyWriter = - writerFactory.getPropertyWriter(classWriter); - return PropertyBuilder.getInstance(context, - classWriter.getClassDoc(), - propertyWriter); - } - - /** - * Return an instance of the constructor builder for the given class. - * - * @return an instance of the constructor builder for the given class. - */ - public AbstractBuilder getConstructorBuilder(ClassWriter classWriter) - throws Exception { - return ConstructorBuilder.getInstance(context, - classWriter.getClassDoc(), - writerFactory.getConstructorWriter(classWriter)); - } - - /** - * Return an instance of the member summary builder for the given class. - * - * @return an instance of the member summary builder for the given class. - */ - public AbstractBuilder getMemberSummaryBuilder(ClassWriter classWriter) - throws Exception { - return MemberSummaryBuilder.getInstance(classWriter, context); - } - - /** - * Return an instance of the member summary builder for the given annotation - * type. - * - * @return an instance of the member summary builder for the given - * annotation type. - */ - public AbstractBuilder getMemberSummaryBuilder( - AnnotationTypeWriter annotationTypeWriter) - throws Exception { - return MemberSummaryBuilder.getInstance(annotationTypeWriter, context); - } - - /** - * Return the builder that builds the serialized form. - * - * @return the builder that builds the serialized form. - */ - public AbstractBuilder getSerializedFormBuilder() - throws Exception { - return SerializedFormBuilder.getInstance(context); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; - -/** - * Builds the summary for a given class. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class ClassBuilder extends AbstractBuilder { - - /** - * The root element of the class XML is {@value}. - */ - public static final String ROOT = "ClassDoc"; - - /** - * The class being documented. - */ - private final ClassDoc classDoc; - - /** - * The doclet specific writer. - */ - private final ClassWriter writer; - - /** - * Keep track of whether or not this classdoc is an interface. - */ - private final boolean isInterface; - - /** - * Keep track of whether or not this classdoc is an enum. - */ - private final boolean isEnum; - - /** - * The content tree for the class documentation. - */ - private Content contentTree; - - /** - * Construct a new ClassBuilder. - * - * @param context the build context - * @param classDoc the class being documented. - * @param writer the doclet specific writer. - */ - private ClassBuilder(Context context, - ClassDoc classDoc, ClassWriter writer) { - super(context); - this.classDoc = classDoc; - this.writer = writer; - if (classDoc.isInterface()) { - isInterface = true; - isEnum = false; - } else if (classDoc.isEnum()) { - isInterface = false; - isEnum = true; - utils.setEnumDocumentation(configuration, classDoc); - } else { - isInterface = false; - isEnum = false; - } - } - - /** - * Construct a new ClassBuilder. - * - * @param context the build context - * @param classDoc the class being documented. - * @param writer the doclet specific writer. - */ - public static ClassBuilder getInstance(Context context, - ClassDoc classDoc, ClassWriter writer) { - return new ClassBuilder(context, classDoc, writer); - } - - /** - * {@inheritDoc} - */ - public void build() throws IOException { - build(layoutParser.parseXML(ROOT), contentTree); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return ROOT; - } - - /** - * Handles the {@literal } tag. - * - * @param node the XML element that specifies which components to document - * @param contentTree the content tree to which the documentation will be added - */ - public void buildClassDoc(XMLNode node, Content contentTree) throws Exception { - String key; - if (isInterface) { - key = "doclet.Interface"; - } else if (isEnum) { - key = "doclet.Enum"; - } else { - key = "doclet.Class"; - } - contentTree = writer.getHeader(configuration.getText(key) + " " + - classDoc.name()); - Content classContentTree = writer.getClassContentHeader(); - buildChildren(node, classContentTree); - writer.addClassContentTree(contentTree, classContentTree); - writer.addFooter(contentTree); - writer.printDocument(contentTree); - writer.close(); - copyDocFiles(); - } - - /** - * Build the class tree documentation. - * - * @param node the XML element that specifies which components to document - * @param classContentTree the content tree to which the documentation will be added - */ - public void buildClassTree(XMLNode node, Content classContentTree) { - writer.addClassTree(classContentTree); - } - - /** - * Build the class information tree documentation. - * - * @param node the XML element that specifies which components to document - * @param classContentTree the content tree to which the documentation will be added - */ - public void buildClassInfo(XMLNode node, Content classContentTree) { - Content classInfoTree = writer.getClassInfoTreeHeader(); - buildChildren(node, classInfoTree); - classContentTree.addContent(writer.getClassInfo(classInfoTree)); - } - - /** - * Build the typeparameters of this class. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildTypeParamInfo(XMLNode node, Content classInfoTree) { - writer.addTypeParamInfo(classInfoTree); - } - - /** - * If this is an interface, list all super interfaces. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildSuperInterfacesInfo(XMLNode node, Content classInfoTree) { - writer.addSuperInterfacesInfo(classInfoTree); - } - - /** - * If this is a class, list all interfaces implemented by this class. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildImplementedInterfacesInfo(XMLNode node, Content classInfoTree) { - writer.addImplementedInterfacesInfo(classInfoTree); - } - - /** - * List all the classes extend this one. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildSubClassInfo(XMLNode node, Content classInfoTree) { - writer.addSubClassInfo(classInfoTree); - } - - /** - * List all the interfaces that extend this one. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildSubInterfacesInfo(XMLNode node, Content classInfoTree) { - writer.addSubInterfacesInfo(classInfoTree); - } - - /** - * If this is an interface, list all classes that implement this interface. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildInterfaceUsageInfo(XMLNode node, Content classInfoTree) { - writer.addInterfaceUsageInfo(classInfoTree); - } - - /** - * If this is an functional interface, display appropriate message. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildFunctionalInterfaceInfo(XMLNode node, Content classInfoTree) { - writer.addFunctionalInterfaceInfo(classInfoTree); - } - - /** - * If this class is deprecated, build the appropriate information. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildDeprecationInfo (XMLNode node, Content classInfoTree) { - writer.addClassDeprecationInfo(classInfoTree); - } - - /** - * If this is an inner class or interface, list the enclosing class or interface. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildNestedClassInfo (XMLNode node, Content classInfoTree) { - writer.addNestedClassInfo(classInfoTree); - } - - /** - * Copy the doc files for the current ClassDoc if necessary. - */ - private void copyDocFiles() { - PackageDoc containingPackage = classDoc.containingPackage(); - if((configuration.packages == null || - !configuration.packages.contains(containingPackage)) && - ! containingPackagesSeen.contains(containingPackage)){ - //Only copy doc files dir if the containing package is not - //documented AND if we have not documented a class from the same - //package already. Otherwise, we are making duplicate copies. - utils.copyDocFiles(configuration, containingPackage); - containingPackagesSeen.add(containingPackage); - } - } - - /** - * Build the signature of the current class. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildClassSignature(XMLNode node, Content classInfoTree) { - StringBuilder modifiers = new StringBuilder(classDoc.modifiers()); - modifiers.append(modifiers.length() == 0 ? "" : " "); - if (isEnum) { - modifiers.append("enum "); - int index; - if ((index = modifiers.indexOf("abstract")) >= 0) { - modifiers.delete(index, index + "abstract".length()); - modifiers = new StringBuilder( - utils.replaceText(modifiers.toString(), " ", " ")); - } - if ((index = modifiers.indexOf("final")) >= 0) { - modifiers.delete(index, index + "final".length()); - modifiers = new StringBuilder( - utils.replaceText(modifiers.toString(), " ", " ")); - } - //} else if (classDoc.isAnnotationType()) { - //modifiers.append("@interface "); - } else if (! isInterface) { - modifiers.append("class "); - } - writer.addClassSignature(modifiers.toString(), classInfoTree); - } - - /** - * Build the class description. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildClassDescription(XMLNode node, Content classInfoTree) { - writer.addClassDescription(classInfoTree); - } - - /** - * Build the tag information for the current class. - * - * @param node the XML element that specifies which components to document - * @param classInfoTree the content tree to which the documentation will be added - */ - public void buildClassTagInfo(XMLNode node, Content classInfoTree) { - writer.addClassTagInfo(classInfoTree); - } - - /** - * Build the member summary contents of the page. - * - * @param node the XML element that specifies which components to document - * @param classContentTree the content tree to which the documentation will be added - */ - public void buildMemberSummary(XMLNode node, Content classContentTree) throws Exception { - Content memberSummaryTree = writer.getMemberTreeHeader(); - configuration.getBuilderFactory(). - getMemberSummaryBuilder(writer).buildChildren(node, memberSummaryTree); - classContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree)); - } - - /** - * Build the member details contents of the page. - * - * @param node the XML element that specifies which components to document - * @param classContentTree the content tree to which the documentation will be added - */ - public void buildMemberDetails(XMLNode node, Content classContentTree) { - Content memberDetailsTree = writer.getMemberTreeHeader(); - buildChildren(node, memberDetailsTree); - classContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree)); - } - - /** - * Build the enum constants documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildEnumConstantsDetails(XMLNode node, - Content memberDetailsTree) throws Exception { - configuration.getBuilderFactory(). - getEnumConstantsBuilder(writer).buildChildren(node, memberDetailsTree); - } - - /** - * Build the field documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildFieldDetails(XMLNode node, - Content memberDetailsTree) throws Exception { - configuration.getBuilderFactory(). - getFieldBuilder(writer).buildChildren(node, memberDetailsTree); - } - - /** - * Build the property documentation. - * - * @param elements the XML elements that specify how a field is documented. - */ - public void buildPropertyDetails(XMLNode node, - Content memberDetailsTree) throws Exception { - configuration.getBuilderFactory(). - getPropertyBuilder(writer).buildChildren(node, memberDetailsTree); - } - - /** - * Build the constructor documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildConstructorDetails(XMLNode node, - Content memberDetailsTree) throws Exception { - configuration.getBuilderFactory(). - getConstructorBuilder(writer).buildChildren(node, memberDetailsTree); - } - - /** - * Build the method documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildMethodDetails(XMLNode node, - Content memberDetailsTree) throws Exception { - configuration.getBuilderFactory(). - getMethodBuilder(writer).buildChildren(node, memberDetailsTree); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java +++ /dev/null @@ -1,387 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Builds the Constants Summary Page. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class ConstantsSummaryBuilder extends AbstractBuilder { - - /** - * The root element of the constant summary XML is {@value}. - */ - public static final String ROOT = "ConstantSummary"; - - /** - * The maximum number of package directories shown in the constant - * value index. - */ - public static final int MAX_CONSTANT_VALUE_INDEX_LENGTH = 2; - - /** - * The writer used to write the results. - */ - protected final ConstantsSummaryWriter writer; - - /** - * The set of ClassDocs that have constant fields. - */ - protected final Set classDocsWithConstFields; - - /** - * The set of printed package headers. - */ - protected Set printedPackageHeaders; - - /** - * The current package being documented. - */ - private PackageDoc currentPackage; - - /** - * The current class being documented. - */ - private ClassDoc currentClass; - - /** - * The content tree for the constant summary documentation. - */ - private Content contentTree; - - /** - * True if first package is listed. - */ - private boolean first = true; - - /** - * Construct a new ConstantsSummaryBuilder. - * - * @param context the build context. - * @param writer the writer for the summary. - */ - private ConstantsSummaryBuilder(Context context, - ConstantsSummaryWriter writer) { - super(context); - this.writer = writer; - this.classDocsWithConstFields = new HashSet<>(); - } - - /** - * Construct a ConstantsSummaryBuilder. - * - * @param context the build context. - * @param writer the writer for the summary. - */ - public static ConstantsSummaryBuilder getInstance(Context context, - ConstantsSummaryWriter writer) { - return new ConstantsSummaryBuilder(context, writer); - } - - /** - * {@inheritDoc} - */ - public void build() throws IOException { - if (writer == null) { - //Doclet does not support this output. - return; - } - build(layoutParser.parseXML(ROOT), contentTree); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return ROOT; - } - - /** - * Build the constant summary. - * - * @param node the XML element that specifies which components to document - * @param contentTree the content tree to which the documentation will be added - */ - public void buildConstantSummary(XMLNode node, Content contentTree) throws Exception { - contentTree = writer.getHeader(); - buildChildren(node, contentTree); - writer.addFooter(contentTree); - writer.printDocument(contentTree); - writer.close(); - } - - /** - * Build the list of packages. - * - * @param node the XML element that specifies which components to document - * @param contentTree the content tree to which the content list will be added - */ - public void buildContents(XMLNode node, Content contentTree) { - Content contentListTree = writer.getContentsHeader(); - printedPackageHeaders = new HashSet<>(); - for (PackageDoc pkg : configuration.packages) { - if (hasConstantField(pkg) && !hasPrintedPackageIndex(pkg.name())) { - writer.addLinkToPackageContent(pkg, - parsePackageName(pkg.name()), - printedPackageHeaders, contentListTree); - } - } - writer.addContentsList(contentTree, contentListTree); - } - - /** - * Build the summary for each documented package. - * - * @param node the XML element that specifies which components to document - * @param contentTree the tree to which the summaries will be added - */ - public void buildConstantSummaries(XMLNode node, Content contentTree) { - printedPackageHeaders = new HashSet<>(); - Content summariesTree = writer.getConstantSummaries(); - for (PackageDoc aPackage : configuration.packages) { - if (hasConstantField(aPackage)) { - currentPackage = aPackage; - //Build the documentation for the current package. - buildChildren(node, summariesTree); - first = false; - } - } - writer.addConstantSummaries(contentTree, summariesTree); - } - - /** - * Build the header for the given package. - * - * @param node the XML element that specifies which components to document - * @param summariesTree the tree to which the package header will be added - */ - public void buildPackageHeader(XMLNode node, Content summariesTree) { - String parsedPackageName = parsePackageName(currentPackage.name()); - if (! printedPackageHeaders.contains(parsedPackageName)) { - writer.addPackageName(parsePackageName(currentPackage.name()), summariesTree, first); - printedPackageHeaders.add(parsedPackageName); - } - } - - /** - * Build the summary for the current class. - * - * @param node the XML element that specifies which components to document - * @param summariesTree the tree to which the class constant summary will be added - */ - public void buildClassConstantSummary(XMLNode node, Content summariesTree) { - ClassDoc[] classes = currentPackage.name().length() > 0 ? - currentPackage.allClasses() : - configuration.classDocCatalog.allClasses( - DocletConstants.DEFAULT_PACKAGE_NAME); - Arrays.sort(classes); - Content classConstantTree = writer.getClassConstantHeader(); - for (ClassDoc doc : classes) { - if (!classDocsWithConstFields.contains(doc) || - !doc.isIncluded()) { - continue; - } - currentClass = doc; - //Build the documentation for the current class. - buildChildren(node, classConstantTree); - } - writer.addClassConstant(summariesTree, classConstantTree); - } - - /** - * Build the summary of constant members in the class. - * - * @param node the XML element that specifies which components to document - * @param classConstantTree the tree to which the constant members table - * will be added - */ - public void buildConstantMembers(XMLNode node, Content classConstantTree) { - new ConstantFieldBuilder(currentClass).buildMembersSummary(node, classConstantTree); - } - - /** - * Return true if the given package has constant fields to document. - * - * @param pkg the package being checked. - * @return true if the given package has constant fields to document. - */ - private boolean hasConstantField(PackageDoc pkg) { - ClassDoc[] classes - = (pkg.name().length() > 0) - ? pkg.allClasses() - : configuration.classDocCatalog.allClasses(DocletConstants.DEFAULT_PACKAGE_NAME); - boolean found = false; - for (ClassDoc doc : classes) { - if (doc.isIncluded() && hasConstantField(doc)) { - found = true; - } - } - return found; - } - - /** - * Return true if the given class has constant fields to document. - * - * @param classDoc the class being checked. - * @return true if the given package has constant fields to document. - */ - private boolean hasConstantField (ClassDoc classDoc) { - VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, - VisibleMemberMap.FIELDS, configuration); - List fields = visibleMemberMapFields.getLeafClassMembers(configuration); - for (Object f : fields) { - FieldDoc field = (FieldDoc) f; - if (field.constantValueExpression() != null) { - classDocsWithConstFields.add(classDoc); - return true; - } - } - return false; - } - - /** - * Return true if the given package name has been printed. Also - * return true if the root of this package has been printed. - * - * @param pkgname the name of the package to check. - */ - private boolean hasPrintedPackageIndex(String pkgname) { - String[] list = printedPackageHeaders.toArray(new String[] {}); - for (String packageHeader : list) { - if (pkgname.startsWith(packageHeader)) { - return true; - } - } - return false; - } - - /** - * Print the table of constants. - * - * @author Jamie Ho - * @since 1.4 - */ - private class ConstantFieldBuilder { - - /** - * The map used to get the visible variables. - */ - protected VisibleMemberMap visibleMemberMapFields = null; - - /** - * The map used to get the visible variables. - */ - protected VisibleMemberMap visibleMemberMapEnumConst = null; - - /** - * The classdoc that we are examining constants for. - */ - protected ClassDoc classdoc; - - /** - * Construct a ConstantFieldSubWriter. - * @param classdoc the classdoc that we are examining constants for. - */ - public ConstantFieldBuilder(ClassDoc classdoc) { - this.classdoc = classdoc; - visibleMemberMapFields = new VisibleMemberMap(classdoc, - VisibleMemberMap.FIELDS, configuration); - visibleMemberMapEnumConst = new VisibleMemberMap(classdoc, - VisibleMemberMap.ENUM_CONSTANTS, configuration); - } - - /** - * Builds the table of constants for a given class. - * - * @param node the XML element that specifies which components to document - * @param classConstantTree the tree to which the class constants table - * will be added - */ - protected void buildMembersSummary(XMLNode node, Content classConstantTree) { - List members = new ArrayList<>(members()); - if (members.size() > 0) { - Collections.sort(members); - writer.addConstantMembers(classdoc, members, classConstantTree); - } - } - - /** - * Return the list of visible constant fields for the given classdoc. - * @return the list of visible constant fields for the given classdoc. - */ - protected List members() { - List l = visibleMemberMapFields.getLeafClassMembers(configuration); - l.addAll(visibleMemberMapEnumConst.getLeafClassMembers(configuration)); - Iterator iter; - - if(l != null){ - iter = l.iterator(); - } else { - return null; - } - List inclList = new LinkedList<>(); - FieldDoc member; - while(iter.hasNext()){ - member = (FieldDoc)iter.next(); - if(member.constantValue() != null){ - inclList.add(member); - } - } - return inclList; - } - } - - /** - * Parse the package name. We only want to display package name up to - * 2 levels. - */ - private String parsePackageName(String pkgname) { - int index = -1; - for (int j = 0; j < MAX_CONSTANT_VALUE_INDEX_LENGTH; j++) { - index = pkgname.indexOf(".", index + 1); - } - if (index != -1) { - pkgname = pkgname.substring(0, index); - } - return pkgname; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Builds documentation for a constructor. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class ConstructorBuilder extends AbstractMemberBuilder { - - /** - * The name of this builder. - */ - public static final String NAME = "ConstructorDetails"; - - /** - * The index of the current field that is being documented at this point - * in time. - */ - private int currentConstructorIndex; - - /** - * The class whose constructors are being documented. - */ - private final ClassDoc classDoc; - - /** - * The visible constructors for the given class. - */ - private final VisibleMemberMap visibleMemberMap; - - /** - * The writer to output the constructor documentation. - */ - private final ConstructorWriter writer; - - /** - * The constructors being documented. - */ - private final List constructors; - - /** - * Construct a new ConstructorBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - private ConstructorBuilder(Context context, - ClassDoc classDoc, - ConstructorWriter writer) { - super(context); - this.classDoc = classDoc; - this.writer = writer; - visibleMemberMap = - new VisibleMemberMap( - classDoc, - VisibleMemberMap.CONSTRUCTORS, - configuration); - constructors = new ArrayList<>(visibleMemberMap.getMembersFor(classDoc)); - for (ProgramElementDoc constructor : constructors) { - if (constructor.isProtected() || constructor.isPrivate()) { - writer.setFoundNonPubConstructor(true); - } - } - if (configuration.getMemberComparator() != null) { - Collections.sort(constructors,configuration.getMemberComparator()); - } - } - - /** - * Construct a new ConstructorBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - public static ConstructorBuilder getInstance(Context context, - ClassDoc classDoc, ConstructorWriter writer) { - return new ConstructorBuilder(context, classDoc, writer); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return NAME; - } - - /** - * {@inheritDoc} - */ - public boolean hasMembersToDocument() { - return constructors.size() > 0; - } - - /** - * Returns a list of constructors that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @return a list of constructors that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Return the constructor writer for this builder. - * - * @return the constructor writer for this builder. - */ - public ConstructorWriter getWriter() { - return writer; - } - - /** - * Build the constructor documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildConstructorDoc(XMLNode node, Content memberDetailsTree) { - if (writer == null) { - return; - } - int size = constructors.size(); - if (size > 0) { - Content constructorDetailsTree = writer.getConstructorDetailsTreeHeader( - classDoc, memberDetailsTree); - for (currentConstructorIndex = 0; currentConstructorIndex < size; - currentConstructorIndex++) { - Content constructorDocTree = writer.getConstructorDocTreeHeader( - (ConstructorDoc) constructors.get(currentConstructorIndex), - constructorDetailsTree); - buildChildren(node, constructorDocTree); - constructorDetailsTree.addContent(writer.getConstructorDoc( - constructorDocTree, (currentConstructorIndex == size - 1))); - } - memberDetailsTree.addContent( - writer.getConstructorDetails(constructorDetailsTree)); - } - } - - /** - * Build the signature. - * - * @param node the XML element that specifies which components to document - * @param constructorDocTree the content tree to which the documentation will be added - */ - public void buildSignature(XMLNode node, Content constructorDocTree) { - constructorDocTree.addContent( - writer.getSignature( - (ConstructorDoc) constructors.get(currentConstructorIndex))); - } - - /** - * Build the deprecation information. - * - * @param node the XML element that specifies which components to document - * @param constructorDocTree the content tree to which the documentation will be added - */ - public void buildDeprecationInfo(XMLNode node, Content constructorDocTree) { - writer.addDeprecated( - (ConstructorDoc) constructors.get(currentConstructorIndex), constructorDocTree); - } - - /** - * Build the comments for the constructor. Do nothing if - * {@link Configuration#nocomment} is set to true. - * - * @param node the XML element that specifies which components to document - * @param constructorDocTree the content tree to which the documentation will be added - */ - public void buildConstructorComments(XMLNode node, Content constructorDocTree) { - if (!configuration.nocomment) { - writer.addComments( - (ConstructorDoc) constructors.get(currentConstructorIndex), - constructorDocTree); - } - } - - /** - * Build the tag information. - * - * @param node the XML element that specifies which components to document - * @param constructorDocTree the content tree to which the documentation will be added - */ - public void buildTagInfo(XMLNode node, Content constructorDocTree) { - writer.addTags((ConstructorDoc) constructors.get(currentConstructorIndex), - constructorDocTree); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Builds documentation for a enum constants. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class EnumConstantBuilder extends AbstractMemberBuilder { - - /** - * The class whose enum constants are being documented. - */ - private final ClassDoc classDoc; - - /** - * The visible enum constantss for the given class. - */ - private final VisibleMemberMap visibleMemberMap; - - /** - * The writer to output the enum constants documentation. - */ - private final EnumConstantWriter writer; - - /** - * The list of enum constants being documented. - */ - private final List enumConstants; - - /** - * The index of the current enum constant that is being documented at this point - * in time. - */ - private int currentEnumConstantsIndex; - - /** - * Construct a new EnumConstantsBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - private EnumConstantBuilder(Context context, - ClassDoc classDoc, EnumConstantWriter writer) { - super(context); - this.classDoc = classDoc; - this.writer = writer; - visibleMemberMap = - new VisibleMemberMap( - classDoc, - VisibleMemberMap.ENUM_CONSTANTS, - configuration); - enumConstants = new ArrayList<>(visibleMemberMap.getMembersFor(classDoc)); - if (configuration.getMemberComparator() != null) { - Collections.sort(enumConstants, configuration.getMemberComparator()); - } - } - - /** - * Construct a new EnumConstantsBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - public static EnumConstantBuilder getInstance(Context context, - ClassDoc classDoc, EnumConstantWriter writer) { - return new EnumConstantBuilder(context, classDoc, writer); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return "EnumConstantDetails"; - } - - /** - * Returns a list of enum constants that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @return a list of enum constants that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Returns the visible member map for the enum constants of this class. - * - * @return the visible member map for the enum constants of this class. - */ - public VisibleMemberMap getVisibleMemberMap() { - return visibleMemberMap; - } - - /** - * summaryOrder.size() - */ - public boolean hasMembersToDocument() { - return enumConstants.size() > 0; - } - - /** - * Build the enum constant documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildEnumConstant(XMLNode node, Content memberDetailsTree) { - if (writer == null) { - return; - } - int size = enumConstants.size(); - if (size > 0) { - Content enumConstantsDetailsTree = writer.getEnumConstantsDetailsTreeHeader( - classDoc, memberDetailsTree); - for (currentEnumConstantsIndex = 0; currentEnumConstantsIndex < size; - currentEnumConstantsIndex++) { - Content enumConstantsTree = writer.getEnumConstantsTreeHeader( - (FieldDoc) enumConstants.get(currentEnumConstantsIndex), - enumConstantsDetailsTree); - buildChildren(node, enumConstantsTree); - enumConstantsDetailsTree.addContent(writer.getEnumConstants( - enumConstantsTree, (currentEnumConstantsIndex == size - 1))); - } - memberDetailsTree.addContent( - writer.getEnumConstantsDetails(enumConstantsDetailsTree)); - } - } - - /** - * Build the signature. - * - * @param node the XML element that specifies which components to document - * @param enumConstantsTree the content tree to which the documentation will be added - */ - public void buildSignature(XMLNode node, Content enumConstantsTree) { - enumConstantsTree.addContent(writer.getSignature( - (FieldDoc) enumConstants.get(currentEnumConstantsIndex))); - } - - /** - * Build the deprecation information. - * - * @param node the XML element that specifies which components to document - * @param enumConstantsTree the content tree to which the documentation will be added - */ - public void buildDeprecationInfo(XMLNode node, Content enumConstantsTree) { - writer.addDeprecated( - (FieldDoc) enumConstants.get(currentEnumConstantsIndex), - enumConstantsTree); - } - - /** - * Build the comments for the enum constant. Do nothing if - * {@link Configuration#nocomment} is set to true. - * - * @param node the XML element that specifies which components to document - * @param enumConstantsTree the content tree to which the documentation will be added - */ - public void buildEnumConstantComments(XMLNode node, Content enumConstantsTree) { - if (!configuration.nocomment) { - writer.addComments( - (FieldDoc) enumConstants.get(currentEnumConstantsIndex), - enumConstantsTree); - } - } - - /** - * Build the tag information. - * - * @param node the XML element that specifies which components to document - * @param enumConstantsTree the content tree to which the documentation will be added - */ - public void buildTagInfo(XMLNode node, Content enumConstantsTree) { - writer.addTags( - (FieldDoc) enumConstants.get(currentEnumConstantsIndex), - enumConstantsTree); - } - - /** - * Return the enum constant writer for this builder. - * - * @return the enum constant writer for this builder. - */ - public EnumConstantWriter getWriter() { - return writer; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Builds documentation for a field. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class FieldBuilder extends AbstractMemberBuilder { - - /** - * The class whose fields are being documented. - */ - private final ClassDoc classDoc; - - /** - * The visible fields for the given class. - */ - private final VisibleMemberMap visibleMemberMap; - - /** - * The writer to output the field documentation. - */ - private final FieldWriter writer; - - /** - * The list of fields being documented. - */ - private final List fields; - - /** - * The index of the current field that is being documented at this point - * in time. - */ - private int currentFieldIndex; - - /** - * Construct a new FieldBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - private FieldBuilder(Context context, - ClassDoc classDoc, - FieldWriter writer) { - super(context); - this.classDoc = classDoc; - this.writer = writer; - visibleMemberMap = - new VisibleMemberMap( - classDoc, - VisibleMemberMap.FIELDS, - configuration); - fields = new ArrayList<>(visibleMemberMap.getLeafClassMembers(configuration)); - if (configuration.getMemberComparator() != null) { - Collections.sort(fields, configuration.getMemberComparator()); - } - } - - /** - * Construct a new FieldBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - public static FieldBuilder getInstance(Context context, - ClassDoc classDoc, - FieldWriter writer) { - return new FieldBuilder(context, classDoc, writer); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return "FieldDetails"; - } - - /** - * Returns a list of fields that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @return a list of fields that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Returns the visible member map for the fields of this class. - * - * @return the visible member map for the fields of this class. - */ - public VisibleMemberMap getVisibleMemberMap() { - return visibleMemberMap; - } - - /** - * summaryOrder.size() - */ - public boolean hasMembersToDocument() { - return fields.size() > 0; - } - - /** - * Build the field documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildFieldDoc(XMLNode node, Content memberDetailsTree) { - if (writer == null) { - return; - } - int size = fields.size(); - if (size > 0) { - Content fieldDetailsTree = writer.getFieldDetailsTreeHeader( - classDoc, memberDetailsTree); - for (currentFieldIndex = 0; currentFieldIndex < size; - currentFieldIndex++) { - Content fieldDocTree = writer.getFieldDocTreeHeader( - (FieldDoc) fields.get(currentFieldIndex), - fieldDetailsTree); - buildChildren(node, fieldDocTree); - fieldDetailsTree.addContent(writer.getFieldDoc( - fieldDocTree, (currentFieldIndex == size - 1))); - } - memberDetailsTree.addContent( - writer.getFieldDetails(fieldDetailsTree)); - } - } - - /** - * Build the signature. - * - * @param node the XML element that specifies which components to document - * @param fieldDocTree the content tree to which the documentation will be added - */ - public void buildSignature(XMLNode node, Content fieldDocTree) { - fieldDocTree.addContent( - writer.getSignature((FieldDoc) fields.get(currentFieldIndex))); - } - - /** - * Build the deprecation information. - * - * @param node the XML element that specifies which components to document - * @param fieldDocTree the content tree to which the documentation will be added - */ - public void buildDeprecationInfo(XMLNode node, Content fieldDocTree) { - writer.addDeprecated( - (FieldDoc) fields.get(currentFieldIndex), fieldDocTree); - } - - /** - * Build the comments for the field. Do nothing if - * {@link Configuration#nocomment} is set to true. - * - * @param node the XML element that specifies which components to document - * @param fieldDocTree the content tree to which the documentation will be added - */ - public void buildFieldComments(XMLNode node, Content fieldDocTree) { - if (!configuration.nocomment) { - writer.addComments((FieldDoc) fields.get(currentFieldIndex), fieldDocTree); - } - } - - /** - * Build the tag information. - * - * @param node the XML element that specifies which components to document - * @param fieldDocTree the content tree to which the documentation will be added - */ - public void buildTagInfo(XMLNode node, Content fieldDocTree) { - writer.addTags((FieldDoc) fields.get(currentFieldIndex), fieldDocTree); - } - - /** - * Return the field writer for this builder. - * - * @return the field writer for this builder. - */ - public FieldWriter getWriter() { - return writer; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.io.*; -import java.util.*; - -import javax.xml.parsers.*; - -import org.xml.sax.*; -import org.xml.sax.helpers.DefaultHandler; - -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Parse the XML that specified the order of operation for the builders. This - * Parser uses SAX parsing. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @since 1.5 - * @see SAXParser - */ -@Deprecated -public class LayoutParser extends DefaultHandler { - - /** - * The map of XML elements that have been parsed. - */ - private Map xmlElementsMap; - private XMLNode currentNode; - private final Configuration configuration; - private String currentRoot; - private boolean isParsing; - - private LayoutParser(Configuration configuration) { - xmlElementsMap = new HashMap<>(); - this.configuration = configuration; - } - - /** - * Return an instance of the BuilderXML. - * - * @param configuration the current configuration of the doclet. - * @return an instance of the BuilderXML. - */ - public static LayoutParser getInstance(Configuration configuration) { - return new LayoutParser(configuration); - } - - /** - * Parse the XML specifying the layout of the documentation. - * - * @return the list of XML elements parsed. - */ - public XMLNode parseXML(String root) { - if (xmlElementsMap.containsKey(root)) { - return xmlElementsMap.get(root); - } - try { - currentRoot = root; - isParsing = false; - SAXParserFactory factory = SAXParserFactory.newInstance(); - SAXParser saxParser = factory.newSAXParser(); - InputStream in = configuration.getBuilderXML(); - saxParser.parse(in, this); - return xmlElementsMap.get(root); - } catch (Throwable t) { - t.printStackTrace(); - throw new DocletAbortException(t); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void startElement(String namespaceURI, String sName, String qName, - Attributes attrs) - throws SAXException { - if (isParsing || qName.equals(currentRoot)) { - isParsing = true; - currentNode = new XMLNode(currentNode, qName); - for (int i = 0; i < attrs.getLength(); i++) - currentNode.attrs.put(attrs.getLocalName(i), attrs.getValue(i)); - if (qName.equals(currentRoot)) - xmlElementsMap.put(qName, currentNode); - } - } - - /** - * {@inheritDoc} - */ - @Override - public void endElement(String namespaceURI, String sName, String qName) - throws SAXException { - if (! isParsing) { - return; - } - currentNode = currentNode.parent; - isParsing = ! qName.equals(currentRoot); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java +++ /dev/null @@ -1,531 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.*; -import java.text.MessageFormat; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Builds the member summary. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class MemberSummaryBuilder extends AbstractMemberBuilder { - - /** - * The XML root for this builder. - */ - public static final String NAME = "MemberSummary"; - - /** - * The visible members for the given class. - */ - private final VisibleMemberMap[] visibleMemberMaps; - - /** - * The member summary writers for the given class. - */ - private MemberSummaryWriter[] memberSummaryWriters; - - /** - * The type being documented. - */ - private final ClassDoc classDoc; - - /** - * Construct a new MemberSummaryBuilder. - * - * @param classWriter the writer for the class whose members are being - * summarized. - * @param context the build context. - */ - private MemberSummaryBuilder(Context context, ClassDoc classDoc) { - super(context); - this.classDoc = classDoc; - visibleMemberMaps = - new VisibleMemberMap[VisibleMemberMap.NUM_MEMBER_TYPES]; - for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { - visibleMemberMaps[i] = - new VisibleMemberMap( - classDoc, - i, - configuration); - } - } - - /** - * Construct a new MemberSummaryBuilder. - * - * @param classWriter the writer for the class whose members are being - * summarized. - * @param context the build context. - */ - public static MemberSummaryBuilder getInstance( - ClassWriter classWriter, Context context) - throws Exception { - MemberSummaryBuilder builder = new MemberSummaryBuilder(context, - classWriter.getClassDoc()); - builder.memberSummaryWriters = - new MemberSummaryWriter[VisibleMemberMap.NUM_MEMBER_TYPES]; - WriterFactory wf = context.configuration.getWriterFactory(); - for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { - builder.memberSummaryWriters[i] = - builder.visibleMemberMaps[i].noVisibleMembers() ? - null : - wf.getMemberSummaryWriter(classWriter, i); - } - return builder; - } - - /** - * Construct a new MemberSummaryBuilder. - * - * @param annotationTypeWriter the writer for the class whose members are - * being summarized. - * @param configuration the current configuration of the doclet. - */ - public static MemberSummaryBuilder getInstance( - AnnotationTypeWriter annotationTypeWriter, Context context) - throws Exception { - MemberSummaryBuilder builder = new MemberSummaryBuilder(context, - annotationTypeWriter.getAnnotationTypeDoc()); - builder.memberSummaryWriters = - new MemberSummaryWriter[VisibleMemberMap.NUM_MEMBER_TYPES]; - WriterFactory wf = context.configuration.getWriterFactory(); - for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { - builder.memberSummaryWriters[i] = - builder.visibleMemberMaps[i].noVisibleMembers()? - null : - wf.getMemberSummaryWriter( - annotationTypeWriter, i); - } - return builder; - } - - /** - * {@inheritDoc} - */ - public String getName() { - return NAME; - } - - /** - * Return the specified visible member map. - * - * @param type the type of visible member map to return. - * @return the specified visible member map. - * @throws ArrayIndexOutOfBoundsException when the type is invalid. - * @see VisibleMemberMap - */ - public VisibleMemberMap getVisibleMemberMap(int type) { - return visibleMemberMaps[type]; - } - - /** - * Return the specified member summary writer. - * - * @param type the type of member summary writer to return. - * @return the specified member summary writer. - * @throws ArrayIndexOutOfBoundsException when the type is invalid. - * @see VisibleMemberMap - */ - public MemberSummaryWriter getMemberSummaryWriter(int type) { - return memberSummaryWriters[type]; - } - - /** - * Returns a list of methods that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param type the type of members to return. - * @return a list of methods that will be documented. - * @see VisibleMemberMap - */ - public List members(int type) { - return visibleMemberMaps[type].getLeafClassMembers(configuration); - } - - /** - * Return true it there are any members to summarize. - * - * @return true if there are any members to summarize. - */ - public boolean hasMembersToDocument() { - if (classDoc instanceof AnnotationTypeDoc) { - return ((AnnotationTypeDoc) classDoc).elements().length > 0; - } - for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { - VisibleMemberMap members = visibleMemberMaps[i]; - if (!members.noVisibleMembers()) { - return true; - } - } - return false; - } - - /** - * Build the summary for the enum constants. - * - * @param node the XML element that specifies which components to document - * @param memberSummaryTree the content tree to which the documentation will be added - */ - public void buildEnumConstantsSummary(XMLNode node, Content memberSummaryTree) { - MemberSummaryWriter writer = - memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS]; - VisibleMemberMap visibleMemberMap = - visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS]; - addSummary(writer, visibleMemberMap, false, memberSummaryTree); - } - - /** - * Build the summary for fields. - * - * @param node the XML element that specifies which components to document - * @param memberSummaryTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeFieldsSummary(XMLNode node, Content memberSummaryTree) { - MemberSummaryWriter writer = - memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_FIELDS]; - VisibleMemberMap visibleMemberMap = - visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_FIELDS]; - addSummary(writer, visibleMemberMap, false, memberSummaryTree); - } - - /** - * Build the summary for the optional members. - * - * @param node the XML element that specifies which components to document - * @param memberSummaryTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeOptionalMemberSummary(XMLNode node, Content memberSummaryTree) { - MemberSummaryWriter writer = - memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL]; - VisibleMemberMap visibleMemberMap = - visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL]; - addSummary(writer, visibleMemberMap, false, memberSummaryTree); - } - - /** - * Build the summary for the optional members. - * - * @param node the XML element that specifies which components to document - * @param memberSummaryTree the content tree to which the documentation will be added - */ - public void buildAnnotationTypeRequiredMemberSummary(XMLNode node, Content memberSummaryTree) { - MemberSummaryWriter writer = - memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED]; - VisibleMemberMap visibleMemberMap = - visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED]; - addSummary(writer, visibleMemberMap, false, memberSummaryTree); - } - - /** - * Build the summary for the fields. - * - * @param node the XML element that specifies which components to document - * @param memberSummaryTree the content tree to which the documentation will be added - */ - public void buildFieldsSummary(XMLNode node, Content memberSummaryTree) { - MemberSummaryWriter writer = - memberSummaryWriters[VisibleMemberMap.FIELDS]; - VisibleMemberMap visibleMemberMap = - visibleMemberMaps[VisibleMemberMap.FIELDS]; - addSummary(writer, visibleMemberMap, true, memberSummaryTree); - } - - /** - * Build the summary for the fields. - */ - public void buildPropertiesSummary(XMLNode node, Content memberSummaryTree) { - MemberSummaryWriter writer = - memberSummaryWriters[VisibleMemberMap.PROPERTIES]; - VisibleMemberMap visibleMemberMap = - visibleMemberMaps[VisibleMemberMap.PROPERTIES]; - addSummary(writer, visibleMemberMap, true, memberSummaryTree); - } - - /** - * Build the summary for the nested classes. - * - * @param node the XML element that specifies which components to document - * @param memberSummaryTree the content tree to which the documentation will be added - */ - public void buildNestedClassesSummary(XMLNode node, Content memberSummaryTree) { - MemberSummaryWriter writer = - memberSummaryWriters[VisibleMemberMap.INNERCLASSES]; - VisibleMemberMap visibleMemberMap = - visibleMemberMaps[VisibleMemberMap.INNERCLASSES]; - addSummary(writer, visibleMemberMap, true, memberSummaryTree); - } - - /** - * Build the method summary. - * - * @param node the XML element that specifies which components to document - * @param memberSummaryTree the content tree to which the documentation will be added - */ - public void buildMethodsSummary(XMLNode node, Content memberSummaryTree) { - MemberSummaryWriter writer = - memberSummaryWriters[VisibleMemberMap.METHODS]; - VisibleMemberMap visibleMemberMap = - visibleMemberMaps[VisibleMemberMap.METHODS]; - addSummary(writer, visibleMemberMap, true, memberSummaryTree); - } - - /** - * Build the constructor summary. - * - * @param node the XML element that specifies which components to document - * @param memberSummaryTree the content tree to which the documentation will be added - */ - public void buildConstructorsSummary(XMLNode node, Content memberSummaryTree) { - MemberSummaryWriter writer = - memberSummaryWriters[VisibleMemberMap.CONSTRUCTORS]; - VisibleMemberMap visibleMemberMap = - visibleMemberMaps[VisibleMemberMap.CONSTRUCTORS]; - addSummary(writer, visibleMemberMap, false, memberSummaryTree); - } - - /** - * Build the member summary for the given members. - * - * @param writer the summary writer to write the output. - * @param visibleMemberMap the given members to summarize. - * @param summaryTreeList list of content trees to which the documentation will be added - */ - private void buildSummary(MemberSummaryWriter writer, - VisibleMemberMap visibleMemberMap, LinkedList summaryTreeList) { - List members = new ArrayList<>(visibleMemberMap.getLeafClassMembers( - configuration)); - if (members.size() > 0) { - Collections.sort(members); - List tableContents = new LinkedList<>(); - for (int i = 0; i < members.size(); i++) { - ProgramElementDoc member = members.get(i); - final ProgramElementDoc propertyDoc = - visibleMemberMap.getPropertyMemberDoc(member); - if (propertyDoc != null) { - processProperty(visibleMemberMap, member, propertyDoc); - } - Tag[] firstSentenceTags = member.firstSentenceTags(); - if (member instanceof MethodDoc && firstSentenceTags.length == 0) { - //Inherit comments from overriden or implemented method if - //necessary. - DocFinder.Output inheritedDoc = - DocFinder.search(configuration, new DocFinder.Input((MethodDoc) member)); - if (inheritedDoc.holder != null - && inheritedDoc.holder.firstSentenceTags().length > 0) { - firstSentenceTags = inheritedDoc.holder.firstSentenceTags(); - } - } - writer.addMemberSummary(classDoc, member, firstSentenceTags, - tableContents, i); - } - summaryTreeList.add(writer.getSummaryTableTree(classDoc, tableContents)); - } - } - - /** - * Process the property method, property setter and/or property getter - * comment text so that it contains the documentation from - * the property field. The method adds the leading sentence, - * copied documentation including the defaultValue tag and - * the see tags if the appropriate property getter and setter are - * available. - * - * @param visibleMemberMap the members information. - * @param member the member which is to be augmented. - * @param propertyDoc the original property documentation. - */ - private void processProperty(VisibleMemberMap visibleMemberMap, - ProgramElementDoc member, - ProgramElementDoc propertyDoc) { - StringBuilder commentTextBuilder = new StringBuilder(); - final boolean isSetter = isSetter(member); - final boolean isGetter = isGetter(member); - if (isGetter || isSetter) { - //add "[GS]ets the value of the property PROPERTY_NAME." - if (isSetter) { - commentTextBuilder.append( - MessageFormat.format( - configuration.getText("doclet.PropertySetterWithName"), - utils.propertyNameFromMethodName(configuration, member.name()))); - } - if (isGetter) { - commentTextBuilder.append( - MessageFormat.format( - configuration.getText("doclet.PropertyGetterWithName"), - utils.propertyNameFromMethodName(configuration, member.name()))); - } - if (propertyDoc.commentText() != null - && !propertyDoc.commentText().isEmpty()) { - commentTextBuilder.append(" \n @propertyDescription "); - } - } - commentTextBuilder.append(propertyDoc.commentText()); - - // copy certain tags - List allTags = new LinkedList<>(); - String[] tagNames = {"@defaultValue", "@since"}; - for (String tagName: tagNames) { - Tag[] tags = propertyDoc.tags(tagName); - if (tags != null) { - allTags.addAll(Arrays.asList(tags)); - } - } - for (Tag tag: allTags) { - commentTextBuilder.append("\n") - .append(tag.name()) - .append(" ") - .append(tag.text()); - } - - //add @see tags - if (!isGetter && !isSetter) { - MethodDoc getter = (MethodDoc) visibleMemberMap.getGetterForProperty(member); - MethodDoc setter = (MethodDoc) visibleMemberMap.getSetterForProperty(member); - - if ((null != getter) - && (commentTextBuilder.indexOf("@see #" + getter.name()) == -1)) { - commentTextBuilder.append("\n @see #") - .append(getter.name()) - .append("() "); - } - - if ((null != setter) - && (commentTextBuilder.indexOf("@see #" + setter.name()) == -1)) { - String typeName = setter.parameters()[0].typeName(); - // Removal of type parameters and package information. - typeName = typeName.split("<")[0]; - if (typeName.contains(".")) { - typeName = typeName.substring(typeName.lastIndexOf(".") + 1); - } - commentTextBuilder.append("\n @see #").append(setter.name()); - - if (setter.parameters()[0].type().asTypeVariable() == null) { - commentTextBuilder.append("(").append(typeName).append(")"); - } - commentTextBuilder.append(" \n"); - } - } - member.setRawCommentText(commentTextBuilder.toString()); - } - /** - * Test whether the method is a getter. - * @param ped property method documentation. Needs to be either property - * method, property getter, or property setter. - * @return true if the given documentation belongs to a getter. - */ - private boolean isGetter(ProgramElementDoc ped) { - final String pedName = ped.name(); - return pedName.startsWith("get") || pedName.startsWith("is"); - } - - /** - * Test whether the method is a setter. - * @param ped property method documentation. Needs to be either property - * method, property getter, or property setter. - * @return true if the given documentation belongs to a setter. - */ - private boolean isSetter(ProgramElementDoc ped) { - return ped.name().startsWith("set"); - } - - /** - * Build the inherited member summary for the given methods. - * - * @param writer the writer for this member summary. - * @param visibleMemberMap the map for the members to document. - * @param summaryTreeList list of content trees to which the documentation will be added - */ - private void buildInheritedSummary(MemberSummaryWriter writer, - VisibleMemberMap visibleMemberMap, LinkedList summaryTreeList) { - for (ClassDoc inhclass : visibleMemberMap.getVisibleClassesList()) { - if (!(inhclass.isPublic() || - utils.isLinkable(inhclass, configuration))) { - continue; - } - if (inhclass == classDoc) { - continue; - } - List inhmembers = visibleMemberMap.getMembersFor(inhclass); - if (inhmembers.size() > 0) { - Collections.sort(inhmembers); - Content inheritedTree = writer.getInheritedSummaryHeader(inhclass); - Content linksTree = writer.getInheritedSummaryLinksTree(); - for (int j = 0; j < inhmembers.size(); ++j) { - writer.addInheritedMemberSummary( - inhclass.isPackagePrivate() && - !utils.isLinkable(inhclass, configuration) ? - classDoc : inhclass, - inhmembers.get(j), - j == 0, - j == inhmembers.size() - 1, linksTree); - } - inheritedTree.addContent(linksTree); - summaryTreeList.add(writer.getMemberTree(inheritedTree)); - } - } - } - - /** - * Add the summary for the documentation. - * - * @param writer the writer for this member summary. - * @param visibleMemberMap the map for the members to document. - * @param showInheritedSummary true if inherited summary should be documented - * @param memberSummaryTree the content tree to which the documentation will be added - */ - private void addSummary(MemberSummaryWriter writer, - VisibleMemberMap visibleMemberMap, boolean showInheritedSummary, - Content memberSummaryTree) { - LinkedList summaryTreeList = new LinkedList<>(); - buildSummary(writer, visibleMemberMap, summaryTreeList); - if (showInheritedSummary) - buildInheritedSummary(writer, visibleMemberMap, summaryTreeList); - if (!summaryTreeList.isEmpty()) { - Content memberTree = writer.getMemberSummaryHeader( - classDoc, memberSummaryTree); - for (Content aSummaryTreeList : summaryTreeList) { - memberTree.addContent(aSummaryTreeList); - } - writer.addMemberTree(memberSummaryTree, memberTree); - } - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; - -/** - * Builds documentation for a method. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class MethodBuilder extends AbstractMemberBuilder { - - /** - * The index of the current field that is being documented at this point - * in time. - */ - private int currentMethodIndex; - - /** - * The class whose methods are being documented. - */ - private final ClassDoc classDoc; - - /** - * The visible methods for the given class. - */ - private final VisibleMemberMap visibleMemberMap; - - /** - * The writer to output the method documentation. - */ - private final MethodWriter writer; - - /** - * The methods being documented. - */ - private List methods; - - - /** - * Construct a new MethodBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - private MethodBuilder(Context context, - ClassDoc classDoc, - MethodWriter writer) { - super(context); - this.classDoc = classDoc; - this.writer = writer; - visibleMemberMap = new VisibleMemberMap( - classDoc, - VisibleMemberMap.METHODS, - configuration); - methods = - new ArrayList<>(visibleMemberMap.getLeafClassMembers(configuration)); - if (configuration.getMemberComparator() != null) { - Collections.sort(methods, configuration.getMemberComparator()); - } - } - - /** - * Construct a new MethodBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - * - * @return an instance of a MethodBuilder. - */ - public static MethodBuilder getInstance(Context context, - ClassDoc classDoc, MethodWriter writer) { - return new MethodBuilder(context, classDoc, writer); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return "MethodDetails"; - } - - /** - * Returns a list of methods that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @return a list of methods that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Returns the visible member map for the methods of this class. - * - * @return the visible member map for the methods of this class. - */ - public VisibleMemberMap getVisibleMemberMap() { - return visibleMemberMap; - } - - /** - * {@inheritDoc} - */ - public boolean hasMembersToDocument() { - return methods.size() > 0; - } - - /** - * Build the method documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildMethodDoc(XMLNode node, Content memberDetailsTree) { - if (writer == null) { - return; - } - int size = methods.size(); - if (size > 0) { - Content methodDetailsTree = writer.getMethodDetailsTreeHeader( - classDoc, memberDetailsTree); - for (currentMethodIndex = 0; currentMethodIndex < size; - currentMethodIndex++) { - Content methodDocTree = writer.getMethodDocTreeHeader( - (MethodDoc) methods.get(currentMethodIndex), - methodDetailsTree); - buildChildren(node, methodDocTree); - methodDetailsTree.addContent(writer.getMethodDoc( - methodDocTree, (currentMethodIndex == size - 1))); - } - memberDetailsTree.addContent( - writer.getMethodDetails(methodDetailsTree)); - } - } - - /** - * Build the signature. - * - * @param node the XML element that specifies which components to document - * @param methodDocTree the content tree to which the documentation will be added - */ - public void buildSignature(XMLNode node, Content methodDocTree) { - methodDocTree.addContent( - writer.getSignature((MethodDoc) methods.get(currentMethodIndex))); - } - - /** - * Build the deprecation information. - * - * @param node the XML element that specifies which components to document - * @param methodDocTree the content tree to which the documentation will be added - */ - public void buildDeprecationInfo(XMLNode node, Content methodDocTree) { - writer.addDeprecated( - (MethodDoc) methods.get(currentMethodIndex), methodDocTree); - } - - /** - * Build the comments for the method. Do nothing if - * {@link Configuration#nocomment} is set to true. - * - * @param node the XML element that specifies which components to document - * @param methodDocTree the content tree to which the documentation will be added - */ - public void buildMethodComments(XMLNode node, Content methodDocTree) { - if (!configuration.nocomment) { - MethodDoc method = (MethodDoc) methods.get(currentMethodIndex); - - if (method.inlineTags().length == 0) { - DocFinder.Output docs = DocFinder.search(configuration, - new DocFinder.Input(method)); - method = docs.inlineTags != null && docs.inlineTags.length > 0 ? - (MethodDoc) docs.holder : method; - } - //NOTE: When we fix the bug where ClassDoc.interfaceTypes() does - // not pass all implemented interfaces, holder will be the - // interface type. For now, it is really the erasure. - writer.addComments(method.containingClass(), method, methodDocTree); - } - } - - /** - * Build the tag information. - * - * @param node the XML element that specifies which components to document - * @param methodDocTree the content tree to which the documentation will be added - */ - public void buildTagInfo(XMLNode node, Content methodDocTree) { - writer.addTags((MethodDoc) methods.get(currentMethodIndex), - methodDocTree); - } - - /** - * Return the method writer for this builder. - * - * @return the method writer for this builder. - */ - public MethodWriter getWriter() { - return writer; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.io.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; - -/** - * Builds the summary for a given package. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class PackageSummaryBuilder extends AbstractBuilder { - /** - * The root element of the package summary XML is {@value}. - */ - public static final String ROOT = "PackageDoc"; - - /** - * The package being documented. - */ - private final PackageDoc packageDoc; - - /** - * The doclet specific writer that will output the result. - */ - private final PackageSummaryWriter packageWriter; - - /** - * The content that will be added to the package summary documentation tree. - */ - private Content contentTree; - - /** - * Construct a new PackageSummaryBuilder. - * - * @param context the build context. - * @param pkg the package being documented. - * @param packageWriter the doclet specific writer that will output the - * result. - */ - private PackageSummaryBuilder(Context context, - PackageDoc pkg, - PackageSummaryWriter packageWriter) { - super(context); - this.packageDoc = pkg; - this.packageWriter = packageWriter; - } - - /** - * Construct a new PackageSummaryBuilder. - * - * @param context the build context. - * @param pkg the package being documented. - * @param packageWriter the doclet specific writer that will output the - * result. - * - * @return an instance of a PackageSummaryBuilder. - */ - public static PackageSummaryBuilder getInstance(Context context, - PackageDoc pkg, PackageSummaryWriter packageWriter) { - return new PackageSummaryBuilder(context, pkg, packageWriter); - } - - /** - * Build the package summary. - */ - public void build() throws IOException { - if (packageWriter == null) { - //Doclet does not support this output. - return; - } - build(layoutParser.parseXML(ROOT), contentTree); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return ROOT; - } - - /** - * Build the package documentation. - * - * @param node the XML element that specifies which components to document - * @param contentTree the content tree to which the documentation will be added - */ - public void buildPackageDoc(XMLNode node, Content contentTree) throws Exception { - contentTree = packageWriter.getPackageHeader(utils.getPackageName(packageDoc)); - buildChildren(node, contentTree); - packageWriter.addPackageFooter(contentTree); - packageWriter.printDocument(contentTree); - packageWriter.close(); - utils.copyDocFiles(configuration, packageDoc); - } - - /** - * Build the content for the package doc. - * - * @param node the XML element that specifies which components to document - * @param contentTree the content tree to which the package contents - * will be added - */ - public void buildContent(XMLNode node, Content contentTree) { - Content packageContentTree = packageWriter.getContentHeader(); - buildChildren(node, packageContentTree); - packageWriter.addPackageContent(contentTree, packageContentTree); - } - - /** - * Build the package summary. - * - * @param node the XML element that specifies which components to document - * @param packageContentTree the package content tree to which the summaries will - * be added - */ - public void buildSummary(XMLNode node, Content packageContentTree) { - Content summaryContentTree = packageWriter.getSummaryHeader(); - buildChildren(node, summaryContentTree); - packageContentTree.addContent(summaryContentTree); - } - - /** - * Build the summary for the interfaces in this package. - * - * @param node the XML element that specifies which components to document - * @param summaryContentTree the summary tree to which the interface summary - * will be added - */ - public void buildInterfaceSummary(XMLNode node, Content summaryContentTree) { - String interfaceTableSummary = - configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Interface_Summary"), - configuration.getText("doclet.interfaces")); - String[] interfaceTableHeader = new String[] { - configuration.getText("doclet.Interface"), - configuration.getText("doclet.Description") - }; - ClassDoc[] interfaces = - packageDoc.isIncluded() - ? packageDoc.interfaces() - : configuration.classDocCatalog.interfaces( - utils.getPackageName(packageDoc)); - interfaces = utils.filterOutPrivateClasses(interfaces, configuration.javafx); - if (interfaces.length > 0) { - packageWriter.addClassesSummary( - interfaces, - configuration.getText("doclet.Interface_Summary"), - interfaceTableSummary, interfaceTableHeader, summaryContentTree); - } - } - - /** - * Build the summary for the classes in this package. - * - * @param node the XML element that specifies which components to document - * @param summaryContentTree the summary tree to which the class summary will - * be added - */ - public void buildClassSummary(XMLNode node, Content summaryContentTree) { - String classTableSummary = - configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Class_Summary"), - configuration.getText("doclet.classes")); - String[] classTableHeader = new String[] { - configuration.getText("doclet.Class"), - configuration.getText("doclet.Description") - }; - ClassDoc[] classes = - packageDoc.isIncluded() - ? packageDoc.ordinaryClasses() - : configuration.classDocCatalog.ordinaryClasses( - utils.getPackageName(packageDoc)); - classes = utils.filterOutPrivateClasses(classes, configuration.javafx); - if (classes.length > 0) { - packageWriter.addClassesSummary( - classes, - configuration.getText("doclet.Class_Summary"), - classTableSummary, classTableHeader, summaryContentTree); - } - } - - /** - * Build the summary for the enums in this package. - * - * @param node the XML element that specifies which components to document - * @param summaryContentTree the summary tree to which the enum summary will - * be added - */ - public void buildEnumSummary(XMLNode node, Content summaryContentTree) { - String enumTableSummary = - configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Enum_Summary"), - configuration.getText("doclet.enums")); - String[] enumTableHeader = new String[] { - configuration.getText("doclet.Enum"), - configuration.getText("doclet.Description") - }; - ClassDoc[] enums = - packageDoc.isIncluded() - ? packageDoc.enums() - : configuration.classDocCatalog.enums( - utils.getPackageName(packageDoc)); - enums = utils.filterOutPrivateClasses(enums, configuration.javafx); - if (enums.length > 0) { - packageWriter.addClassesSummary( - enums, - configuration.getText("doclet.Enum_Summary"), - enumTableSummary, enumTableHeader, summaryContentTree); - } - } - - /** - * Build the summary for the exceptions in this package. - * - * @param node the XML element that specifies which components to document - * @param summaryContentTree the summary tree to which the exception summary will - * be added - */ - public void buildExceptionSummary(XMLNode node, Content summaryContentTree) { - String exceptionTableSummary = - configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Exception_Summary"), - configuration.getText("doclet.exceptions")); - String[] exceptionTableHeader = new String[] { - configuration.getText("doclet.Exception"), - configuration.getText("doclet.Description") - }; - ClassDoc[] exceptions = - packageDoc.isIncluded() - ? packageDoc.exceptions() - : configuration.classDocCatalog.exceptions( - utils.getPackageName(packageDoc)); - exceptions = utils.filterOutPrivateClasses(exceptions, configuration.javafx); - if (exceptions.length > 0) { - packageWriter.addClassesSummary( - exceptions, - configuration.getText("doclet.Exception_Summary"), - exceptionTableSummary, exceptionTableHeader, summaryContentTree); - } - } - - /** - * Build the summary for the errors in this package. - * - * @param node the XML element that specifies which components to document - * @param summaryContentTree the summary tree to which the error summary will - * be added - */ - public void buildErrorSummary(XMLNode node, Content summaryContentTree) { - String errorTableSummary = - configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Error_Summary"), - configuration.getText("doclet.errors")); - String[] errorTableHeader = new String[] { - configuration.getText("doclet.Error"), - configuration.getText("doclet.Description") - }; - ClassDoc[] errors = - packageDoc.isIncluded() - ? packageDoc.errors() - : configuration.classDocCatalog.errors( - utils.getPackageName(packageDoc)); - errors = utils.filterOutPrivateClasses(errors, configuration.javafx); - if (errors.length > 0) { - packageWriter.addClassesSummary( - errors, - configuration.getText("doclet.Error_Summary"), - errorTableSummary, errorTableHeader, summaryContentTree); - } - } - - /** - * Build the summary for the annotation type in this package. - * - * @param node the XML element that specifies which components to document - * @param summaryContentTree the summary tree to which the annotation type - * summary will be added - */ - public void buildAnnotationTypeSummary(XMLNode node, Content summaryContentTree) { - String annotationtypeTableSummary = - configuration.getText("doclet.Member_Table_Summary", - configuration.getText("doclet.Annotation_Types_Summary"), - configuration.getText("doclet.annotationtypes")); - String[] annotationtypeTableHeader = new String[] { - configuration.getText("doclet.AnnotationType"), - configuration.getText("doclet.Description") - }; - ClassDoc[] annotationTypes = - packageDoc.isIncluded() - ? packageDoc.annotationTypes() - : configuration.classDocCatalog.annotationTypes( - utils.getPackageName(packageDoc)); - annotationTypes = utils.filterOutPrivateClasses(annotationTypes, configuration.javafx); - if (annotationTypes.length > 0) { - packageWriter.addClassesSummary( - annotationTypes, - configuration.getText("doclet.Annotation_Types_Summary"), - annotationtypeTableSummary, annotationtypeTableHeader, - summaryContentTree); - } - } - - /** - * Build the description of the summary. - * - * @param node the XML element that specifies which components to document - * @param packageContentTree the tree to which the package description will - * be added - */ - public void buildPackageDescription(XMLNode node, Content packageContentTree) { - if (configuration.nocomment) { - return; - } - packageWriter.addPackageDescription(packageContentTree); - } - - /** - * Build the tags of the summary. - * - * @param node the XML element that specifies which components to document - * @param packageContentTree the tree to which the package tags will be added - */ - public void buildPackageTags(XMLNode node, Content packageContentTree) { - if (configuration.nocomment) { - return; - } - packageWriter.addPackageTags(packageContentTree); - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PropertyBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PropertyBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PropertyBuilder.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.*; - -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.javadoc.*; - -/** - * Builds documentation for a property. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.7 - */ -@Deprecated -public class PropertyBuilder extends AbstractMemberBuilder { - - /** - * The class whose properties are being documented. - */ - private final ClassDoc classDoc; - - /** - * The visible properties for the given class. - */ - private final VisibleMemberMap visibleMemberMap; - - /** - * The writer to output the property documentation. - */ - private final PropertyWriter writer; - - /** - * The list of properties being documented. - */ - private final List properties; - - /** - * The index of the current property that is being documented at this point - * in time. - */ - private int currentPropertyIndex; - - /** - * Construct a new PropertyBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - private PropertyBuilder(Context context, - ClassDoc classDoc, - PropertyWriter writer) { - super(context); - this.classDoc = classDoc; - this.writer = writer; - visibleMemberMap = - new VisibleMemberMap( - classDoc, - VisibleMemberMap.PROPERTIES, - configuration); - properties = - new ArrayList<>(visibleMemberMap.getMembersFor(classDoc)); - if (configuration.getMemberComparator() != null) { - Collections.sort(properties, configuration.getMemberComparator()); - } - } - - /** - * Construct a new PropertyBuilder. - * - * @param context the build context. - * @param classDoc the class whoses members are being documented. - * @param writer the doclet specific writer. - */ - public static PropertyBuilder getInstance(Context context, - ClassDoc classDoc, - PropertyWriter writer) { - return new PropertyBuilder(context, classDoc, writer); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return "PropertyDetails"; - } - - /** - * Returns a list of properties that will be documented for the given class. - * This information can be used for doclet specific documentation - * generation. - * - * @param classDoc the {@link ClassDoc} we want to check. - * @return a list of properties that will be documented. - */ - public List members(ClassDoc classDoc) { - return visibleMemberMap.getMembersFor(classDoc); - } - - /** - * Returns the visible member map for the properties of this class. - * - * @return the visible member map for the properties of this class. - */ - public VisibleMemberMap getVisibleMemberMap() { - return visibleMemberMap; - } - - /** - * summaryOrder.size() - */ - public boolean hasMembersToDocument() { - return properties.size() > 0; - } - - /** - * Build the property documentation. - * - * @param node the XML element that specifies which components to document - * @param memberDetailsTree the content tree to which the documentation will be added - */ - public void buildPropertyDoc(XMLNode node, Content memberDetailsTree) { - if (writer == null) { - return; - } - int size = properties.size(); - if (size > 0) { - Content propertyDetailsTree = writer.getPropertyDetailsTreeHeader( - classDoc, memberDetailsTree); - for (currentPropertyIndex = 0; currentPropertyIndex < size; - currentPropertyIndex++) { - Content propertyDocTree = writer.getPropertyDocTreeHeader( - (MethodDoc) properties.get(currentPropertyIndex), - propertyDetailsTree); - buildChildren(node, propertyDocTree); - propertyDetailsTree.addContent(writer.getPropertyDoc( - propertyDocTree, (currentPropertyIndex == size - 1))); - } - memberDetailsTree.addContent( - writer.getPropertyDetails(propertyDetailsTree)); - } - } - - /** - * Build the signature. - * - * @param node the XML element that specifies which components to document - * @param propertyDocTree the content tree to which the documentation will be added - */ - public void buildSignature(XMLNode node, Content propertyDocTree) { - propertyDocTree.addContent( - writer.getSignature((MethodDoc) properties.get(currentPropertyIndex))); - } - - /** - * Build the deprecation information. - * - * @param node the XML element that specifies which components to document - * @param propertyDocTree the content tree to which the documentation will be added - */ - public void buildDeprecationInfo(XMLNode node, Content propertyDocTree) { - writer.addDeprecated( - (MethodDoc) properties.get(currentPropertyIndex), propertyDocTree); - } - - /** - * Build the comments for the property. Do nothing if - * {@link Configuration#nocomment} is set to true. - * - * @param node the XML element that specifies which components to document - * @param propertyDocTree the content tree to which the documentation will be added - */ - public void buildPropertyComments(XMLNode node, Content propertyDocTree) { - if (!configuration.nocomment) { - writer.addComments((MethodDoc) properties.get(currentPropertyIndex), propertyDocTree); - } - } - - /** - * Build the tag information. - * - * @param node the XML element that specifies which components to document - * @param propertyDocTree the content tree to which the documentation will be added - */ - public void buildTagInfo(XMLNode node, Content propertyDocTree) { - writer.addTags((MethodDoc) properties.get(currentPropertyIndex), propertyDocTree); - } - - /** - * Return the property writer for this builder. - * - * @return the property writer for this builder. - */ - public PropertyWriter getWriter() { - return writer; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java +++ /dev/null @@ -1,594 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.io.*; -import java.util.*; - -import com.sun.javadoc.*; -import com.sun.tools.doclets.internal.toolkit.*; -import com.sun.tools.doclets.internal.toolkit.util.*; -import com.sun.tools.javac.util.StringUtils; - -/** - * Builds the serialized form. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - * - * @author Jamie Ho - * @author Bhavesh Patel (Modified) - * @since 1.5 - */ -@Deprecated -public class SerializedFormBuilder extends AbstractBuilder { - - /** - * The root element of the serialized form XML is {@value}. - */ - public static final String NAME = "SerializedForm"; - - /** - * The writer for this builder. - */ - private SerializedFormWriter writer; - - /** - * The writer for serializable fields. - */ - private SerializedFormWriter.SerialFieldWriter fieldWriter; - - /** - * The writer for serializable method documentation. - */ - private SerializedFormWriter.SerialMethodWriter methodWriter; - - /** - * The header for the serial version UID. Save the string - * here instead of the properties file because we do not want - * this string to be localized. - */ - private static final String SERIAL_VERSION_UID_HEADER = "serialVersionUID:"; - - /** - * The current package being documented. - */ - private PackageDoc currentPackage; - - /** - * The current class being documented. - */ - private ClassDoc currentClass; - - /** - * The current member being documented. - */ - protected MemberDoc currentMember; - - /** - * The content that will be added to the serialized form documentation tree. - */ - private Content contentTree; - - - /** - * Construct a new SerializedFormBuilder. - * @param context the build context. - */ - private SerializedFormBuilder(Context context) { - super(context); - } - - /** - * Construct a new SerializedFormBuilder. - * @param context the build context. - */ - public static SerializedFormBuilder getInstance(Context context) { - return new SerializedFormBuilder(context); - } - - /** - * Build the serialized form. - */ - public void build() throws IOException { - if (! serialClassFoundToDocument(configuration.root.classes())) { - //Nothing to document. - return; - } - try { - writer = configuration.getWriterFactory().getSerializedFormWriter(); - if (writer == null) { - //Doclet does not support this output. - return; - } - } catch (Exception e) { - throw new DocletAbortException(e); - } - build(layoutParser.parseXML(NAME), contentTree); - writer.close(); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return NAME; - } - - /** - * Build the serialized form. - * - * @param node the XML element that specifies which components to document - * @param serializedTree content tree to which the documentation will be added - */ - public void buildSerializedForm(XMLNode node, Content serializedTree) throws Exception { - serializedTree = writer.getHeader(configuration.getText( - "doclet.Serialized_Form")); - buildChildren(node, serializedTree); - writer.addFooter(serializedTree); - writer.printDocument(serializedTree); - writer.close(); - } - - /** - * Build the serialized form summaries. - * - * @param node the XML element that specifies which components to document - * @param serializedTree content tree to which the documentation will be added - */ - public void buildSerializedFormSummaries(XMLNode node, Content serializedTree) { - Content serializedSummariesTree = writer.getSerializedSummariesHeader(); - for (PackageDoc pkg : configuration.packages) { - currentPackage = pkg; - buildChildren(node, serializedSummariesTree); - } - serializedTree.addContent(writer.getSerializedContent( - serializedSummariesTree)); - } - - /** - * Build the package serialized form for the current package being processed. - * - * @param node the XML element that specifies which components to document - * @param serializedSummariesTree content tree to which the documentation will be added - */ - public void buildPackageSerializedForm(XMLNode node, Content serializedSummariesTree) { - Content packageSerializedTree = writer.getPackageSerializedHeader(); - String foo = currentPackage.name(); - ClassDoc[] classes = currentPackage.allClasses(false); - if (classes == null || classes.length == 0) { - return; - } - if (!serialInclude(currentPackage)) { - return; - } - if (!serialClassFoundToDocument(classes)) { - return; - } - buildChildren(node, packageSerializedTree); - writer.addPackageSerializedTree(serializedSummariesTree, packageSerializedTree); - } - - /** - * Build the package header. - * - * @param node the XML element that specifies which components to document - * @param packageSerializedTree content tree to which the documentation will be added - */ - public void buildPackageHeader(XMLNode node, Content packageSerializedTree) { - packageSerializedTree.addContent(writer.getPackageHeader( - utils.getPackageName(currentPackage))); - } - - /** - * Build the class serialized form. - * - * @param node the XML element that specifies which components to document - * @param packageSerializedTree content tree to which the documentation will be added - */ - public void buildClassSerializedForm(XMLNode node, Content packageSerializedTree) { - Content classSerializedTree = writer.getClassSerializedHeader(); - ClassDoc[] classes = currentPackage.allClasses(false); - Arrays.sort(classes); - for (ClassDoc classDoc : classes) { - currentClass = classDoc; - fieldWriter = writer.getSerialFieldWriter(currentClass); - methodWriter = writer.getSerialMethodWriter(currentClass); - if (currentClass.isClass() && currentClass.isSerializable()) { - if (!serialClassInclude(currentClass)) { - continue; - } - Content classTree = writer.getClassHeader(currentClass); - buildChildren(node, classTree); - classSerializedTree.addContent(classTree); - } - } - packageSerializedTree.addContent(classSerializedTree); - } - - /** - * Build the serial UID information for the given class. - * - * @param node the XML element that specifies which components to document - * @param classTree content tree to which the serial UID information will be added - */ - public void buildSerialUIDInfo(XMLNode node, Content classTree) { - Content serialUidTree = writer.getSerialUIDInfoHeader(); - for (FieldDoc field : currentClass.fields(false)) { - if (field.name().equals("serialVersionUID") && - field.constantValueExpression() != null) { - writer.addSerialUIDInfo(SERIAL_VERSION_UID_HEADER, - field.constantValueExpression(), serialUidTree); - break; - } - } - classTree.addContent(serialUidTree); - } - - /** - * Build the summaries for the methods and fields. - * - * @param node the XML element that specifies which components to document - * @param classTree content tree to which the documentation will be added - */ - public void buildClassContent(XMLNode node, Content classTree) { - Content classContentTree = writer.getClassContentHeader(); - buildChildren(node, classContentTree); - classTree.addContent(classContentTree); - } - - /** - * Build the summaries for the methods that belong to the given - * class. - * - * @param node the XML element that specifies which components to document - * @param classContentTree content tree to which the documentation will be added - */ - public void buildSerializableMethods(XMLNode node, Content classContentTree) { - Content serializableMethodTree = methodWriter.getSerializableMethodsHeader(); - MemberDoc[] members = currentClass.serializationMethods(); - int membersLength = members.length; - if (membersLength > 0) { - for (int i = 0; i < membersLength; i++) { - currentMember = members[i]; - Content methodsContentTree = methodWriter.getMethodsContentHeader( - (i == membersLength - 1)); - buildChildren(node, methodsContentTree); - serializableMethodTree.addContent(methodsContentTree); - } - } - if (currentClass.serializationMethods().length > 0) { - classContentTree.addContent(methodWriter.getSerializableMethods( - configuration.getText("doclet.Serialized_Form_methods"), - serializableMethodTree)); - if (currentClass.isSerializable() && !currentClass.isExternalizable()) { - if (currentClass.serializationMethods().length == 0) { - Content noCustomizationMsg = methodWriter.getNoCustomizationMsg( - configuration.getText( - "doclet.Serializable_no_customization")); - classContentTree.addContent(methodWriter.getSerializableMethods( - configuration.getText("doclet.Serialized_Form_methods"), - noCustomizationMsg)); - } - } - } - } - - /** - * Build the method sub header. - * - * @param node the XML element that specifies which components to document - * @param methodsContentTree content tree to which the documentation will be added - */ - public void buildMethodSubHeader(XMLNode node, Content methodsContentTree) { - methodWriter.addMemberHeader((MethodDoc)currentMember, methodsContentTree); - } - - /** - * Build the deprecated method description. - * - * @param node the XML element that specifies which components to document - * @param methodsContentTree content tree to which the documentation will be added - */ - public void buildDeprecatedMethodInfo(XMLNode node, Content methodsContentTree) { - methodWriter.addDeprecatedMemberInfo((MethodDoc) currentMember, methodsContentTree); - } - - /** - * Build the information for the method. - * - * @param node the XML element that specifies which components to document - * @param methodsContentTree content tree to which the documentation will be added - */ - public void buildMethodInfo(XMLNode node, Content methodsContentTree) { - if(configuration.nocomment){ - return; - } - buildChildren(node, methodsContentTree); - } - - /** - * Build method description. - * - * @param node the XML element that specifies which components to document - * @param methodsContentTree content tree to which the documentation will be added - */ - public void buildMethodDescription(XMLNode node, Content methodsContentTree) { - methodWriter.addMemberDescription((MethodDoc) currentMember, methodsContentTree); - } - - /** - * Build the method tags. - * - * @param node the XML element that specifies which components to document - * @param methodsContentTree content tree to which the documentation will be added - */ - public void buildMethodTags(XMLNode node, Content methodsContentTree) { - methodWriter.addMemberTags((MethodDoc) currentMember, methodsContentTree); - MethodDoc method = (MethodDoc)currentMember; - if (method.name().compareTo("writeExternal") == 0 - && method.tags("serialData").length == 0) { - if (configuration.serialwarn) { - configuration.getDocletSpecificMsg().warning( - currentMember.position(), "doclet.MissingSerialDataTag", - method.containingClass().qualifiedName(), method.name()); - } - } - } - - /** - * Build the field header. - * - * @param node the XML element that specifies which components to document - * @param classContentTree content tree to which the documentation will be added - */ - public void buildFieldHeader(XMLNode node, Content classContentTree) { - if (currentClass.serializableFields().length > 0) { - buildFieldSerializationOverview(currentClass, classContentTree); - } - } - - /** - * Build the serialization overview for the given class. - * - * @param classDoc the class to print the overview for. - * @param classContentTree content tree to which the documentation will be added - */ - public void buildFieldSerializationOverview(ClassDoc classDoc, Content classContentTree) { - if (classDoc.definesSerializableFields()) { - FieldDoc serialPersistentField = classDoc.serializableFields()[0]; - // Check to see if there are inline comments, tags or deprecation - // information to be printed. - if (fieldWriter.shouldPrintOverview(serialPersistentField)) { - Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader(); - Content fieldsOverviewContentTree = fieldWriter.getFieldsContentHeader(true); - fieldWriter.addMemberDeprecatedInfo(serialPersistentField, - fieldsOverviewContentTree); - if (!configuration.nocomment) { - fieldWriter.addMemberDescription(serialPersistentField, - fieldsOverviewContentTree); - fieldWriter.addMemberTags(serialPersistentField, - fieldsOverviewContentTree); - } - serializableFieldsTree.addContent(fieldsOverviewContentTree); - classContentTree.addContent(fieldWriter.getSerializableFields( - configuration.getText("doclet.Serialized_Form_class"), - serializableFieldsTree)); - } - } - } - - /** - * Build the summaries for the fields that belong to the given class. - * - * @param node the XML element that specifies which components to document - * @param classContentTree content tree to which the documentation will be added - */ - public void buildSerializableFields(XMLNode node, Content classContentTree) { - MemberDoc[] members = currentClass.serializableFields(); - int membersLength = members.length; - if (membersLength > 0) { - Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader(); - for (int i = 0; i < membersLength; i++) { - currentMember = members[i]; - if (!currentClass.definesSerializableFields()) { - Content fieldsContentTree = fieldWriter.getFieldsContentHeader( - (i == membersLength - 1)); - buildChildren(node, fieldsContentTree); - serializableFieldsTree.addContent(fieldsContentTree); - } - else { - buildSerialFieldTagsInfo(serializableFieldsTree); - } - } - classContentTree.addContent(fieldWriter.getSerializableFields( - configuration.getText("doclet.Serialized_Form_fields"), - serializableFieldsTree)); - } - } - - /** - * Build the field sub header. - * - * @param node the XML element that specifies which components to document - * @param fieldsContentTree content tree to which the documentation will be added - */ - public void buildFieldSubHeader(XMLNode node, Content fieldsContentTree) { - if (!currentClass.definesSerializableFields()) { - FieldDoc field = (FieldDoc) currentMember; - fieldWriter.addMemberHeader(field.type().asClassDoc(), - field.type().typeName(), field.type().dimension(), field.name(), - fieldsContentTree); - } - } - - /** - * Build the field deprecation information. - * - * @param node the XML element that specifies which components to document - * @param fieldsContentTree content tree to which the documentation will be added - */ - public void buildFieldDeprecationInfo(XMLNode node, Content fieldsContentTree) { - if (!currentClass.definesSerializableFields()) { - FieldDoc field = (FieldDoc)currentMember; - fieldWriter.addMemberDeprecatedInfo(field, fieldsContentTree); - } - } - - /** - * Build the serial field tags information. - * - * @param serializableFieldsTree content tree to which the documentation will be added - */ - public void buildSerialFieldTagsInfo(Content serializableFieldsTree) { - if(configuration.nocomment){ - return; - } - FieldDoc field = (FieldDoc)currentMember; - // Process Serializable Fields specified as array of - // ObjectStreamFields. Print a member for each serialField tag. - // (There should be one serialField tag per ObjectStreamField - // element.) - SerialFieldTag[] tags = field.serialFieldTags(); - Arrays.sort(tags); - int tagsLength = tags.length; - for (int i = 0; i < tagsLength; i++) { - if (tags[i].fieldName() == null || tags[i].fieldType() == null) // ignore malformed @serialField tags - continue; - Content fieldsContentTree = fieldWriter.getFieldsContentHeader( - (i == tagsLength - 1)); - fieldWriter.addMemberHeader(tags[i].fieldTypeDoc(), - tags[i].fieldType(), "", tags[i].fieldName(), fieldsContentTree); - fieldWriter.addMemberDescription(tags[i], fieldsContentTree); - serializableFieldsTree.addContent(fieldsContentTree); - } - } - - /** - * Build the field information. - * - * @param node the XML element that specifies which components to document - * @param fieldsContentTree content tree to which the documentation will be added - */ - public void buildFieldInfo(XMLNode node, Content fieldsContentTree) { - if(configuration.nocomment){ - return; - } - FieldDoc field = (FieldDoc)currentMember; - ClassDoc cd = field.containingClass(); - // Process default Serializable field. - if ((field.tags("serial").length == 0) && ! field.isSynthetic() - && configuration.serialwarn) { - configuration.message.warning(field.position(), - "doclet.MissingSerialTag", cd.qualifiedName(), - field.name()); - } - fieldWriter.addMemberDescription(field, fieldsContentTree); - fieldWriter.addMemberTags(field, fieldsContentTree); - } - - /** - * Return true if the given Doc should be included - * in the serialized form. - * - * @param doc the Doc object to check for serializability. - */ - public static boolean serialInclude(Doc doc) { - if (doc == null) { - return false; - } - return doc.isClass() ? - serialClassInclude((ClassDoc)doc) : - serialDocInclude(doc); - } - - /** - * Return true if the given ClassDoc should be included - * in the serialized form. - * - * @param cd the ClassDoc object to check for serializability. - */ - private static boolean serialClassInclude(ClassDoc cd) { - if (cd.isEnum()) { - return false; - } - try { - cd.superclassType(); - } catch (NullPointerException e) { - //Workaround for null pointer bug in ClassDoc.superclassType(). - return false; - } - if (cd.isSerializable()) { - if (cd.tags("serial").length > 0) { - return serialDocInclude(cd); - } else if (cd.isPublic() || cd.isProtected()) { - return true; - } else { - return false; - } - } - return false; - } - - /** - * Return true if the given Doc should be included - * in the serialized form. - * - * @param doc the Doc object to check for serializability. - */ - private static boolean serialDocInclude(Doc doc) { - if (doc.isEnum()) { - return false; - } - Tag[] serial = doc.tags("serial"); - if (serial.length > 0) { - String serialtext = StringUtils.toLowerCase(serial[0].text()); - if (serialtext.contains("exclude")) { - return false; - } else if (serialtext.contains("include")) { - return true; - } - } - return true; - } - - /** - * Return true if any of the given classes have a @serialinclude tag. - * - * @param classes the classes to check. - * @return true if any of the given classes have a @serialinclude tag. - */ - private boolean serialClassFoundToDocument(ClassDoc[] classes) { - for (ClassDoc aClass : classes) { - if (serialClassInclude(aClass)) { - return true; - } - } - return false; - } -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/XMLNode.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/XMLNode.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/XMLNode.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.sun.tools.doclets.internal.toolkit.builders; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Simple class to represent the attribute and elements of an XML node. - * - *

This is NOT part of any supported API. - * If you write code that depends on this, you do so at your own risk. - * This code and its internal interfaces are subject to change or - * deletion without notice. - */ -@Deprecated -public class XMLNode { - XMLNode(XMLNode parent, String qname) { - this.parent = parent; - name = qname; - attrs = new HashMap<>(); - children = new ArrayList<>(); - - if (parent != null) - parent.children.add(this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("<"); - sb.append(name); - for (Map.Entry e: attrs.entrySet()) - sb.append(" " + e.getKey() + "=\"" + e.getValue() + "\""); - if (children.size() == 0) - sb.append("/>"); - else { - sb.append(">"); - for (XMLNode c: children) - sb.append(c.toString()); - sb.append(""); - } - return sb.toString(); - } - - final XMLNode parent; - final String name; - final Map attrs; - final List children; -} diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package-info.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package-info.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package-info.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - This doclet-independent package has a set of classes and - interfaces that are the building blocks for doclets. They - define the basic structure of doclets and make doclet - writing much easier because they provide the content generation - code to be shared among different doclets. Builders only provide - the structure and content of API documentation. - They will not provide any style markup. - -

This is NOT part of any supported API. - If you write code that depends on this, you do so at your own risk. - This code and its internal interfaces are subject to change or - deletion without notice. -*/ - -package com.sun.tools.doclets.internal.toolkit.builders; diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/package-info.java b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/package-info.java deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/package-info.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - Contains the base classes that make up a doclet. Doclets that reuse - the functionality provided by the toolkit should have the following - characteristics: -

    -
  • - The main driver class should extend - {@link com.sun.tools.doclets.internal.toolkit.AbstractDoclet}. -
  • -
  • - The doclet configuration class should extend - {@link com.sun.tools.doclets.internal.toolkit.Configuration}. -
  • -
  • - The doclet should have a writer factory that implements - {@link com.sun.tools.doclets.internal.toolkit.WriterFactory}. - This class constructs writers that write doclet specific output. -
  • -
  • - The doclet should have a taglet writer that extends - {@link com.sun.tools.doclets.internal.toolkit.taglets.TagletWriter}. - This writer determines how to output each given tag. -
  • -
- -

This is NOT part of any supported API. - If you write code that depends on this, you do so at your own risk. - This code and its internal interfaces are subject to change or - deletion without notice. -*/ - -package com.sun.tools.doclets.internal.toolkit; diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties +++ /dev/null @@ -1,219 +0,0 @@ -doclet.Generating_0=Generating {0}... -doclet.Toolkit_Usage_Violation=The Doclet Toolkit can only be used by {0} -doclet.MissingSerialTag=in class {0}, missing @serial tag for default serializable field: {1}. -doclet.MissingSerialDataTag=in class {0}, missing @serialData tag in method {1}. -doclet.Serializable_no_customization=No readObject or writeObject method declared. -doclet.Serialized_Form=Serialized Form -doclet.Serialized_Form_methods=Serialization Methods -doclet.Serialized_Form_fields=Serialized Fields -doclet.Serialized_Form_class=Serialization Overview -doclet.Class_0_implements_serializable=Class {0} implements Serializable -doclet.Class_0_extends_implements_serializable=Class {0} extends {1} implements Serializable -doclet.Option_conflict=Option {0} conflicts with {1} -doclet.Option_reuse=Option reused: {0} -doclet.Option_doclint_no_qualifiers=Access qualifiers not permitted for -Xdoclint arguments -doclet.Option_doclint_invalid_arg=Invalid argument for -Xdoclint option -doclet.Option_doclint_package_invalid_arg=Invalid argument for -Xdoclint/package option -doclet.exception_encountered= {0} encountered \n\ -\twhile attempting to create file: {1} -doclet.perform_copy_exception_encountered= {0} encountered while \n\ -performing copy. -doclet.File_not_found=File not found: {0} -doclet.Copy_Overwrite_warning=File {0} not copied to {1} due to existing file with same name... -doclet.Copying_File_0_To_Dir_1=Copying file {0} to directory {1}... -doclet.Copying_File_0_To_File_1=Copying file {0} to file {1}... -doclet.No_Public_Classes_To_Document=No public or protected classes found to document. -doclet.destination_directory_not_directory_0=Destination directory is not a directory {0} -doclet.destination_directory_not_writable_0=Destination directory not writable {0} -doclet.Encoding_not_supported=Encoding not supported: {0} -doclet.Building_Tree=Building tree for all the packages and classes... -doclet.Building_Index=Building index for all the packages and classes... -doclet.Building_Index_For_All_Classes=Building index for all classes... -doclet.JavaScript_in_option=Argument for {0} contains JavaScript.\n\ -Use --allow-script-in-comments to allow use of JavaScript. -doclet.sourcetab_warning=The argument for -sourcetab must be an integer greater than 0. -doclet.Packages=Packages -doclet.Other_Packages=Other Packages -doclet.Notice_taglet_registered=Registered Taglet {0} ... -doclet.Notice_taglet_unseen=Note: Custom tags that were not seen: {0} -doclet.Notice_taglet_overriden=Note: Custom tags that override standard tags: {0} -doclet.Notice_taglet_conflict_warn=Note: Custom tags that could override future standard tags: {0}. To avoid potential overrides, use at least one period character (.) in custom tag names. -doclet.Error_taglet_not_registered=Error - Exception {0} thrown while trying to register Taglet {1}... -doclet.Error_invalid_custom_tag_argument=Error - {0} is an invalid argument to the -tag option... -doclet.Author=Author: -doclet.DefaultValue=Default value: -doclet.PropertyDescription=Property description: -doclet.PropertyGetter=Gets the value of the property -doclet.PropertySetter=Sets the value of the property -doclet.PropertyGetterWithName=Gets the value of the property {0}. -doclet.PropertySetterWithName=Sets the value of the property {0}. -doclet.Default=Default: -doclet.Parameters=Parameters: -doclet.TypeParameters=Type Parameters: -doclet.Parameters_warn=@param argument "{0}" is not a parameter name. -doclet.Parameters_dup_warn=Parameter "{0}" is documented more than once. -doclet.Type_Parameters_warn=@param argument "{0}" is not a type parameter name. -doclet.Type_Parameters_dup_warn=Type parameter "{0}" is documented more than once. -doclet.Returns=Returns: -doclet.Return_tag_on_void_method=@return tag cannot be used in method with void return type. -doclet.See_Also=See Also: -doclet.See=See: -doclet.SerialData=Serial Data: -doclet.Since=Since: -doclet.Throws=Throws: -doclet.Version=Version: -doclet.Factory=Factory: -doclet.UnknownTag={0} is an unknown tag. -doclet.UnknownTagLowercase={0} is an unknown tag -- same as a known tag except for case. -doclet.noInheritedDoc=@inheritDoc used but {0} does not override or implement any method. -doclet.malformed_html_link_tag= tag is malformed:\n"{0}" -doclet.tag_misuse=Tag {0} cannot be used in {1} documentation. It can only be used in the following types of documentation: {2}. -doclet.javafx_tag_misuse=Tags @propertyGetter, @propertySetter and @propertyDescription can only be used in JavaFX properties getters and setters. -doclet.Package_Summary=Package Summary -doclet.Interface_Summary=Interface Summary -doclet.Annotation_Types_Summary=Annotation Types Summary -doclet.Enum_Summary=Enum Summary -doclet.Exception_Summary=Exception Summary -doclet.Error_Summary=Error Summary -doclet.Class_Summary=Class Summary -doclet.Nested_Class_Summary=Nested Class Summary -doclet.Annotation_Type_Optional_Member_Summary=Optional Element Summary -doclet.Annotation_Type_Required_Member_Summary=Required Element Summary -doclet.Field_Summary=Field Summary -doclet.Property_Summary=Property Summary -doclet.Enum_Constant_Summary=Enum Constant Summary -doclet.Constructor_Summary=Constructor Summary -doclet.Method_Summary=Method Summary -doclet.Interfaces=Interfaces -doclet.Enums=Enums -doclet.AnnotationTypes=Annotation Types -doclet.Exceptions=Exceptions -doclet.Errors=Errors -doclet.Classes=Classes -doclet.Packages=Packages -doclet.packages=packages -doclet.All_Classes=All Classes -doclet.All_Superinterfaces=All Superinterfaces: -doclet.All_Implemented_Interfaces=All Implemented Interfaces: -doclet.All_classes_and_interfaces=All classes and interfaces (except non-static nested types) -doclet.Package_class_and_interface_descriptions=Package, class and interface descriptions -doclet.Interface=Interface -doclet.Class=Class -doclet.AnnotationType=Annotation Type -doclet.annotationtype=annotation type -doclet.annotationtypes=annotation types -doclet.Enum=Enum -doclet.enum=enum -doclet.enums=enums -doclet.interface=interface -doclet.interfaces=interfaces -doclet.class=class -doclet.classes=classes -doclet.Error=Error -doclet.error=error -doclet.errors=errors -doclet.Exception=Exception -doclet.exception=exception -doclet.exceptions=exceptions -doclet.Package_private=(package private) -doclet.Nested_Classes_Interfaces_Inherited_From_Class=Nested classes/interfaces inherited from class -doclet.Nested_Classes_Interface_Inherited_From_Interface=Nested classes/interfaces inherited from interface -doclet.Methods_Inherited_From_Class=Methods inherited from class -doclet.Methods_Inherited_From_Interface=Methods inherited from interface -doclet.Fields_Inherited_From_Class=Fields inherited from class -doclet.Fields_Inherited_From_Interface=Fields inherited from interface -doclet.Properties_Inherited_From_Class=Properties inherited from class -doclet.Properties_Inherited_From_Interface=Properties inherited from interface -doclet.Annotation_Type_Member_Detail=Element Detail -doclet.Enum_Constant_Detail=Enum Constant Detail -doclet.Constants_Summary=Constant Field Values -doclet.Field_Detail=Field Detail -doclet.Property_Detail=Property Detail -doclet.Method_Detail=Method Detail -doclet.Constructor_Detail=Constructor Detail -doclet.Deprecated=Deprecated. -doclet.Groupname_already_used=In -group option, groupname already used: {0} -doclet.value_tag_invalid_reference={0} (referenced by @value tag) is an unknown reference. -doclet.value_tag_invalid_constant=@value tag (which references {0}) can only be used in constants. -doclet.value_tag_invalid_use=@value tag cannot be used here. -doclet.dest_dir_create=Creating destination directory: "{0}" -doclet.in={0} in {1} -doclet.Use_Table_Summary=Use table, listing {0}, and an explanation -doclet.Constants_Table_Summary={0} table, listing constant fields, and values -doclet.Member_Table_Summary={0} table, listing {1}, and an explanation -doclet.fields=fields -doclet.Fields=Fields -doclet.properties=properties -doclet.Properties=Properties -doclet.constructors=constructors -doclet.Constructors=Constructors -doclet.methods=methods -doclet.Methods=Methods -doclet.All_Methods=All Methods -doclet.Static_Methods=Static Methods -doclet.Instance_Methods=Instance Methods -doclet.Abstract_Methods=Abstract Methods -doclet.Concrete_Methods=Concrete Methods -doclet.Default_Methods=Default Methods -doclet.Deprecated_Methods=Deprecated Methods -doclet.annotation_type_optional_members=optional elements -doclet.Annotation_Type_Optional_Members=Optional Elements -doclet.annotation_type_required_members=required elements -doclet.Annotation_Type_Required_Members=Required Elements -doclet.enum_constants=enum constants -doclet.Enum_Constants=Enum Constants -doclet.nested_classes=nested classes -doclet.Nested_Classes=Nested Classes -doclet.subclasses=subclasses -doclet.subinterfaces=subinterfaces -doclet.Modifier=Modifier -doclet.Type=Type -doclet.Types=Types -doclet.Members=Members -doclet.SearchTags=SearchTags -doclet.search=SEARCH: -doclet.invalid_usage_of_tag=invalid usage of {0} tag. -doclet.Field=Field -doclet.Property=Property -doclet.Constructor=Constructor -doclet.Method=Method -doclet.Annotation_Type_Optional_Member=Optional Element -doclet.Annotation_Type_Required_Member=Required Element -doclet.Annotation_Type_Member=Annotation Type Element -doclet.Enum_Constant=Enum Constant -doclet.Class=Class -doclet.Description=Description -doclet.ConstantField=Constant Field -doclet.Value=Value -doclet.0_and_1={0} and {1} - -#Documentation for Enums -doclet.enum_values_doc.main=\n\ - Returns an array containing the constants of this enum type, in\n\ - the order they are declared. This method may be used to iterate\n\ - over the constants as follows:\n\ -
\n\
- for ({0} c : {0}.values())\n\
-     System.out.println(c);\n\
- 
- -doclet.enum_values_doc.return=\n\ - an array containing the constants of this enum type, in the order they are declared - -doclet.enum_valueof_doc.main=\n\ - Returns the enum constant of this type with the specified name.\n\ - The string must match exactly an identifier used to declare an\n\ - enum constant in this type. (Extraneous whitespace characters are \n\ - not permitted.) - -doclet.enum_valueof_doc.param_name=\ - the name of the enum constant to be returned. - -doclet.enum_valueof_doc.return=\ - the enum constant with the specified name - -doclet.enum_valueof_doc.throws_ila=\ - if this enum type has no constant with the specified name - -doclet.enum_valueof_doc.throws_npe=\ - if the argument is null diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties +++ /dev/null @@ -1,199 +0,0 @@ -doclet.Generating_0={0}\u306E\u751F\u6210\u4E2D... -doclet.Toolkit_Usage_Violation=\u30C9\u30C3\u30AF\u30EC\u30C3\u30C8\u30FB\u30C4\u30FC\u30EB\u30FB\u30AD\u30C3\u30C8\u306F{0}\u306B\u3088\u3063\u3066\u306E\u307F\u4F7F\u7528\u3055\u308C\u307E\u3059 -doclet.MissingSerialTag=\u30AF\u30E9\u30B9{0}\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u76F4\u5217\u5316\u53EF\u80FD\u30D5\u30A3\u30FC\u30EB\u30C9{1}\u306E\u305F\u3081\u306E@serial\u30BF\u30B0\u304C\u3042\u308A\u307E\u305B\u3093\u3002 -doclet.MissingSerialDataTag=\u30AF\u30E9\u30B9{0}\u306E\u30E1\u30BD\u30C3\u30C9{1}\u306B@serialData\u30BF\u30B0\u304C\u3042\u308A\u307E\u305B\u3093\u3002 -doclet.Serializable_no_customization=readObject\u307E\u305F\u306FwriteObject\u30E1\u30BD\u30C3\u30C9\u304C\u5BA3\u8A00\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 -doclet.Serialized_Form=\u76F4\u5217\u5316\u3055\u308C\u305F\u5F62\u5F0F -doclet.Serialized_Form_methods=\u76F4\u5217\u5316\u30E1\u30BD\u30C3\u30C9 -doclet.Serialized_Form_fields=\u76F4\u5217\u5316\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.Serialized_Form_class=\u76F4\u5217\u5316\u306E\u6982\u8981 -doclet.Class_0_implements_serializable=Class {0} implements Serializable -doclet.Class_0_extends_implements_serializable=Class {0} extends {1} implements Serializable -doclet.Option_conflict=\u30AA\u30D7\u30B7\u30E7\u30F3{0}\u304C{1}\u3068\u77DB\u76FE\u3057\u307E\u3059 -doclet.Option_reuse=\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u518D\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0} -doclet.Option_doclint_no_qualifiers=\u30A2\u30AF\u30BB\u30B9\u4FEE\u98FE\u5B50\u306F-Xdoclint\u306E\u5F15\u6570\u306B\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 -doclet.Option_doclint_invalid_arg=-Xdoclint\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059 -doclet.Option_doclint_package_invalid_arg=-Xdoclint/package\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u304C\u7121\u52B9\u3067\u3059 -doclet.exception_encountered= {0}\u3092\u691C\u51FA\n\t\u30D5\u30A1\u30A4\u30EB\u306E\u4F5C\u6210\u4E2D: {1} -doclet.perform_copy_exception_encountered= \u30B3\u30D4\u30FC\u5B9F\u884C\u4E2D\u306B{0}\u3092\n\u691C\u51FA\u3057\u307E\u3057\u305F\u3002 -doclet.File_not_found=\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0} -doclet.Copy_Overwrite_warning=\u30D5\u30A1\u30A4\u30EB{0}\u306F\u540C\u3058\u540D\u524D\u306E\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308B\u306E\u3067{1}\u306B\u30B3\u30D4\u30FC\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F... -doclet.Copying_File_0_To_Dir_1=\u30D5\u30A1\u30A4\u30EB{0}\u3092\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{1}\u306B\u30B3\u30D4\u30FC\u4E2D... -doclet.Copying_File_0_To_File_1=\u30D5\u30A1\u30A4\u30EB{0}\u3092\u30D5\u30A1\u30A4\u30EB{1}\u306B\u30B3\u30D4\u30FC\u4E2D... -doclet.No_Public_Classes_To_Document=\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3059\u308Bpublic\u307E\u305F\u306Fprotected\u30AF\u30E9\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 -doclet.destination_directory_not_directory_0=\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3067\u306F\u3042\u308A\u307E\u305B\u3093 -doclet.destination_directory_not_writable_0=\u8EE2\u9001\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA{0}\u306F\u66F8\u8FBC\u307F\u53EF\u80FD\u3067\u306F\u3042\u308A\u307E\u305B\u3093 -doclet.Encoding_not_supported=\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0{0}\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 -doclet.Building_Tree=\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u3068\u30AF\u30E9\u30B9\u306E\u968E\u5C64\u30C4\u30EA\u30FC\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059... -doclet.Building_Index=\u5168\u30D1\u30C3\u30B1\u30FC\u30B8\u3068\u30AF\u30E9\u30B9\u306E\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059... -doclet.Building_Index_For_All_Classes=\u5168\u30AF\u30E9\u30B9\u306E\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059... -doclet.sourcetab_warning=-sourcetab\u306E\u5F15\u6570\u306F0\u3088\u308A\u5927\u304D\u3044\u6574\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002 -doclet.Packages=\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.Other_Packages=\u305D\u306E\u4ED6\u306E\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.Notice_taglet_registered=\u767B\u9332\u3055\u308C\u305F\u30BF\u30B0\u30EC\u30C3\u30C8{0} ... -doclet.Notice_taglet_unseen=\u6CE8\u610F: \u975E\u8868\u793A\u306E\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0: {0} -doclet.Notice_taglet_overriden=\u6CE8\u610F: \u6A19\u6E96\u30BF\u30B0\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0: {0} -doclet.Notice_taglet_conflict_warn=\u6CE8\u610F: \u6A19\u6E96\u30BF\u30B0\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\u53EF\u80FD\u6027\u306E\u3042\u308B\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0: {0}\u3002\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3092\u907F\u3051\u308B\u305F\u3081\u306B\u3001\u30AB\u30B9\u30BF\u30E0\u30FB\u30BF\u30B0\u540D\u306E\u4E2D\u306B\u5C11\u306A\u304F\u3068\u30821\u3064\u306E\u30D4\u30EA\u30AA\u30C9(.)\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002 -doclet.Error_taglet_not_registered=\u30A8\u30E9\u30FC - \u30BF\u30B0\u30EC\u30C3\u30C8{1}\u3092\u767B\u9332\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308B\u3068\u304D\u306B\u3001\u4F8B\u5916{0}\u304C\u30B9\u30ED\u30FC\u3055\u308C\u307E\u3057\u305F... -doclet.Error_invalid_custom_tag_argument=\u30A8\u30E9\u30FC - {0}\u306F-tag\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u5BFE\u3057\u3066\u7121\u52B9\u306A\u5F15\u6570\u3067\u3059... -doclet.Author=\u4F5C\u6210\u8005: -doclet.DefaultValue=\u30C7\u30D5\u30A9\u30EB\u30C8\u5024: -doclet.PropertyDescription=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u8AAC\u660E: -doclet.PropertyGetter=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u5024\u3092\u53D6\u5F97\u3057\u307E\u3059 -doclet.PropertySetter=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u5024\u3092\u8A2D\u5B9A\u3057\u307E\u3059 -doclet.PropertyGetterWithName=\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306E\u5024\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002 -doclet.PropertySetterWithName=\u30D7\u30ED\u30D1\u30C6\u30A3{0}\u306E\u5024\u3092\u8A2D\u5B9A\u3057\u307E\u3059\u3002 -doclet.Default=\u30C7\u30D5\u30A9\u30EB\u30C8: -doclet.Parameters=\u30D1\u30E9\u30E1\u30FC\u30BF: -doclet.TypeParameters=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF: -doclet.Parameters_warn=@param argument "{0}"\u306F\u30D1\u30E9\u30E1\u30FC\u30BF\u540D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 -doclet.Parameters_dup_warn=\u30D1\u30E9\u30E1\u30FC\u30BF"{0}"\u304C2\u56DE\u4EE5\u4E0A\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002 -doclet.Type_Parameters_warn=@param argument "{0}"\u306F\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u540D\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002 -doclet.Type_Parameters_dup_warn=\u578B\u30D1\u30E9\u30E1\u30FC\u30BF"{0}"\u304C2\u56DE\u4EE5\u4E0A\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5316\u3055\u308C\u3066\u3044\u307E\u3059\u3002 -doclet.Returns=\u623B\u308A\u5024: -doclet.Return_tag_on_void_method=\u623B\u308A\u5024\u306E\u578B\u304Cvoid\u306E\u30E1\u30BD\u30C3\u30C9\u3067\u306F@return\u30BF\u30B0\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002 -doclet.See_Also=\u95A2\u9023\u9805\u76EE: -doclet.See=\u53C2\u7167\u5148: -doclet.SerialData=\u30B7\u30EA\u30A2\u30EB\u30FB\u30C7\u30FC\u30BF: -doclet.Since=\u5C0E\u5165\u3055\u308C\u305F\u30D0\u30FC\u30B8\u30E7\u30F3: -doclet.Throws=\u4F8B\u5916: -doclet.Version=\u30D0\u30FC\u30B8\u30E7\u30F3: -doclet.Factory=\u30D5\u30A1\u30AF\u30C8\u30EA: -doclet.UnknownTag={0}\u306F\u4E0D\u660E\u306A\u30BF\u30B0\u3067\u3059\u3002 -doclet.UnknownTagLowercase={0}\u306F\u4E0D\u660E\u306A\u30BF\u30B0\u3067\u3059\u3002\u5927\u6587\u5B57\u3068\u5C0F\u6587\u5B57\u306E\u533A\u5225\u3092\u9664\u3044\u3066\u306F\u65E2\u77E5\u306E\u30BF\u30B0\u3068\u540C\u3058\u3067\u3059\u3002 -doclet.noInheritedDoc=@inheritDoc\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059\u304C\u3001{0}\u306F\u3069\u306E\u30E1\u30BD\u30C3\u30C9\u3082\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\u5B9F\u88C5\u3057\u3066\u3044\u307E\u305B\u3093\u3002 -doclet.malformed_html_link_tag=
\u30BF\u30B0\u306E\u5F62\u5F0F\u304C\u4E0D\u6B63:\n"{0}" -doclet.tag_misuse={0}\u30BF\u30B0\u306F{1}\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u4F7F\u7528\u3067\u304D\u308B\u306E\u306F\u6B21\u306E\u30BF\u30A4\u30D7\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u306E\u307F\u3067\u3059: {2}\u3002 -doclet.javafx_tag_misuse=\u30BF\u30B0@propertyGetter\u3001@propertySetter\u304A\u3088\u3073@propertyDescription\u306F\u3001JavaFX\u306E\u30D7\u30ED\u30D1\u30C6\u30A3getter\u3068setter\u306E\u307F\u3067\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 -doclet.Package_Summary=\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u6982\u8981 -doclet.Interface_Summary=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u6982\u8981 -doclet.Annotation_Types_Summary=\u6CE8\u91C8\u578B\u306E\u6982\u8981 -doclet.Enum_Summary=\u5217\u6319\u578B\u306E\u6982\u8981 -doclet.Exception_Summary=\u4F8B\u5916\u306E\u6982\u8981 -doclet.Error_Summary=\u30A8\u30E9\u30FC\u306E\u6982\u8981 -doclet.Class_Summary=\u30AF\u30E9\u30B9\u306E\u6982\u8981 -doclet.Nested_Class_Summary=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9\u306E\u6982\u8981 -doclet.Annotation_Type_Optional_Member_Summary=\u4EFB\u610F\u8981\u7D20\u306E\u6982\u8981 -doclet.Annotation_Type_Required_Member_Summary=\u5FC5\u9808\u8981\u7D20\u306E\u6982\u8981 -doclet.Field_Summary=\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u6982\u8981 -doclet.Property_Summary=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u6982\u8981 -doclet.Enum_Constant_Summary=\u5217\u6319\u578B\u5B9A\u6570\u306E\u6982\u8981 -doclet.Constructor_Summary=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u6982\u8981 -doclet.Method_Summary=\u30E1\u30BD\u30C3\u30C9\u306E\u6982\u8981 -doclet.Interfaces=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Enums=\u5217\u6319\u578B -doclet.AnnotationTypes=\u6CE8\u91C8\u578B -doclet.Exceptions=\u4F8B\u5916 -doclet.Errors=\u30A8\u30E9\u30FC -doclet.Classes=\u30AF\u30E9\u30B9 -doclet.Packages=\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.packages=\u30D1\u30C3\u30B1\u30FC\u30B8 -doclet.All_Classes=\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9 -doclet.All_Superinterfaces=\u3059\u3079\u3066\u306E\u30B9\u30FC\u30D1\u30FC\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: -doclet.All_Implemented_Interfaces=\u3059\u3079\u3066\u306E\u5B9F\u88C5\u3055\u308C\u305F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: -doclet.All_classes_and_interfaces=\u3059\u3079\u3066\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9(\u975Estatic\u306E\u30CD\u30B9\u30C8\u3055\u308C\u305F\u578B\u3092\u9664\u304F) -doclet.Package_class_and_interface_descriptions=\u30D1\u30C3\u30B1\u30FC\u30B8\u3001\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u306E\u8AAC\u660E -doclet.Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Class=\u30AF\u30E9\u30B9 -doclet.AnnotationType=\u6CE8\u91C8\u578B -doclet.annotationtype=\u6CE8\u91C8\u578B -doclet.annotationtypes=\u6CE8\u91C8\u578B -doclet.Enum=\u5217\u6319\u578B -doclet.enum=\u5217\u6319 -doclet.enums=\u5217\u6319 -doclet.interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.interfaces=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.class=\u30AF\u30E9\u30B9 -doclet.classes=\u30AF\u30E9\u30B9 -doclet.Error=\u30A8\u30E9\u30FC -doclet.error=\u30A8\u30E9\u30FC -doclet.errors=\u30A8\u30E9\u30FC -doclet.Exception=\u4F8B\u5916 -doclet.exception=\u4F8B\u5916 -doclet.exceptions=\u4F8B\u5916 -doclet.Package_private=(package private) -doclet.Nested_Classes_Interfaces_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9/\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Nested_Classes_Interface_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9/\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Methods_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9 -doclet.Methods_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9 -doclet.Fields_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.Fields_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.Properties_Inherited_From_Class=\u30AF\u30E9\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D7\u30ED\u30D1\u30C6\u30A3 -doclet.Properties_Inherited_From_Interface=\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u304B\u3089\u7D99\u627F\u3055\u308C\u305F\u30D7\u30ED\u30D1\u30C6\u30A3 -doclet.Annotation_Type_Member_Detail=\u8981\u7D20\u306E\u8A73\u7D30 -doclet.Enum_Constant_Detail=\u5217\u6319\u578B\u5B9A\u6570\u306E\u8A73\u7D30 -doclet.Constants_Summary=\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9\u5024 -doclet.Field_Detail=\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u8A73\u7D30 -doclet.Property_Detail=\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u8A73\u7D30 -doclet.Method_Detail=\u30E1\u30BD\u30C3\u30C9\u306E\u8A73\u7D30 -doclet.Constructor_Detail=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306E\u8A73\u7D30 -doclet.Deprecated=\u63A8\u5968\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002 -doclet.Groupname_already_used=-group\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u304A\u3044\u3066\u3001\u3059\u3067\u306B\u30B0\u30EB\u30FC\u30D7\u540D\u304C\u4F7F\u7528\u3055\u308C\u3066\u3044\u307E\u3059: {0} -doclet.value_tag_invalid_reference={0}(@value\u30BF\u30B0\u306B\u3088\u308A\u53C2\u7167\u3055\u308C\u3066\u3044\u308B)\u306F\u4E0D\u660E\u306A\u53C2\u7167\u3067\u3059\u3002 -doclet.value_tag_invalid_constant=@value\u30BF\u30B0({0}\u3092\u53C2\u7167\u3057\u3066\u3044\u308B)\u306F\u5B9A\u6570\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002 -doclet.value_tag_invalid_use=@value\u30BF\u30B0\u306F\u3053\u3053\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002 -doclet.dest_dir_create=\u5B9B\u5148\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u4F5C\u6210\u4E2D: "{0}" -doclet.in={1}\u306E{0} -doclet.Use_Table_Summary=\u8868\u3001{0}\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073\u8AAC\u660E\u306E\u4F7F\u7528 -doclet.Constants_Table_Summary={0}\u8868\u3001\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073\u5024 -doclet.Member_Table_Summary={0}\u8868\u3001{1}\u306E\u30EA\u30B9\u30C8\u304A\u3088\u3073\u8AAC\u660E -doclet.fields=\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.Fields=\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.properties=\u30D7\u30ED\u30D1\u30C6\u30A3 -doclet.Properties=\u30D7\u30ED\u30D1\u30C6\u30A3 -doclet.constructors=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.Constructors=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.methods=\u30E1\u30BD\u30C3\u30C9 -doclet.Methods=\u30E1\u30BD\u30C3\u30C9 -doclet.All_Methods=\u3059\u3079\u3066\u306E\u30E1\u30BD\u30C3\u30C9 -doclet.Static_Methods=static\u30E1\u30BD\u30C3\u30C9 -doclet.Instance_Methods=\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u30FB\u30E1\u30BD\u30C3\u30C9 -doclet.Abstract_Methods=abstract\u30E1\u30BD\u30C3\u30C9 -doclet.Concrete_Methods=concrete\u30E1\u30BD\u30C3\u30C9 -doclet.Default_Methods=\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30E1\u30BD\u30C3\u30C9 -doclet.Deprecated_Methods=\u63A8\u5968\u3055\u308C\u3066\u3044\u306A\u3044\u30E1\u30BD\u30C3\u30C9 -doclet.annotation_type_optional_members=\u4EFB\u610F\u8981\u7D20 -doclet.Annotation_Type_Optional_Members=\u4EFB\u610F\u8981\u7D20 -doclet.annotation_type_required_members=\u5FC5\u9808\u8981\u7D20 -doclet.Annotation_Type_Required_Members=\u5FC5\u9808\u8981\u7D20 -doclet.enum_constants=\u5217\u6319\u578B\u5B9A\u6570 -doclet.Enum_Constants=\u5217\u6319\u5B9A\u6570 -doclet.nested_classes=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9 -doclet.Nested_Classes=\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30AF\u30E9\u30B9 -doclet.subclasses=\u30B5\u30D6\u30AF\u30E9\u30B9 -doclet.subinterfaces=\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9 -doclet.Modifier=\u4FEE\u98FE\u5B50 -doclet.Type=\u30BF\u30A4\u30D7 -doclet.Types=\u30BF\u30A4\u30D7 -doclet.Members=\u30E1\u30F3\u30D0\u30FC -doclet.SearchTags=SearchTags -doclet.search=SEARCH: -doclet.invalid_usage_of_tag={0}\u30BF\u30B0\u306E\u4F7F\u7528\u65B9\u6CD5\u304C\u7121\u52B9\u3067\u3059\u3002 -doclet.Field=\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.Property=\u30D7\u30ED\u30D1\u30C6\u30A3 -doclet.Constructor=\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF -doclet.Method=\u30E1\u30BD\u30C3\u30C9 -doclet.Annotation_Type_Optional_Member=\u4EFB\u610F\u8981\u7D20 -doclet.Annotation_Type_Required_Member=\u5FC5\u9808\u8981\u7D20 -doclet.Annotation_Type_Member=\u6CE8\u91C8\u578B\u8981\u7D20 -doclet.Enum_Constant=\u5217\u6319\u578B\u5B9A\u6570 -doclet.Class=\u30AF\u30E9\u30B9 -doclet.Description=\u8AAC\u660E -doclet.ConstantField=\u5B9A\u6570\u30D5\u30A3\u30FC\u30EB\u30C9 -doclet.Value=\u5024 -doclet.0_and_1={0}\u3068{1} - -#Documentation for Enums -doclet.enum_values_doc.main=\n\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u914D\u5217\u3092\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\u8FD4\u3057\u307E\u3059\u3002\n\u3053\u306E\u30E1\u30BD\u30C3\u30C9\u306F\u6B21\u306E\u3088\u3046\u306B\u3057\u3066\u5B9A\u6570\u3092\u53CD\u5FA9\u3059\u308B\u305F\u3081\u306B\n\u4F7F\u7528\u3067\u304D\u307E\u3059:\n
\nfor({0} c: {0}.values())\n  System.out.println(c);\n
\n - -doclet.enum_values_doc.return=\n\u3053\u306E\u5217\u6319\u578B\u306E\u5B9A\u6570\u3092\u542B\u3080\u3001\u5BA3\u8A00\u3055\u308C\u3066\u3044\u308B\u9806\u5E8F\u3067\u306E\u914D\u5217 - -doclet.enum_valueof_doc.main=\n\u6307\u5B9A\u3057\u305F\u540D\u524D\u3092\u6301\u3064\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u8FD4\u3057\u307E\u3059\u3002\n\u6587\u5B57\u5217\u306F\u3001\u3053\u306E\u578B\u306E\u5217\u6319\u578B\u5B9A\u6570\u3092\u5BA3\u8A00\u3059\u308B\u306E\u306B\u4F7F\u7528\u3057\u305F\u8B58\u5225\u5B50\u3068\u6B63\u78BA\u306B\n\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n(\u4F59\u5206\u306A\u7A7A\u767D\u6587\u5B57\u3092\u542B\u3081\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093\u3002)\n - -doclet.enum_valueof_doc.param_name=\u8FD4\u3055\u308C\u308B\u5217\u6319\u578B\u5B9A\u6570\u306E\u540D\u524D\u3002 - -doclet.enum_valueof_doc.return=\u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u5217\u6319\u578B\u5B9A\u6570 - -doclet.enum_valueof_doc.throws_ila=\u3053\u306E\u5217\u6319\u578B\u306B\u3001\u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u5B9A\u6570\u304C\u306A\u3044\u5834\u5408 - -doclet.enum_valueof_doc.throws_npe=\u5F15\u6570\u304Cnull\u306E\u5834\u5408 diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties deleted file mode 100644 --- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties +++ /dev/null @@ -1,199 +0,0 @@ -doclet.Generating_0=\u6B63\u5728\u751F\u6210{0}... -doclet.Toolkit_Usage_Violation=\u53EA\u6709{0}\u53EF\u4EE5\u4F7F\u7528 Doclet \u5DE5\u5177\u7BB1 -doclet.MissingSerialTag=\u5728\u7C7B{0}\u4E2D, \u9ED8\u8BA4\u7684\u53EF\u5E8F\u5217\u5316\u5B57\u6BB5{1}\u7F3A\u5C11 @serial \u6807\u8BB0\u3002 -doclet.MissingSerialDataTag=\u5728\u7C7B{0}\u4E2D, \u65B9\u6CD5{1}\u4E2D\u7F3A\u5C11 @serialData \u6807\u8BB0\u3002 -doclet.Serializable_no_customization=\u672A\u58F0\u660E readObject \u6216 writeObject \u65B9\u6CD5\u3002 -doclet.Serialized_Form=\u5E8F\u5217\u5316\u8868\u683C -doclet.Serialized_Form_methods=\u5E8F\u5217\u5316\u65B9\u6CD5 -doclet.Serialized_Form_fields=\u5E8F\u5217\u5316\u5B57\u6BB5 -doclet.Serialized_Form_class=\u5E8F\u5217\u5316\u6982\u89C8 -doclet.Class_0_implements_serializable=\u7C7B{0}\u5B9E\u73B0\u53EF\u5E8F\u5217\u5316 -doclet.Class_0_extends_implements_serializable=\u7C7B{0}\u6269\u5C55{1}\u5B9E\u73B0\u53EF\u5E8F\u5217\u5316 -doclet.Option_conflict=\u9009\u9879{0}\u4E0E{1}\u51B2\u7A81 -doclet.Option_reuse=\u91CD\u590D\u4F7F\u7528\u7684\u9009\u9879: {0} -doclet.Option_doclint_no_qualifiers=-Xdoclint \u53C2\u6570\u4E0D\u5141\u8BB8\u4F7F\u7528\u8BBF\u95EE\u9650\u5B9A\u7B26 -doclet.Option_doclint_invalid_arg=-Xdoclint \u9009\u9879\u7684\u53C2\u6570\u65E0\u6548 -doclet.Option_doclint_package_invalid_arg=-Xdoclint/package \u9009\u9879\u7684\u53C2\u6570\u65E0\u6548 -doclet.exception_encountered= \u5C1D\u8BD5\u521B\u5EFA\u6587\u4EF6{1}\u65F6 \n\t\u9047\u5230{0} -doclet.perform_copy_exception_encountered= \u6267\u884C\u590D\u5236\u65F6 \n\u9047\u5230{0}\u3002 -doclet.File_not_found=\u627E\u4E0D\u5230\u6587\u4EF6: {0} -doclet.Copy_Overwrite_warning=\u672A\u5C06\u6587\u4EF6{0}\u590D\u5236\u5230 {1}, \u56E0\u4E3A\u73B0\u6709\u6587\u4EF6\u5177\u6709\u76F8\u540C\u540D\u79F0... -doclet.Copying_File_0_To_Dir_1=\u6B63\u5728\u5C06\u6587\u4EF6{0}\u590D\u5236\u5230\u76EE\u5F55 {1}... -doclet.Copying_File_0_To_File_1=\u6B63\u5728\u5C06\u6587\u4EF6{0}\u590D\u5236\u5230\u6587\u4EF6{1}... -doclet.No_Public_Classes_To_Document=\u627E\u4E0D\u5230\u53EF\u4EE5\u6587\u6863\u5316\u7684\u516C\u5171\u6216\u53D7\u4FDD\u62A4\u7684\u7C7B\u3002 -doclet.destination_directory_not_directory_0=\u76EE\u6807\u76EE\u5F55\u4E0D\u662F\u76EE\u5F55 {0} -doclet.destination_directory_not_writable_0=\u76EE\u6807\u76EE\u5F55\u4E0D\u53EF\u5199\u5165 {0} -doclet.Encoding_not_supported=\u4E0D\u652F\u6301\u7F16\u7801: {0} -doclet.Building_Tree=\u6B63\u5728\u6784\u5EFA\u6240\u6709\u7A0B\u5E8F\u5305\u548C\u7C7B\u7684\u6811... -doclet.Building_Index=\u6B63\u5728\u6784\u5EFA\u6240\u6709\u7A0B\u5E8F\u5305\u548C\u7C7B\u7684\u7D22\u5F15... -doclet.Building_Index_For_All_Classes=\u6B63\u5728\u6784\u5EFA\u6240\u6709\u7C7B\u7684\u7D22\u5F15... -doclet.sourcetab_warning=-sourcetab \u7684\u53C2\u6570\u5FC5\u987B\u662F\u5927\u4E8E 0 \u7684\u6574\u6570\u3002 -doclet.Packages=\u7A0B\u5E8F\u5305 -doclet.Other_Packages=\u5176\u4ED6\u7A0B\u5E8F\u5305 -doclet.Notice_taglet_registered=\u6CE8\u518C\u7684 Taglet {0}... -doclet.Notice_taglet_unseen=\u6CE8: \u627E\u4E0D\u5230\u7684\u5B9A\u5236\u6807\u8BB0: {0} -doclet.Notice_taglet_overriden=\u6CE8: \u8986\u76D6\u6807\u51C6\u6807\u8BB0\u7684\u5B9A\u5236\u6807\u8BB0: {0} -doclet.Notice_taglet_conflict_warn=\u6CE8: \u53EF\u80FD\u8986\u76D6\u5C06\u6765\u7684\u6807\u51C6\u6807\u8BB0\u7684\u5B9A\u5236\u6807\u8BB0: {0}\u3002\u4E3A\u4E86\u907F\u514D\u51FA\u73B0\u53EF\u80FD\u7684\u8986\u76D6, \u8BF7\u5728\u5B9A\u5236\u6807\u8BB0\u540D\u79F0\u4E2D\u81F3\u5C11\u4F7F\u7528\u4E00\u4E2A\u53E5\u70B9\u5B57\u7B26 (.)\u3002 -doclet.Error_taglet_not_registered=\u9519\u8BEF - \u5C1D\u8BD5\u6CE8\u518C Taglet {1}\u65F6\u629B\u51FA\u5F02\u5E38\u9519\u8BEF{0}... -doclet.Error_invalid_custom_tag_argument=\u9519\u8BEF - \u5BF9\u4E8E -tag \u9009\u9879, {0}\u662F\u65E0\u6548\u53C2\u6570... -doclet.Author=\u4F5C\u8005: -doclet.DefaultValue=\u9ED8\u8BA4\u503C: -doclet.PropertyDescription=\u5C5E\u6027\u8BF4\u660E: -doclet.PropertyGetter=\u83B7\u53D6\u5C5E\u6027\u7684\u503C -doclet.PropertySetter=\u8BBE\u7F6E\u5C5E\u6027\u7684\u503C -doclet.PropertyGetterWithName=\u83B7\u53D6\u5C5E\u6027{0}\u7684\u503C\u3002 -doclet.PropertySetterWithName=\u8BBE\u7F6E\u5C5E\u6027{0}\u7684\u503C\u3002 -doclet.Default=\u9ED8\u8BA4\u503C: -doclet.Parameters=\u53C2\u6570: -doclet.TypeParameters=\u7C7B\u578B\u53C2\u6570: -doclet.Parameters_warn=@param argument "{0}" \u4E0D\u662F\u53C2\u6570\u540D\u79F0\u3002 -doclet.Parameters_dup_warn=\u591A\u6B21\u5BF9\u53C2\u6570 "{0}" \u8FDB\u884C\u6587\u6863\u5316\u3002 -doclet.Type_Parameters_warn=@param argument "{0}" \u4E0D\u662F\u7C7B\u578B\u53C2\u6570\u540D\u79F0\u3002 -doclet.Type_Parameters_dup_warn=\u591A\u6B21\u5BF9\u7C7B\u578B\u53C2\u6570 "{0}" \u8FDB\u884C\u6587\u6863\u5316\u3002 -doclet.Returns=\u8FD4\u56DE: -doclet.Return_tag_on_void_method=\u4E0D\u80FD\u5728\u8FD4\u56DE\u7C7B\u578B\u4E3A\u7A7A\u7684\u65B9\u6CD5\u4E2D\u4F7F\u7528 @return \u6807\u8BB0\u3002 -doclet.See_Also=\u53E6\u8BF7\u53C2\u9605: -doclet.See=\u8BF7\u53C2\u9605: -doclet.SerialData=\u5E8F\u5217\u6570\u636E: -doclet.Since=\u4ECE\u4EE5\u4E0B\u7248\u672C\u5F00\u59CB: -doclet.Throws=\u629B\u51FA: -doclet.Version=\u7248\u672C: -doclet.Factory=\u5DE5\u5382: -doclet.UnknownTag={0}\u662F\u672A\u77E5\u6807\u8BB0\u3002 -doclet.UnknownTagLowercase={0}\u662F\u672A\u77E5\u6807\u8BB0 - \u9664\u4E86\u5927\u5C0F\u5199\u4E4B\u5916\u5176\u4ED6\u65B9\u9762\u4E0E\u5DF2\u77E5\u6807\u8BB0\u76F8\u540C\u3002 -doclet.noInheritedDoc=\u4F7F\u7528\u4E86 @inheritDoc, \u4F46{0}\u672A\u8986\u76D6\u6216\u5B9E\u73B0\u4EFB\u4F55\u65B9\u6CD5\u3002 -doclet.malformed_html_link_tag=
\u6807\u8BB0\u683C\u5F0F\u9519\u8BEF: \n"{0}" -doclet.tag_misuse=\u4E0D\u80FD\u5728{1}\u6587\u6863\u4E2D\u4F7F\u7528\u6807\u8BB0{0}\u3002\u53EA\u80FD\u5728\u4EE5\u4E0B\u7C7B\u578B\u7684\u6587\u6863\u4E2D\u4F7F\u7528\u8BE5\u6807\u8BB0: {2}\u3002 -doclet.javafx_tag_misuse=\u6807\u8BB0 @propertyGetter, @propertySetter \u548C @propertyDescription \u53EA\u80FD\u5728 JavaFX \u5C5E\u6027 getter \u548C setter \u4E2D\u4F7F\u7528\u3002 -doclet.Package_Summary=\u7A0B\u5E8F\u5305\u6982\u8981 -doclet.Interface_Summary=\u63A5\u53E3\u6982\u8981 -doclet.Annotation_Types_Summary=\u6CE8\u91CA\u7C7B\u578B\u6982\u8981 -doclet.Enum_Summary=\u679A\u4E3E\u6982\u8981 -doclet.Exception_Summary=\u5F02\u5E38\u9519\u8BEF\u6982\u8981 -doclet.Error_Summary=\u9519\u8BEF\u6982\u8981 -doclet.Class_Summary=\u7C7B\u6982\u8981 -doclet.Nested_Class_Summary=\u5D4C\u5957\u7C7B\u6982\u8981 -doclet.Annotation_Type_Optional_Member_Summary=\u53EF\u9009\u5143\u7D20\u6982\u8981 -doclet.Annotation_Type_Required_Member_Summary=\u5FC5\u9700\u5143\u7D20\u6982\u8981 -doclet.Field_Summary=\u5B57\u6BB5\u6982\u8981 -doclet.Property_Summary=\u5C5E\u6027\u6982\u8981 -doclet.Enum_Constant_Summary=\u679A\u4E3E\u5E38\u91CF\u6982\u8981 -doclet.Constructor_Summary=\u6784\u9020\u5668\u6982\u8981 -doclet.Method_Summary=\u65B9\u6CD5\u6982\u8981 -doclet.Interfaces=\u63A5\u53E3 -doclet.Enums=\u679A\u4E3E -doclet.AnnotationTypes=\u6CE8\u91CA\u7C7B\u578B -doclet.Exceptions=\u5F02\u5E38\u9519\u8BEF -doclet.Errors=\u9519\u8BEF -doclet.Classes=\u7C7B -doclet.Packages=\u7A0B\u5E8F\u5305 -doclet.packages=\u7A0B\u5E8F\u5305 -doclet.All_Classes=\u6240\u6709\u7C7B -doclet.All_Superinterfaces=\u6240\u6709\u8D85\u7EA7\u63A5\u53E3: -doclet.All_Implemented_Interfaces=\u6240\u6709\u5DF2\u5B9E\u73B0\u7684\u63A5\u53E3: -doclet.All_classes_and_interfaces=\u6240\u6709\u7C7B\u548C\u63A5\u53E3 (\u9664\u4E86\u975E\u9759\u6001\u5D4C\u5957\u7C7B\u578B) -doclet.Package_class_and_interface_descriptions=\u7A0B\u5E8F\u5305, \u7C7B\u548C\u63A5\u53E3\u8BF4\u660E -doclet.Interface=\u63A5\u53E3 -doclet.Class=\u7C7B -doclet.AnnotationType=\u6CE8\u91CA\u7C7B\u578B -doclet.annotationtype=\u6CE8\u91CA\u7C7B\u578B -doclet.annotationtypes=\u6CE8\u91CA\u7C7B\u578B -doclet.Enum=\u679A\u4E3E -doclet.enum=\u679A\u4E3E -doclet.enums=\u679A\u4E3E -doclet.interface=\u63A5\u53E3 -doclet.interfaces=\u63A5\u53E3 -doclet.class=\u7C7B -doclet.classes=\u7C7B -doclet.Error=\u9519\u8BEF -doclet.error=\u9519\u8BEF -doclet.errors=\u9519\u8BEF -doclet.Exception=\u5F02\u5E38\u9519\u8BEF -doclet.exception=\u5F02\u5E38\u9519\u8BEF -doclet.exceptions=\u5F02\u5E38\u9519\u8BEF -doclet.Package_private=(\u4E13\u7528\u7A0B\u5E8F\u5305) -doclet.Nested_Classes_Interfaces_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u5D4C\u5957\u7C7B/\u63A5\u53E3 -doclet.Nested_Classes_Interface_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u5D4C\u5957\u7C7B/\u63A5\u53E3 -doclet.Methods_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u65B9\u6CD5 -doclet.Methods_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u65B9\u6CD5 -doclet.Fields_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u5B57\u6BB5 -doclet.Fields_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u5B57\u6BB5 -doclet.Properties_Inherited_From_Class=\u4ECE\u7C7B\u7EE7\u627F\u7684\u5C5E\u6027 -doclet.Properties_Inherited_From_Interface=\u4ECE\u63A5\u53E3\u7EE7\u627F\u7684\u5C5E\u6027 -doclet.Annotation_Type_Member_Detail=\u5143\u7D20\u8BE6\u7EC6\u8D44\u6599 -doclet.Enum_Constant_Detail=\u679A\u4E3E\u5E38\u91CF\u8BE6\u7EC6\u8D44\u6599 -doclet.Constants_Summary=\u5E38\u91CF\u5B57\u6BB5\u503C -doclet.Field_Detail=\u5B57\u6BB5\u8BE6\u7EC6\u8D44\u6599 -doclet.Property_Detail=\u5C5E\u6027\u8BE6\u7EC6\u4FE1\u606F -doclet.Method_Detail=\u65B9\u6CD5\u8BE6\u7EC6\u8D44\u6599 -doclet.Constructor_Detail=\u6784\u9020\u5668\u8BE6\u7EC6\u8D44\u6599 -doclet.Deprecated=\u5DF2\u8FC7\u65F6\u3002 -doclet.Groupname_already_used=\u5728 -group \u9009\u9879\u4E2D, groupname \u5DF2\u4F7F\u7528: {0} -doclet.value_tag_invalid_reference={0} (\u7531 @value \u6807\u8BB0\u5F15\u7528) \u4E3A\u672A\u77E5\u5F15\u7528\u3002 -doclet.value_tag_invalid_constant=@value \u6807\u8BB0 (\u5F15\u7528{0}) \u53EA\u80FD\u5728\u5E38\u91CF\u4E2D\u4F7F\u7528\u3002 -doclet.value_tag_invalid_use=\u6B64\u5904\u4E0D\u80FD\u4F7F\u7528 @value \u6807\u8BB0\u3002 -doclet.dest_dir_create=\u6B63\u5728\u521B\u5EFA\u76EE\u6807\u76EE\u5F55: "{0}" -doclet.in={1}\u4E2D\u7684{0} -doclet.Use_Table_Summary=\u4F7F\u7528\u8868, \u5217\u8868{0}\u548C\u89E3\u91CA -doclet.Constants_Table_Summary={0}\u8868, \u5217\u8868\u5E38\u91CF\u5B57\u6BB5\u548C\u503C -doclet.Member_Table_Summary={0}\u8868, \u5217\u8868{1}\u548C\u89E3\u91CA -doclet.fields=\u5B57\u6BB5 -doclet.Fields=\u5B57\u6BB5 -doclet.properties=\u5C5E\u6027 -doclet.Properties=\u5C5E\u6027 -doclet.constructors=\u6784\u9020\u5668 -doclet.Constructors=\u6784\u9020\u5668 -doclet.methods=\u65B9\u6CD5 -doclet.Methods=\u65B9\u6CD5 -doclet.All_Methods=\u6240\u6709\u65B9\u6CD5 -doclet.Static_Methods=\u9759\u6001\u65B9\u6CD5 -doclet.Instance_Methods=\u5B9E\u4F8B\u65B9\u6CD5 -doclet.Abstract_Methods=\u62BD\u8C61\u65B9\u6CD5 -doclet.Concrete_Methods=\u5177\u4F53\u65B9\u6CD5 -doclet.Default_Methods=\u9ED8\u8BA4\u65B9\u6CD5 -doclet.Deprecated_Methods=\u5DF2\u8FC7\u65F6\u7684\u65B9\u6CD5 -doclet.annotation_type_optional_members=\u53EF\u9009\u5143\u7D20 -doclet.Annotation_Type_Optional_Members=\u53EF\u9009\u5143\u7D20 -doclet.annotation_type_required_members=\u5FC5\u9700\u7684\u5143\u7D20 -doclet.Annotation_Type_Required_Members=\u6240\u9700\u5143\u7D20 -doclet.enum_constants=\u679A\u4E3E\u5E38\u91CF -doclet.Enum_Constants=\u679A\u4E3E\u5E38\u91CF -doclet.nested_classes=\u5D4C\u5957\u7C7B -doclet.Nested_Classes=\u5D4C\u5957\u7C7B -doclet.subclasses=\u5B50\u7C7B -doclet.subinterfaces=\u5B50\u63A5\u53E3 -doclet.Modifier=\u9650\u5B9A\u7B26 -doclet.Type=\u7C7B\u578B -doclet.Types=\u7C7B\u578B -doclet.Members=\u6210\u5458 -doclet.SearchTags=\u641C\u7D22\u6807\u8BB0 -doclet.search=SEARCH: -doclet.invalid_usage_of_tag={0} \u6807\u8BB0\u7684\u7528\u6CD5\u65E0\u6548\u3002 -doclet.Field=\u5B57\u6BB5 -doclet.Property=\u5C5E\u6027 -doclet.Constructor=\u6784\u9020\u5668 -doclet.Method=\u65B9\u6CD5 -doclet.Annotation_Type_Optional_Member=\u53EF\u9009\u5143\u7D20 -doclet.Annotation_Type_Required_Member=\u5FC5\u9700\u7684\u5143\u7D20 -doclet.Annotation_Type_Member=\u6CE8\u91CA\u7C7B\u578B\u5143\u7D20 -doclet.Enum_Constant=\u679A\u4E3E\u5E38\u91CF -doclet.Class=\u7C7B -doclet.Description=\u8BF4\u660E -doclet.ConstantField=\u5E38\u91CF\u5B57\u6BB5 -doclet.Value=\u503C -doclet.0_and_1={0}\u548C{1} - -#Documentation for Enums -doclet.enum_values_doc.main=\n\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F, \u8FD4\u56DE\n\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4\u3002\u8BE5\u65B9\u6CD5\u53EF\u7528\u4E8E\u8FED\u4EE3\n\u5E38\u91CF, \u5982\u4E0B\u6240\u793A:\n
\nfor ({0} c : {0}.values())\n    System.out.println(c);\n
- -doclet.enum_values_doc.return=\n\u6309\u7167\u58F0\u660E\u8BE5\u679A\u4E3E\u7C7B\u578B\u7684\u5E38\u91CF\u7684\u987A\u5E8F\u8FD4\u56DE\u7684\u5305\u542B\u8FD9\u4E9B\u5E38\u91CF\u7684\u6570\u7EC4 - -doclet.enum_valueof_doc.main=\n\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u3002\n\u5B57\u7B26\u4E32\u5FC5\u987B\u4E0E\u7528\u4E8E\u58F0\u660E\u8BE5\u7C7B\u578B\u7684\u679A\u4E3E\u5E38\u91CF\u7684\n\u6807\u8BC6\u7B26\u5B8C\u5168\u5339\u914D\u3002(\u4E0D\u5141\u8BB8\u6709\u591A\u4F59\n\u7684\u7A7A\u683C\u5B57\u7B26\u3002) - -doclet.enum_valueof_doc.param_name=\u8981\u8FD4\u56DE\u7684\u679A\u4E3E\u5E38\u91CF\u7684\u540D\u79F0\u3002 - -doclet.enum_valueof_doc.return=\u8FD4\u56DE\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u679A\u4E3E\u5E38\u91CF - -doclet.enum_valueof_doc.throws_ila=\u5982\u679C\u8BE5\u679A\u4E3E\u7C7B\u578B\u6CA1\u6709\u5E26\u6709\u6307\u5B9A\u540D\u79F0\u7684\u5E38\u91CF - -doclet.enum_valueof_doc.throws_npe=\u5982\u679C\u53C2\u6570\u4E3A\u7A7A\u503C diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/glass.png b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/glass.png deleted file mode 100644 index a7f591f467a1c0c949bbc510156a0c1afb860a6e..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 GIT binary patch literal 0 Hc$@ type pairs - class2type = {}, - - // List of deleted data cache ids, so we can reuse them - core_deletedIds = [], - - core_version = "1.10.2", - - // Save a reference to some core methods - core_concat = core_deletedIds.concat, - core_push = core_deletedIds.push, - core_slice = core_deletedIds.slice, - core_indexOf = core_deletedIds.indexOf, - core_toString = class2type.toString, - core_hasOwn = class2type.hasOwnProperty, - core_trim = core_version.trim, - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Used for matching numbers - core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, - - // Used for splitting on whitespace - core_rnotwhite = /\S+/g, - - // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, - rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }, - - // The ready event handler - completed = function( event ) { - - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } - }, - // Clean-up method for dom ready events - detach = function() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: core_version, - - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return core_slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; - }, - - slice: function() { - return this.pushStack( core_slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: core_push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ), - - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger("ready").off("ready"); - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - return !isNaN( parseFloat(obj) ) && isFinite( obj ); - }, - - type: function( obj ) { - if ( obj == null ) { - return String( obj ); - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ core_toString.call(obj) ] || "object" : - typeof obj; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !core_hasOwn.call(obj, "constructor") && - !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( jQuery.support.ownLast ) { - for ( key in obj ) { - return core_hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || core_hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw new Error( msg ); - }, - - // data: string of html - // context (optional): If specified, the fragment will be created in this context, defaults to document - // keepScripts (optional): If true, will include scripts passed in the html string - parseHTML: function( data, context, keepScripts ) { - if ( !data || typeof data !== "string" ) { - return null; - } - if ( typeof context === "boolean" ) { - keepScripts = context; - context = false; - } - context = context || document; - - var parsed = rsingleTag.exec( data ), - scripts = !keepScripts && []; - - // Single tag - if ( parsed ) { - return [ context.createElement( parsed[1] ) ]; - } - - parsed = jQuery.buildFragment( [ data ], context, scripts ); - if ( scripts ) { - jQuery( scripts ).remove(); - } - return jQuery.merge( [], parsed.childNodes ); - }, - - parseJSON: function( data ) { - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - if ( data === null ) { - return data; - } - - if ( typeof data === "string" ) { - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - if ( data ) { - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - } - } - } - - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - if ( !data || typeof data !== "string" ) { - return null; - } - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Use native String.trim function wherever possible - trim: core_trim && !core_trim.call("\uFEFF\xA0") ? - function( text ) { - return text == null ? - "" : - core_trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - core_push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( core_indexOf ) { - return core_indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var l = second.length, - i = first.length, - j = 0; - - if ( typeof l === "number" ) { - for ( ; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var retVal, - ret = [], - i = 0, - length = elems.length; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return core_concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = core_slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - // Multifunctional method to get and set values of a collection - // The value/s can optionally be executed if it's a function - access: function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; - }, - - now: function() { - return ( new Date() ).getTime(); - }, - - // A method for quickly swapping in/out CSS properties to get correct calculations. - // Note: this method belongs to the css module but it's needed here for the support module. - // If support gets modularized, this method should be moved back to the css module. - swap: function( elem, options, callback, args ) { - var ret, name, - old = {}; - - // Remember the old values, and insert the new ones - for ( name in options ) { - old[ name ] = elem.style[ name ]; - elem.style[ name ] = options[ name ]; - } - - ret = callback.apply( elem, args || [] ); - - // Revert the old values - for ( name in options ) { - elem.style[ name ] = old[ name ]; - } - - return ret; - } -}); - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || type !== "function" && - ( length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj ); -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); -/*! - * Sizzle CSS Selector Engine v1.10.2 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2013-07-03 - */ -(function( window, undefined ) { - -var i, - support, - cachedruns, - Expr, - getText, - isXML, - compile, - outermostContext, - sortInput, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - hasDuplicate = false, - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + - "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", - - // Prefer arguments quoted, - // then not containing pseudos/brackets, - // then attribute selectors/non-parenthetical expressions, - // then anything else - // These preferences are here to reduce the number of selectors - // needing tokenize in the PSEUDO preFilter - pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rsibling = new RegExp( whitespace + "*[+~]" ), - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - // BMP codepoint - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && context.parentNode || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key += " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Detect xml - * @param {Element|Object} elem An element or a document - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent.attachEvent && parent !== parent.top ) { - parent.attachEvent( "onbeforeunload", function() { - setDocument(); - }); - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = assert(function( div ) { - div.innerHTML = "
"; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - - // Support: Opera 10-12/IE8 - // ^= $= *= and empty values - // Should not select anything - // Support: Windows 8 Native Apps - // The type attribute is restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "t", "" ); - - if ( div.querySelectorAll("[t^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = rnative.test( docElem.contains ) || docElem.compareDocumentPosition ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = docElem.compareDocumentPosition ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); - - if ( compare ) { - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } - - // Not directly comparable, sort on existence of method - return a.compareDocumentPosition ? -1 : 1; - } : - function( a, b ) { - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Parentless nodes are either documents or disconnected - } else if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [elem] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val === undefined ? - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null : - val; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - for ( ; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (see #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[5] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] && match[4] !== undefined ) { - match[2] = match[4]; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), - // not comment, processing instructions, or others - // Thanks to Diego Perini for the nodeName shortcut - // Greater than "@" means alpha characters (specifically not starting with "#" or "?") - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -function tokenize( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( tokens = [] ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -} - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var data, cache, outerCache, - dirkey = dirruns + " " + doneName; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { - if ( (data = cache[1]) === true || data === cachedruns ) { - return data === true; - } - } else { - cache = outerCache[ dir ] = [ dirkey ]; - cache[1] = matcher( elem, context, xml ) || cachedruns; - if ( cache[1] === true ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - // A counter to specify which element is currently being matched - var matcherCachedRuns = 0, - bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, expandContext ) { - var elem, j, matcher, - setMatched = [], - matchedCount = 0, - i = "0", - unmatched = seed && [], - outermost = expandContext != null, - contextBackup = outermostContext, - // We must always have either seed elements or context - elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); - - if ( outermost ) { - outermostContext = context !== document && context; - cachedruns = matcherCachedRuns; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - for ( ; (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - cachedruns = ++matcherCachedRuns; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !group ) { - group = tokenize( selector ); - } - i = group.length; - while ( i-- ) { - cached = matcherFromTokens( group[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - } - return cached; -}; - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function select( selector, context, results, seed ) { - var i, tokens, token, type, find, - match = tokenize( selector ); - - if ( !seed ) { - // Try to minimize operations if there is only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - } - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && context.parentNode || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - } - - // Compile and execute a filtering function - // Provide `match` to avoid retokenization if we modified the selector above - compile( selector, match )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) - ); - return results; -} - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = "
"; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - elem[ name ] === true ? name.toLowerCase() : null; - } - }); -} - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})( window ); -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var action = tuple[ 0 ], - fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = core_slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value; - if( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); -jQuery.support = (function( support ) { - - var all, a, input, select, fragment, opt, eventName, isSupported, i, - div = document.createElement("div"); - - // Setup - div.setAttribute( "className", "t" ); - div.innerHTML = "
a"; - - // Finish early in limited (non-browser) environments - all = div.getElementsByTagName("*") || []; - a = div.getElementsByTagName("a")[ 0 ]; - if ( !a || !a.style || !all.length ) { - return support; - } - - // First batch of tests - select = document.createElement("select"); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName("input")[ 0 ]; - - a.style.cssText = "top:1px;float:left;opacity:.5"; - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - support.getSetAttribute = div.className !== "t"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName("tbody").length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName("link").length; - - // Get the style information from getAttribute - // (IE uses .cssText instead) - support.style = /top/.test( a.getAttribute("style") ); - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - support.hrefNormalized = a.getAttribute("href") === "/a"; - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - support.opacity = /^0.5/.test( a.style.opacity ); - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - support.cssFloat = !!a.style.cssFloat; - - // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) - support.checkOn = !!input.value; - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - support.optSelected = opt.selected; - - // Tests for enctype support on a form (#6743) - support.enctype = !!document.createElement("form").enctype; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav>"; - - // Will be defined later - support.inlineBlockNeedsLayout = false; - support.shrinkWrapBlocks = false; - support.pixelPosition = false; - support.deleteExpando = true; - support.noCloneEvent = true; - support.reliableMarginRight = true; - support.boxSizingReliable = true; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Support: IE<9 - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - // Check if we can trust getAttribute("value") - input = document.createElement("input"); - input.setAttribute( "value", "" ); - support.input = input.getAttribute( "value" ) === ""; - - // Check if an input maintains its value after becoming a radio - input.value = "t"; - input.setAttribute( "type", "radio" ); - support.radioValue = input.value === "t"; - - // #11217 - WebKit loses check when the name is after the checked attribute - input.setAttribute( "checked", "t" ); - input.setAttribute( "name", "t" ); - - fragment = document.createDocumentFragment(); - fragment.appendChild( input ); - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event) - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - for ( i in { submit: true, change: true, focusin: true }) { - div.setAttribute( eventName = "on" + i, "t" ); - - support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false; - } - - div.style.backgroundClip = "content-box"; - div.cloneNode( true ).style.backgroundClip = ""; - support.clearCloneStyle = div.style.backgroundClip === "content-box"; - - // Support: IE<9 - // Iteration over object's inherited properties before its own. - for ( i in jQuery( support ) ) { - break; - } - support.ownLast = i !== "0"; - - // Run tests that need a body at doc ready - jQuery(function() { - var container, marginDiv, tds, - divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;", - body = document.getElementsByTagName("body")[0]; - - if ( !body ) { - // Return for frameset docs that don't have a body - return; - } - - container = document.createElement("div"); - container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; - - body.appendChild( container ).appendChild( div ); - - // Support: IE8 - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - div.innerHTML = "
t
"; - tds = div.getElementsByTagName("td"); - tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Support: IE8 - // Check if empty table cells still have offsetWidth/Height - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - - // Check box-sizing and margin behavior. - div.innerHTML = ""; - div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;"; - - // Workaround failing boxSizing test due to offsetWidth returning wrong value - // with some non-1 values of body zoom, ticket #13543 - jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { - support.boxSizing = div.offsetWidth === 4; - }); - - // Use window.getComputedStyle because jsdom on node.js will break without it. - if ( window.getComputedStyle ) { - support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; - support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. (#3333) - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - marginDiv = div.appendChild( document.createElement("div") ); - marginDiv.style.cssText = div.style.cssText = divReset; - marginDiv.style.marginRight = marginDiv.style.width = "0"; - div.style.width = "1px"; - - support.reliableMarginRight = - !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); - } - - if ( typeof div.style.zoom !== core_strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.innerHTML = ""; - div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1"; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 ); - - // Support: IE6 - // Check if elements with layout shrink-wrap their children - div.style.display = "block"; - div.innerHTML = "
"; - div.firstChild.style.width = "5px"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 3 ); - - if ( support.inlineBlockNeedsLayout ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); - - // Null elements to avoid leaks in IE - container = div = tds = marginDiv = null; - }); - - // Null elements to avoid leaks in IE - all = select = fragment = opt = a = input = null; - - return support; -})({}); - -var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, - rmultiDash = /([A-Z])/g; - -function internalData( elem, name, data, pvt /* Internal Use Only */ ){ - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = core_deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( jQuery.support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "applet": true, - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - // Do not set data on non-element because it will not be cleared (#8335). - if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) { - return false; - } - - var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ]; - - // nodes accept data unless otherwise specified; rejection can be conditional - return !noData || noData !== true && elem.getAttribute("classid") === noData; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var attrs, name, - data = null, - i = 0, - elem = this[0]; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - attrs = elem.attributes; - for ( ; i < attrs.length; i++ ) { - name = attrs[i].name; - - if ( name.indexOf("data-") === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - - dataAttr( elem, name, data[ name ] ); - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return arguments.length > 1 ? - - // Sets one value - this.each(function() { - jQuery.data( this, key, value ); - }) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null; - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var nodeHook, boolHook, - rclass = /[\t\r\n\f]/g, - rreturn = /\r/g, - rfocusable = /^(?:input|select|textarea|button|object)$/i, - rclickable = /^(?:a|area)$/i, - ruseDefault = /^(?:checked|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - getSetInput = jQuery.support.input; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call( this, j, this.className ) ); - }); - } - - if ( proceed ) { - // The disjunction here is for better compressibility (see removeClass) - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - " " - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - if ( cur.indexOf( " " + clazz + " " ) < 0 ) { - cur += clazz + " "; - } - } - elem.className = jQuery.trim( cur ); - - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classes, elem, cur, clazz, j, - i = 0, - len = this.length, - proceed = arguments.length === 0 || typeof value === "string" && value; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call( this, j, this.className ) ); - }); - } - if ( proceed ) { - classes = ( value || "" ).match( core_rnotwhite ) || []; - - for ( ; i < len; i++ ) { - elem = this[ i ]; - // This expression is here for better compressibility (see addClass) - cur = elem.nodeType === 1 && ( elem.className ? - ( " " + elem.className + " " ).replace( rclass, " " ) : - "" - ); - - if ( cur ) { - j = 0; - while ( (clazz = classes[j++]) ) { - // Remove *all* instances - while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { - cur = cur.replace( " " + clazz + " ", " " ); - } - } - elem.className = value ? jQuery.trim( cur ) : ""; - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value; - - if ( typeof stateVal === "boolean" && type === "string" ) { - return stateVal ? this.addClass( value ) : this.removeClass( value ); - } - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - classNames = value.match( core_rnotwhite ) || []; - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space separated list - if ( self.hasClass( className ) ) { - self.removeClass( className ); - } else { - self.addClass( className ); - } - } - - // Toggle whole class name - } else if ( type === core_strundefined || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // If the element has a class name or if we're passed "false", - // then remove the whole classname (if there was one, the above saved it). - // Otherwise bring back whatever was previously saved (if anything), - // falling back to the empty string if nothing was stored. - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var ret, hooks, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, jQuery( this ).val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // Use proper attribute retrieval(#6932, #12072) - var val = jQuery.find.attr( elem, "value" ); - return val != null ? - val : - elem.text; - } - }, - select: { - get: function( elem ) { - var value, option, - options = elem.options, - index = elem.selectedIndex, - one = elem.type === "select-one" || index < 0, - values = one ? null : [], - max = one ? index + 1 : options.length, - i = index < 0 ? - max : - one ? index : 0; - - // Loop through all the selected options - for ( ; i < max; i++ ) { - option = options[ i ]; - - // oldIE doesn't update selected after form reset (#2551) - if ( ( option.selected || i === index ) && - // Don't return options that are disabled or in a disabled optgroup - ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && - ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - }, - - set: function( elem, value ) { - var optionSet, option, - options = elem.options, - values = jQuery.makeArray( value ), - i = options.length; - - while ( i-- ) { - option = options[ i ]; - if ( (option.selected = jQuery.inArray( jQuery(option).val(), values ) >= 0) ) { - optionSet = true; - } - } - - // force browsers to behave consistently when non-matching value is set - if ( !optionSet ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attr: function( elem, name, value ) { - var hooks, ret, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - // Fallback to prop when attributes are not supported - if ( typeof elem.getAttribute === core_strundefined ) { - return jQuery.prop( elem, name, value ); - } - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || - ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - - } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, value + "" ); - return value; - } - - } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - ret = jQuery.find.attr( elem, name ); - - // Non-existent attributes return null, we normalize to undefined - return ret == null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var name, propName, - i = 0, - attrNames = value && value.match( core_rnotwhite ); - - if ( attrNames && elem.nodeType === 1 ) { - while ( (name = attrNames[i++]) ) { - propName = jQuery.propFix[ name ] || name; - - // Boolean attributes get special treatment (#10870) - if ( jQuery.expr.match.bool.test( name ) ) { - // Set corresponding property to false - if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { - elem[ propName ] = false; - // Support: IE<9 - // Also clear defaultChecked/defaultSelected (if appropriate) - } else { - elem[ jQuery.camelCase( "default-" + name ) ] = - elem[ propName ] = false; - } - - // See #9699 for explanation of this approach (setting first, then removal) - } else { - jQuery.attr( elem, name, "" ); - } - - elem.removeAttribute( getSetAttribute ? name : propName ); - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to default in case type is set after value during creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - } - }, - - propFix: { - "for": "htmlFor", - "class": "className" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? - ret : - ( elem[ name ] = value ); - - } else { - return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? - ret : - elem[ name ]; - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - // Use proper attribute retrieval(#12072) - var tabindex = jQuery.find.attr( elem, "tabindex" ); - - return tabindex ? - parseInt( tabindex, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - -1; - } - } - } -}); - -// Hooks for boolean attributes -boolHook = { - set: function( elem, value, name ) { - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { - // IE<8 needs the *property* name - elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); - - // Use defaultChecked and defaultSelected for oldIE - } else { - elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; - } - - return name; - } -}; -jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { - var getter = jQuery.expr.attrHandle[ name ] || jQuery.find.attr; - - jQuery.expr.attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? - function( elem, name, isXML ) { - var fn = jQuery.expr.attrHandle[ name ], - ret = isXML ? - undefined : - /* jshint eqeqeq: false */ - (jQuery.expr.attrHandle[ name ] = undefined) != - getter( elem, name, isXML ) ? - - name.toLowerCase() : - null; - jQuery.expr.attrHandle[ name ] = fn; - return ret; - } : - function( elem, name, isXML ) { - return isXML ? - undefined : - elem[ jQuery.camelCase( "default-" + name ) ] ? - name.toLowerCase() : - null; - }; -}); - -// fix oldIE attroperties -if ( !getSetInput || !getSetAttribute ) { - jQuery.attrHooks.value = { - set: function( elem, value, name ) { - if ( jQuery.nodeName( elem, "input" ) ) { - // Does not return so that setAttribute is also used - elem.defaultValue = value; - } else { - // Use nodeHook if defined (#1954); otherwise setAttribute is fine - return nodeHook && nodeHook.set( elem, value, name ); - } - } - }; -} - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = { - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - elem.setAttributeNode( - (ret = elem.ownerDocument.createAttribute( name )) - ); - } - - ret.value = value += ""; - - // Break association with cloned elements by also using setAttribute (#9646) - return name === "value" || value === elem.getAttribute( name ) ? - value : - undefined; - } - }; - jQuery.expr.attrHandle.id = jQuery.expr.attrHandle.name = jQuery.expr.attrHandle.coords = - // Some attributes are constructed with empty-string values when not defined - function( elem, name, isXML ) { - var ret; - return isXML ? - undefined : - (ret = elem.getAttributeNode( name )) && ret.value !== "" ? - ret.value : - null; - }; - jQuery.valHooks.button = { - get: function( elem, name ) { - var ret = elem.getAttributeNode( name ); - return ret && ret.specified ? - ret.value : - undefined; - }, - set: nodeHook.set - }; - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - set: function( elem, value, name ) { - nodeHook.set( elem, value === "" ? false : value, name ); - } - }; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }; - }); -} - - -// Some attributes require a special call on IE -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !jQuery.support.hrefNormalized ) { - // href/src property should get the full normalized URL (#10299/#12915) - jQuery.each([ "href", "src" ], function( i, name ) { - jQuery.propHooks[ name ] = { - get: function( elem ) { - return elem.getAttribute( name, 4 ); - } - }; - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Note: IE uppercases css property names, but if we were to .toLowerCase() - // .cssText, that would destroy case senstitivity in URL's, like in "background" - return elem.style.cssText || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = value + "" ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }; -} - -jQuery.each([ - "tabIndex", - "readOnly", - "maxLength", - "cellSpacing", - "cellPadding", - "rowSpan", - "colSpan", - "useMap", - "frameBorder", - "contentEditable" -], function() { - jQuery.propFix[ this.toLowerCase() ] = this; -}); - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }; - if ( !jQuery.support.checkOn ) { - jQuery.valHooks[ this ].get = function( elem ) { - // Support: Webkit - // "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - }; - } -}); -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( core_rnotwhite ) || [""]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = core_hasOwn.call( event, "type" ) ? event.type : event, - namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) { - event.preventDefault(); - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = core_slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Even when returnValue equals to undefined Firefox will still show alert - if ( event.result !== undefined ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === core_strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); -var isSimple = /^.[^:#\[\.,]*$/, - rparentsprev = /^(?:parents|prev(?:Until|All))/, - rneedsContext = jQuery.expr.match.needsContext, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - ret = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - cur = ret.push( cur ); - break; - } - } - } - - return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( jQuery.unique(all) ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( isSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); -} -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - col: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -jQuery.fn.extend({ - text: function( value ) { - return jQuery.access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - // keepData is for internal use only--do not document - remove: function( selector, keepData ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function () { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return jQuery.access( this, function( value ) { - var elem = this[0] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var - // Snapshot the DOM in case .domManip sweeps something relevant into its fragment - args = jQuery.map( this, function( elem ) { - return [ elem.nextSibling, elem.parentNode ]; - }), - i = 0; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - var next = args[ i++ ], - parent = args[ i++ ]; - - if ( parent ) { - // Don't use the snapshot next if it has moved (#13810) - if ( next && next.parentNode !== parent ) { - next = this.nextSibling; - } - jQuery( this ).remove(); - parent.insertBefore( elem, next ); - } - // Allow new content to include elements from the context set - }, true ); - - // Force removal if there was no new content (e.g., from empty arguments) - return i ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback, allowIntersection ) { - - // Flatten any nested arrays - args = core_concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); - } - self.domManip( args, callback, allowIntersection ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Hope ajax is available... - jQuery._evalUrl( node.src ); - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType === 1 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - core_push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( manipulation_rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !jQuery.support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
" && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !jQuery.support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = jQuery.support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== core_strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - core_deletedIds.push( id ); - } - } - } - } - }, - - _evalUrl: function( url ) { - return jQuery.ajax({ - url: url, - type: "GET", - dataType: "script", - async: false, - global: false, - "throws": true - }); - } -}); -jQuery.fn.extend({ - wrapAll: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapAll( html.call(this, i) ); - }); - } - - if ( this[0] ) { - // The elements to wrap the target around - var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); - - if ( this[0].parentNode ) { - wrap.insertBefore( this[0] ); - } - - wrap.map(function() { - var elem = this; - - while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { - elem = elem.firstChild; - } - - return elem; - }).append( this ); - } - - return this; - }, - - wrapInner: function( html ) { - if ( jQuery.isFunction( html ) ) { - return this.each(function(i) { - jQuery(this).wrapInner( html.call(this, i) ); - }); - } - - return this.each(function() { - var self = jQuery( this ), - contents = self.contents(); - - if ( contents.length ) { - contents.wrapAll( html ); - - } else { - self.append( html ); - } - }); - }, - - wrap: function( html ) { - var isFunction = jQuery.isFunction( html ); - - return this.each(function(i) { - jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); - }); - }, - - unwrap: function() { - return this.parent().each(function() { - if ( !jQuery.nodeName( this, "body" ) ) { - jQuery( this ).replaceWith( this.childNodes ); - } - }).end(); - } -}); -var iframe, getStyles, curCSS, - ralpha = /alpha\([^)]*\)/i, - ropacity = /opacity\s*=\s*([^)]*)/, - rposition = /^(top|right|bottom|left)$/, - // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" - // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display - rdisplayswap = /^(none|table(?!-c[ea]).+)/, - rmargin = /^margin/, - rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ), - rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ), - rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ), - elemdisplay = { BODY: "block" }, - - cssShow = { position: "absolute", visibility: "hidden", display: "block" }, - cssNormalTransform = { - letterSpacing: 0, - fontWeight: 400 - }, - - cssExpand = [ "Top", "Right", "Bottom", "Left" ], - cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; - -// return a css property mapped to a potentially vendor prefixed property -function vendorPropName( style, name ) { - - // shortcut for names that are not vendor prefixed - if ( name in style ) { - return name; - } - - // check for vendor prefixed names - var capName = name.charAt(0).toUpperCase() + name.slice(1), - origName = name, - i = cssPrefixes.length; - - while ( i-- ) { - name = cssPrefixes[ i ] + capName; - if ( name in style ) { - return name; - } - } - - return origName; -} - -function isHidden( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); -} - -function showHide( elements, show ) { - var display, elem, hidden, - values = [], - index = 0, - length = elements.length; - - for ( ; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - - values[ index ] = jQuery._data( elem, "olddisplay" ); - display = elem.style.display; - if ( show ) { - // Reset the inline display of this element to learn if it is - // being hidden by cascaded rules or not - if ( !values[ index ] && display === "none" ) { - elem.style.display = ""; - } - - // Set elements which have been overridden with display: none - // in a stylesheet to whatever the default browser style is - // for such an element - if ( elem.style.display === "" && isHidden( elem ) ) { - values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) ); - } - } else { - - if ( !values[ index ] ) { - hidden = isHidden( elem ); - - if ( display && display !== "none" || !hidden ) { - jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); - } - } - } - } - - // Set the display of most of the elements in a second loop - // to avoid the constant reflow - for ( index = 0; index < length; index++ ) { - elem = elements[ index ]; - if ( !elem.style ) { - continue; - } - if ( !show || elem.style.display === "none" || elem.style.display === "" ) { - elem.style.display = show ? values[ index ] || "" : "none"; - } - } - - return elements; -} - -jQuery.fn.extend({ - css: function( name, value ) { - return jQuery.access( this, function( elem, name, value ) { - var len, styles, - map = {}, - i = 0; - - if ( jQuery.isArray( name ) ) { - styles = getStyles( elem ); - len = name.length; - - for ( ; i < len; i++ ) { - map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); - } - - return map; - } - - return value !== undefined ? - jQuery.style( elem, name, value ) : - jQuery.css( elem, name ); - }, name, value, arguments.length > 1 ); - }, - show: function() { - return showHide( this, true ); - }, - hide: function() { - return showHide( this ); - }, - toggle: function( state ) { - if ( typeof state === "boolean" ) { - return state ? this.show() : this.hide(); - } - - return this.each(function() { - if ( isHidden( this ) ) { - jQuery( this ).show(); - } else { - jQuery( this ).hide(); - } - }); - } -}); - -jQuery.extend({ - // Add in style property hooks for overriding the default - // behavior of getting and setting a style property - cssHooks: { - opacity: { - get: function( elem, computed ) { - if ( computed ) { - // We should always get a number back from opacity - var ret = curCSS( elem, "opacity" ); - return ret === "" ? "1" : ret; - } - } - } - }, - - // Don't automatically add "px" to these possibly-unitless properties - cssNumber: { - "columnCount": true, - "fillOpacity": true, - "fontWeight": true, - "lineHeight": true, - "opacity": true, - "order": true, - "orphans": true, - "widows": true, - "zIndex": true, - "zoom": true - }, - - // Add in properties whose names you wish to fix before - // setting or getting the value - cssProps: { - // normalize float css property - "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat" - }, - - // Get and set the style property on a DOM Node - style: function( elem, name, value, extra ) { - // Don't set styles on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { - return; - } - - // Make sure that we're working with the right name - var ret, type, hooks, - origName = jQuery.camelCase( name ), - style = elem.style; - - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // Check if we're setting a value - if ( value !== undefined ) { - type = typeof value; - - // convert relative number strings (+= or -=) to relative numbers. #7345 - if ( type === "string" && (ret = rrelNum.exec( value )) ) { - value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); - // Fixes bug #9237 - type = "number"; - } - - // Make sure that NaN and null values aren't set. See: #7116 - if ( value == null || type === "number" && isNaN( value ) ) { - return; - } - - // If a number was passed in, add 'px' to the (except for certain CSS properties) - if ( type === "number" && !jQuery.cssNumber[ origName ] ) { - value += "px"; - } - - // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, - // but it would mean to define eight (for every problematic property) identical functions - if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { - style[ name ] = "inherit"; - } - - // If a hook was provided, use that value, otherwise just set the specified value - if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { - - // Wrapped to prevent IE from throwing errors when 'invalid' values are provided - // Fixes bug #5509 - try { - style[ name ] = value; - } catch(e) {} - } - - } else { - // If a hook was provided get the non-computed value from there - if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { - return ret; - } - - // Otherwise just get the value from the style object - return style[ name ]; - } - }, - - css: function( elem, name, extra, styles ) { - var num, val, hooks, - origName = jQuery.camelCase( name ); - - // Make sure that we're working with the right name - name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); - - // gets hook for the prefixed version - // followed by the unprefixed version - hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; - - // If a hook was provided get the computed value from there - if ( hooks && "get" in hooks ) { - val = hooks.get( elem, true, extra ); - } - - // Otherwise, if a way to get the computed value exists, use that - if ( val === undefined ) { - val = curCSS( elem, name, styles ); - } - - //convert "normal" to computed value - if ( val === "normal" && name in cssNormalTransform ) { - val = cssNormalTransform[ name ]; - } - - // Return, converting to number if forced or a qualifier was provided and val looks numeric - if ( extra === "" || extra ) { - num = parseFloat( val ); - return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; - } - return val; - } -}); - -// NOTE: we've included the "window" in window.getComputedStyle -// because jsdom on node.js will break without it. -if ( window.getComputedStyle ) { - getStyles = function( elem ) { - return window.getComputedStyle( elem, null ); - }; - - curCSS = function( elem, name, _computed ) { - var width, minWidth, maxWidth, - computed = _computed || getStyles( elem ), - - // getPropertyValue is only needed for .css('filter') in IE9, see #12537 - ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined, - style = elem.style; - - if ( computed ) { - - if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { - ret = jQuery.style( elem, name ); - } - - // A tribute to the "awesome hack by Dean Edwards" - // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right - // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values - if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { - - // Remember the original values - width = style.width; - minWidth = style.minWidth; - maxWidth = style.maxWidth; - - // Put in the new values to get a computed value out - style.minWidth = style.maxWidth = style.width = ret; - ret = computed.width; - - // Revert the changed values - style.width = width; - style.minWidth = minWidth; - style.maxWidth = maxWidth; - } - } - - return ret; - }; -} else if ( document.documentElement.currentStyle ) { - getStyles = function( elem ) { - return elem.currentStyle; - }; - - curCSS = function( elem, name, _computed ) { - var left, rs, rsLeft, - computed = _computed || getStyles( elem ), - ret = computed ? computed[ name ] : undefined, - style = elem.style; - - // Avoid setting ret to empty string here - // so we don't default to auto - if ( ret == null && style && style[ name ] ) { - ret = style[ name ]; - } - - // From the awesome hack by Dean Edwards - // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 - - // If we're not dealing with a regular pixel number - // but a number that has a weird ending, we need to convert it to pixels - // but not position css attributes, as those are proportional to the parent element instead - // and we can't measure the parent instead because it might trigger a "stacking dolls" problem - if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { - - // Remember the original values - left = style.left; - rs = elem.runtimeStyle; - rsLeft = rs && rs.left; - - // Put in the new values to get a computed value out - if ( rsLeft ) { - rs.left = elem.currentStyle.left; - } - style.left = name === "fontSize" ? "1em" : ret; - ret = style.pixelLeft + "px"; - - // Revert the changed values - style.left = left; - if ( rsLeft ) { - rs.left = rsLeft; - } - } - - return ret === "" ? "auto" : ret; - }; -} - -function setPositiveNumber( elem, value, subtract ) { - var matches = rnumsplit.exec( value ); - return matches ? - // Guard against undefined "subtract", e.g., when used as in cssHooks - Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : - value; -} - -function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { - var i = extra === ( isBorderBox ? "border" : "content" ) ? - // If we already have the right measurement, avoid augmentation - 4 : - // Otherwise initialize for horizontal or vertical properties - name === "width" ? 1 : 0, - - val = 0; - - for ( ; i < 4; i += 2 ) { - // both box models exclude margin, so add it if we want it - if ( extra === "margin" ) { - val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); - } - - if ( isBorderBox ) { - // border-box includes padding, so remove it if we want content - if ( extra === "content" ) { - val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - } - - // at this point, extra isn't border nor margin, so remove border - if ( extra !== "margin" ) { - val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } else { - // at this point, extra isn't content, so add padding - val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); - - // at this point, extra isn't content nor padding, so add border - if ( extra !== "padding" ) { - val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); - } - } - } - - return val; -} - -function getWidthOrHeight( elem, name, extra ) { - - // Start with offset property, which is equivalent to the border-box value - var valueIsBorderBox = true, - val = name === "width" ? elem.offsetWidth : elem.offsetHeight, - styles = getStyles( elem ), - isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; - - // some non-html elements return undefined for offsetWidth, so check for null/undefined - // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 - // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 - if ( val <= 0 || val == null ) { - // Fall back to computed then uncomputed css if necessary - val = curCSS( elem, name, styles ); - if ( val < 0 || val == null ) { - val = elem.style[ name ]; - } - - // Computed unit is not pixels. Stop here and return. - if ( rnumnonpx.test(val) ) { - return val; - } - - // we need the check for style in case a browser which returns unreliable values - // for getComputedStyle silently falls back to the reliable elem.style - valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] ); - - // Normalize "", auto, and prepare for extra - val = parseFloat( val ) || 0; - } - - // use the active box-sizing model to add/subtract irrelevant styles - return ( val + - augmentWidthOrHeight( - elem, - name, - extra || ( isBorderBox ? "border" : "content" ), - valueIsBorderBox, - styles - ) - ) + "px"; -} - -// Try to determine the default display value of an element -function css_defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - // Use the already-created iframe if possible - iframe = ( iframe || - jQuery("\n" - + ""); - } - - void html5NegatedOutput() { - // Negated test for overview-frame page - checkOutput("overview-frame.html", false, - "", - "\n" - + "
    \n" - + "
  • All Classes
  • ", - "
    \n" - + "

    Packages

    "); - - // Negated test for allclasses-frame page - checkOutput("allclasses-frame.html", false, - "", - "\n" - + "
      \n" - + "
    • "); - - // Negated test for allclasses-noframe page - checkOutput("allclasses-noframe.html", false, - "", - "\n" - + "
        \n" - + "
      • "); - - // Negated test for overview-summary page - checkOutput("overview-summary.html", false, - "", - "\n" - + "\n" - + "", - "
\n" - + "
", - "\n" - + "
\n" - + ""); - - // Negated test for package-frame page - checkOutput("pkg/package-frame.html", false, - "", - "\n" - + "

pkg

"); - - // Negated test for package-summary page - checkOutput("pkg/package-summary.html", false, - "", - "\n" - + "\n" - + "", - "", - "
", - "
", - "
", - "
", - "
"); - - // Negated test for package-tree page - checkOutput("pkg/package-tree.html", false, - "", - "\n" - + "\n" - + ""); - - // Negated test for package-use page - checkOutput("pkg1/package-use.html", false, - "", - "\n" - + "\n" - + "", - "
"); - - // Negated test for constant-values page - checkOutput("constant-values.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "\n" - + "
 
\n" - + "
", - "
"); - - // Negated test for deprecated-list page - checkOutput("deprecated-list.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "\n" - + "
 
\n" - + "
\n" - + "

Deprecated API

\n" - + "

Contents

", - "
", - "
", - "
", - "
", - "
", - "
", - "
", - "
", - "
", - "
"); - - // Negated test for serialized-form page - checkOutput("serialized-form.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "\n" - + "
 
\n" - + "
", - "
  • \n" - + "

    Package pkg

    "); - - // Negated test for overview-tree page - checkOutput("overview-tree.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "
  • \n" - + "
     
    \n" - + "
    ", - "
    \n" - + "

    Class Hierarchy

    ", - "\n" - + "

    Interface Hierarchy

    ", - "\n" - + "

    Enum Hierarchy

    "); - - // Negated test for index-all page - checkOutput("index-all.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "
    \n" - + "
     
    \n" - + "
    "); - - // Negated test for src-html page - checkOutput("src-html/pkg/AnotherClass.html", false, - "", - "\n" - + "
    "); - - // Negated test for help-doc page - checkOutput("help-doc.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "
    \n" - + "
     
    \n" - + "
    ", - "
      \n" - + "
    • \n" - + "

      Overview

      ", - "
    • \n" - + "

      Package

      ", - "
    • \n" - + "

      Class/Interface

      "); - - // Negated test for a regular class page and members (nested class, field, constructore and method) - checkOutput("pkg/AnotherClass.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "
      ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
      \n" - + "
    • \n" - + "\n" - + "\n" - + "

      Field Detail

      ", - "\n" - + "
        \n" - + "
      • \n" - + "\n" - + "\n" - + "

        Constructor Detail

        ", - "\n" - + "
          \n" - + "
        • \n" - + "\n" - + "\n" - + "

          Method Detail

          "); - - // Negated test for enum page - checkOutput("pkg/AnotherClass.ModalExclusionType.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "
          ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
      \n" - + "
    • \n" - + "\n" - + "\n" - + "

      Enum Constant Detail

      ", - "\n" - + "
        \n" - + "
      • \n" - + "\n" - + "\n" - + "

        Method Detail

        "); - - // Negated test for interface page - checkOutput("pkg2/Interface.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "
        ", - "\n" - + "
    ", - "\n" - + "
      \n" - + "
    • \n" - + "\n" - + "\n" - + "

      Method Detail

      "); - - // Negated test for error page - checkOutput("pkg/TestError.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "
      ", - "\n" - + "
        \n" - + "
      • \n" - + "\n" - + "\n" - + "

        Constructor Summary

        ", - "\n" - + "
          \n" - + "
        • \n" - + "\n" - + "\n" - + "

          Constructor Detail

          "); - - // Negated test for exception page - checkOutput("pkg/TestException.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "
          ", - "\n" - + "
            \n" - + "
          • \n" - + "\n" - + "\n" - + "

            Constructor Summary

            ", - "\n" - + "
              \n" - + "
            • \n" - + "\n" - + "\n" - + "

              Constructor Detail

              "); - - // Negated test for annotation page - checkOutput("pkg2/TestAnnotationType.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "
              ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
      \n" - + "
    • \n" - + "\n" - + "\n" - + "

      Element Detail

      "); - - // Negated test for class use page - checkOutput("pkg1/class-use/RegClass.html", false, - "", - "\n" - + "\n" - + "", - "\n" - + "\n" - + "
       
      \n" - + "
      ", - "
    ", - "
  • \n" - + "\n" - + "\n" - + "

    Uses of RegClass in pkg

    \n" - + "
  • "); - - // Negated test for main index page - checkOutput("index.html", false, - "", - "\n" - + "
    \n"); - } - - void html4Output() { - // Test for overview-frame page - checkOutput("overview-frame.html", true, - "", - "\n" - + "
      \n" - + "
    • All Classes
    • ", - "
      \n" - + "

      Packages

      "); - - // Test for allclasses-frame page - checkOutput("allclasses-frame.html", true, - "", - "\n" - + "
        \n" - + "
      • "); - - // Test for allclasses-noframe page - checkOutput("allclasses-noframe.html", true, - "", - "\n" - + "
          \n" - + "
        • "); - - // Test for overview-summary page - checkOutput("overview-summary.html", true, - "", - "\n" - + "\n" - + "", - "
    \n" - + "
    ", - "\n" - + "
    \n" - + ""); - - // Test for package-frame page - checkOutput("pkg/package-frame.html", true, - "", - "\n" - + "

    pkg

    "); - - // Test for package-summary page - checkOutput("pkg/package-summary.html", true, - "", - "\n" - + "\n" - + "", - "", - "
    ", - "
    ", - "
    ", - "
    ", - "
    "); - - // Test for package-tree page - checkOutput("pkg/package-tree.html", true, - "", - "\n" - + "\n" - + "", - "
  • "); - - // Test for package-use page - checkOutput("pkg1/package-use.html", true, - "", - "\n" - + "\n" - + "", - "
  • "); - - // Test for constant-values page - checkOutput("constant-values.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "\n" - + "
     
    \n" - + "
    ", - "
    "); - - // Test for deprecated-list page - checkOutput("deprecated-list.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "\n" - + "
     
    \n" - + "
    \n" - + "

    Deprecated API

    \n" - + "

    Contents

    ", - "
    ", - "
    ", - "
    ", - "
    ", - "
    ", - "
    ", - "
    ", - "
    ", - "
    ", - "
    "); - - // Test for serialized-form page - checkOutput("serialized-form.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "\n" - + "
     
    \n" - + "
    ", - "
  • \n" - + "

    Package pkg

    "); - - // Test for overview-tree page - checkOutput("overview-tree.html", true, - "", - "\n" - + "\n" - + "", - "
  • ", - "\n" - + "
  • \n" - + "
     
    \n" - + "
    ", - "

    Hierarchy For All Packages

    \n" - + "Package Hierarchies:", - "
    \n" - + "

    Class Hierarchy

    ", - "\n" - + "

    Interface Hierarchy

    ", - "\n" - + "

    Enum Hierarchy

    "); - - // Test for index-all page - checkOutput("index-all.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "
    \n" - + "
     
    \n" - + "
    "); - - // Test for src-html page - checkOutput("src-html/pkg/AnotherClass.html", true, - "", - "\n" - + "
    "); - - // Test for help-doc page - checkOutput("help-doc.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "
    \n" - + "
     
    \n" - + "
    ", - "
      \n" - + "
    • \n" - + "

      Overview

      ", - "
    • \n" - + "

      Package

      ", - "
    • \n" - + "

      Class/Interface

      "); - - // Test for a regular class page and members (nested class, field, constructore and method) - checkOutput("pkg/AnotherClass.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "
      ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
      \n" - + "
    • \n" - + "\n" - + "\n" - + "

      Field Detail

      ", - "\n" - + "
        \n" - + "
      • \n" - + "\n" - + "\n" - + "

        Constructor Detail

        ", - "\n" - + "
          \n" - + "
        • \n" - + "\n" - + "\n" - + "

          Method Detail

          "); - - // Test for enum page - checkOutput("pkg/AnotherClass.ModalExclusionType.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "
          ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
      \n" - + "
    • \n" - + "\n" - + "\n" - + "

      Enum Constant Detail

      ", - "\n" - + "
        \n" - + "
      • \n" - + "\n" - + "\n" - + "

        Method Detail

        "); - - // Test for interface page - checkOutput("pkg2/Interface.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "
        ", - "\n" - + "
    ", - "\n" - + "
      \n" - + "
    • \n" - + "\n" - + "\n" - + "

      Method Detail

      "); - - // Test for error page - checkOutput("pkg/TestError.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "
      ", - "\n" - + "
        \n" - + "
      • \n" - + "\n" - + "\n" - + "

        Constructor Summary

        ", - "\n" - + "
          \n" - + "
        • \n" - + "\n" - + "\n" - + "

          Constructor Detail

          "); - - // Test for exception page - checkOutput("pkg/TestException.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "
          ", - "\n" - + "
            \n" - + "
          • \n" - + "\n" - + "\n" - + "

            Constructor Summary

            ", - "\n" - + "
              \n" - + "
            • \n" - + "\n" - + "\n" - + "

              Constructor Detail

              "); - - // Test for annotation page - checkOutput("pkg2/TestAnnotationType.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "
              ", - "\n" - + "
    ", - "\n" - + "
    ", - "\n" - + "
      \n" - + "
    • \n" - + "\n" - + "\n" - + "

      Element Detail

      "); - - // Test for class use page - checkOutput("pkg1/class-use/RegClass.html", true, - "", - "\n" - + "\n" - + "", - "\n" - + "\n" - + "
       
      \n" - + "
      ", - "
    ", - "
  • \n" - + "\n" - + "\n" - + "

    Uses of RegClass in pkg

    \n" - + "
  • "); - - // Test for main index page - checkOutput("index.html", true, - "", - "", - "\n" - + "
    \n" - + "
    \n" - + "
    \n" - + "\n" - + "
    "); - } - - void html4NegatedOutput() { - // Negated test for overview-frame page - checkOutput("overview-frame.html", false, - "", - "\n" - + "
      \n" - + "
    • All Classes
    • ", - "
      \n" - + "

      Packages

      "); - - // Negated test for allclasses-frame page - checkOutput("allclasses-frame.html", false, - "", - "\n" - + "
        \n" - + "
      • "); - - // Negated test for allclasses-noframe page - checkOutput("allclasses-noframe.html", false, - "", - "\n" - + "
          \n" - + "
        • "); - - // Negated test for overview-summary page - checkOutput("overview-summary.html", false, - "", - "\n" - + "\n" - + "", - "
    \n" - + "
    ", - "
    \n" - + "