diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java index 84d95d9af64..92385d97352 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java @@ -246,7 +246,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { if (doc instanceof MethodDoc) { addMethodInfo((MethodDoc) doc, dl); } - TagletOutputImpl output = new TagletOutputImpl(""); + TagletOutput output = new TagletOutputImpl(); TagletWriter.genTagOuput(configuration.tagletManager, doc, configuration.tagletManager.getCustomTags(doc), getTagletWriterInstance(false), output); @@ -266,7 +266,7 @@ public class HtmlDocletWriter extends HtmlDocWriter { * @return true if there are tags to be printed else return false. */ protected boolean hasSerializationOverviewTags(FieldDoc field) { - TagletOutputImpl output = new TagletOutputImpl(""); + TagletOutput output = new TagletOutputImpl(); TagletWriter.genTagOuput(configuration.tagletManager, field, configuration.tagletManager.getCustomTags(field), getTagletWriterInstance(false), output); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java index 49076f59131..ae4f257b57f 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java @@ -46,7 +46,7 @@ import com.sun.tools.doclets.internal.toolkit.taglets.*; * @author Bhavesh Patel (Modified) */ public class HtmlSerialFieldWriter extends FieldWriterImpl - implements SerializedFormWriter.SerialFieldWriter { + implements SerializedFormWriter.SerialFieldWriter { ProgramElementDoc[] members = null; private boolean printedOverallAnchor = false; @@ -186,7 +186,7 @@ public class HtmlSerialFieldWriter extends FieldWriterImpl * @param contentTree the tree to which the member tags info will be added */ public void addMemberTags(FieldDoc field, Content contentTree) { - TagletOutputImpl output = new TagletOutputImpl(""); + TagletOutput output = new TagletOutputImpl(); TagletWriter.genTagOuput(configuration.tagletManager, field, configuration.tagletManager.getCustomTags(field), writer.getTagletWriterInstance(false), output); diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java index d71b4370cc6..0603865f1dd 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -146,7 +146,7 @@ public class HtmlSerialMethodWriter extends MethodWriterImpl implements * @param methodsContentTree the tree to which the member tags info will be added */ public void addMemberTags(MethodDoc member, Content methodsContentTree) { - TagletOutputImpl output = new TagletOutputImpl(""); + TagletOutput output = new TagletOutputImpl(); TagletManager tagletManager = configuration.tagletManager; TagletWriter.genTagOuput(tagletManager, member, diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java index 0dfb46787f5..2ff801edec5 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -25,6 +25,9 @@ package com.sun.tools.doclets.formats.html; +import com.sun.tools.doclets.formats.html.markup.ContentBuilder; +import com.sun.tools.doclets.formats.html.markup.RawHtml; +import com.sun.tools.doclets.internal.toolkit.Content; import com.sun.tools.doclets.internal.toolkit.taglets.*; /** @@ -37,45 +40,54 @@ import com.sun.tools.doclets.internal.toolkit.taglets.*; * * @since 1.5 * @author Jamie Ho + * @author Jonathan Gibbons (rewrite) */ public class TagletOutputImpl implements TagletOutput { - private StringBuilder output; + private ContentBuilder content; + + public TagletOutputImpl() { + content = new ContentBuilder(); + } public TagletOutputImpl(String o) { setOutput(o); } + public TagletOutputImpl(Content c) { + setOutput(c); + } + /** * {@inheritDoc} */ public void setOutput (Object o) { - output = new StringBuilder(o == null ? "" : (String) o); + content = new ContentBuilder(); + if (o != null) { + if (o instanceof String) + content.addContent(new RawHtml((String) o)); + else if (o instanceof Content) + content.addContent((Content) o); + else if (o instanceof TagletOutputImpl) + content.addContent(((TagletOutputImpl) o).content); + else + throw new IllegalArgumentException(o.getClass().getName()); + } } /** * {@inheritDoc} */ public void appendOutput(TagletOutput o) { - output.append(o.toString()); - } - - /** - * {@inheritDoc} - */ - public boolean hasInheritDocTag() { - return output.indexOf(InheritDocTaglet.INHERIT_DOC_INLINE_TAG) != -1; + if (o instanceof TagletOutputImpl) + content.addContent(((TagletOutputImpl) o).content); + else + throw new IllegalArgumentException(o.getClass().getName()); } public String toString() { - return output.toString(); + return content.toString(); } - /** - * Check whether the taglet output is empty. - */ - public boolean isEmpty() { - return (toString().trim().isEmpty()); - } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java index e362ac6722c..415ff5eff43 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java @@ -26,9 +26,12 @@ 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.HtmlAttr; +import com.sun.tools.doclets.formats.html.markup.HtmlStyle; import com.sun.tools.doclets.formats.html.markup.HtmlTag; 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; @@ -63,7 +66,7 @@ public class TagletWriterImpl extends TagletWriter { * {@inheritDoc} */ public TagletOutput getOutputInstance() { - return new TagletOutputImpl(""); + return new TagletOutputImpl(); } /** @@ -71,7 +74,7 @@ public class TagletWriterImpl extends TagletWriter { */ protected TagletOutput codeTagOutput(Tag tag) { Content result = HtmlTree.CODE(new StringContent(tag.text())); - return new TagletOutputImpl(result.toString()); + return new TagletOutputImpl(result); } /** @@ -90,18 +93,17 @@ public class TagletWriterImpl extends TagletWriter { * {@inheritDoc} */ public TagletOutput deprecatedTagOutput(Doc doc) { - StringBuilder output = new StringBuilder(); + ContentBuilder result = new ContentBuilder(); Tag[] deprs = doc.tags("deprecated"); if (doc instanceof ClassDoc) { if (Util.isDeprecated((ProgramElementDoc) doc)) { - output.append("" + - configuration. - getText("doclet.Deprecated") + " "); + result.addContent(HtmlTree.SPAN(HtmlStyle.strong, + new StringContent(configuration.getText("doclet.Deprecated")))); + result.addContent(RawHtml.nbsp); if (deprs.length > 0) { Tag[] commentTags = deprs[0].inlineTags(); if (commentTags.length > 0) { - - output.append(commentTagsToOutput(null, doc, + result.addContent(commentTagsToOutput(null, doc, deprs[0].inlineTags(), false).toString() ); } @@ -110,24 +112,23 @@ public class TagletWriterImpl extends TagletWriter { } else { MemberDoc member = (MemberDoc) doc; if (Util.isDeprecated((ProgramElementDoc) doc)) { - output.append("" + - configuration. - getText("doclet.Deprecated") + " "); + result.addContent(HtmlTree.SPAN(HtmlStyle.strong, + new StringContent(configuration.getText("doclet.Deprecated")))); + result.addContent(RawHtml.nbsp); if (deprs.length > 0) { - output.append(""); - output.append(commentTagsToOutput(null, doc, - deprs[0].inlineTags(), false).toString()); - output.append(""); + TagletOutput body = commentTagsToOutput(null, doc, + deprs[0].inlineTags(), false); + result.addContent(HtmlTree.I(new RawHtml(body.toString()))); } } else { if (Util.isDeprecated(member.containingClass())) { - output.append("" + - configuration. - getText("doclet.Deprecated") + " "); + result.addContent(HtmlTree.SPAN(HtmlStyle.strong, + new StringContent(configuration.getText("doclet.Deprecated")))); + result.addContent(RawHtml.nbsp); } } } - return new TagletOutputImpl(output.toString()); + return new TagletOutputImpl(result); } /** @@ -136,7 +137,7 @@ public class TagletWriterImpl extends TagletWriter { protected TagletOutput expertTagOutput(Tag tag) { HtmlTree result = new HtmlTree(HtmlTag.SUB, new StringContent(tag.text())); result.addAttr(HtmlAttr.ID, "expert"); - return new TagletOutputImpl(result.toString()); + return new TagletOutputImpl(result); } /** @@ -144,7 +145,7 @@ public class TagletWriterImpl extends TagletWriter { */ protected TagletOutput literalTagOutput(Tag tag) { Content result = new StringContent(tag.text()); - return new TagletOutputImpl(result.toString()); + return new TagletOutputImpl(result); } /** @@ -158,95 +159,102 @@ public class TagletWriterImpl extends TagletWriter { * {@inheritDoc} */ public TagletOutput getParamHeader(String header) { - StringBuilder result = new StringBuilder(); - result.append("
"); - result.append("").append(header).append("
"); - return new TagletOutputImpl(result.toString()); + HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, + new StringContent(header))); + return new TagletOutputImpl(result); } /** * {@inheritDoc} */ public TagletOutput paramTagOutput(ParamTag paramTag, String paramName) { - TagletOutput result = new TagletOutputImpl("
" + paramName + "" - + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false) + "
"); - return result; + ContentBuilder body = new ContentBuilder(); + body.addContent(HtmlTree.CODE(new RawHtml(paramName))); + body.addContent(" - "); + body.addContent(new RawHtml(htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false))); + HtmlTree result = HtmlTree.DD(body); + return new TagletOutputImpl(result); } /** * {@inheritDoc} */ public TagletOutput returnTagOutput(Tag returnTag) { - TagletOutput result = new TagletOutputImpl(DocletConstants.NL + "
" + - "" + configuration.getText("doclet.Returns") + - "" + "
" + "
" + - htmlWriter.commentTagsToString(returnTag, null, returnTag.inlineTags(), - false) + "
"); - return result; + ContentBuilder result = new ContentBuilder(); + result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, + new StringContent(configuration.getText("doclet.Returns"))))); + result.addContent(HtmlTree.DD(new RawHtml(htmlWriter.commentTagsToString( + returnTag, null, returnTag.inlineTags(), false)))); + return new TagletOutputImpl(result); } /** * {@inheritDoc} */ public TagletOutput seeTagOutput(Doc holder, SeeTag[] seeTags) { - String result = ""; + ContentBuilder body = new ContentBuilder(); if (seeTags.length > 0) { - result = addSeeHeader(result); for (int i = 0; i < seeTags.length; ++i) { - if (i > 0) { - result += ", " + DocletConstants.NL; - } - result += htmlWriter.seeTagToString(seeTags[i]); + appendSeparatorIfNotEmpty(body); + body.addContent(new RawHtml(htmlWriter.seeTagToString(seeTags[i]))); } } if (holder.isField() && ((FieldDoc)holder).constantValue() != null && htmlWriter instanceof ClassWriterImpl) { //Automatically add link to constant values page for constant fields. - result = addSeeHeader(result); + appendSeparatorIfNotEmpty(body); DocPath constantsPath = htmlWriter.pathToRoot.resolve(DocPaths.CONSTANT_VALUES); String whichConstant = ((ClassWriterImpl) htmlWriter).getClassDoc().qualifiedName() + "." + ((FieldDoc) holder).name(); DocLink link = constantsPath.fragment(whichConstant); - result += htmlWriter.getHyperLinkString(link, - configuration.getText("doclet.Constants_Summary")); + 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()))) { - result = addSeeHeader(result); + appendSeparatorIfNotEmpty(body); DocPath serialPath = htmlWriter.pathToRoot.resolve(DocPaths.SERIALIZED_FORM); DocLink link = serialPath.fragment(((ClassDoc)holder).qualifiedName()); - result += htmlWriter.getHyperLinkString(link, - configuration.getText("doclet.Serialized_Form")); + body.addContent(htmlWriter.getHyperLink(link, + new StringContent(configuration.getText("doclet.Serialized_Form")))); } } - return result.equals("") ? null : new TagletOutputImpl(result + ""); + if (body.isEmpty()) + return new TagletOutputImpl(body); + + ContentBuilder result = new ContentBuilder(); + result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, + new StringContent(configuration.getText("doclet.See_Also"))))); + result.addContent(HtmlTree.DD(body)); + return new TagletOutputImpl(result); + } - private String addSeeHeader(String result) { - if (result != null && result.length() > 0) { - return result + ", " + DocletConstants.NL; - } else { - return "
" + - configuration.getText("doclet.See_Also") + "
"; + private void appendSeparatorIfNotEmpty(ContentBuilder body) { + if (!body.isEmpty()) { + body.addContent(", "); + body.addContent(DocletConstants.NL); } - } + } /** * {@inheritDoc} */ public TagletOutput simpleTagOutput(Tag[] simpleTags, String header) { - String result = "
" + header + "
" + DocletConstants.NL + - "
"; + ContentBuilder result = new ContentBuilder(); + result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, new RawHtml(header)))); + ContentBuilder body = new ContentBuilder(); for (int i = 0; i < simpleTags.length; i++) { if (i > 0) { - result += ", "; + body.addContent(", "); } - result += htmlWriter.commentTagsToString(simpleTags[i], null, simpleTags[i].inlineTags(), false); + body.addContent(new RawHtml(htmlWriter.commentTagsToString( + simpleTags[i], null, simpleTags[i].inlineTags(), false))); } - result += "
" + DocletConstants.NL; + result.addContent(HtmlTree.DD(body)); return new TagletOutputImpl(result); } @@ -254,46 +262,50 @@ public class TagletWriterImpl extends TagletWriter { * {@inheritDoc} */ public TagletOutput simpleTagOutput(Tag simpleTag, String header) { - return new TagletOutputImpl("
" + header + "
" + "
" - + htmlWriter.commentTagsToString(simpleTag, null, simpleTag.inlineTags(), false) - + "
" + DocletConstants.NL); - } - - /** - * {@inheritDoc} - */ - public TagletOutput getThrowsHeader() { - return new TagletOutputImpl(DocletConstants.NL + "
" + "" + - configuration.getText("doclet.Throws") + "
"); - } - - /** - * {@inheritDoc} - */ - public TagletOutput throwsTagOutput(ThrowsTag throwsTag) { - String result = DocletConstants.NL + "
"; - result += throwsTag.exceptionType() == null ? - htmlWriter.codeText(throwsTag.exceptionName()) : - htmlWriter.codeText( - htmlWriter.getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, - throwsTag.exceptionType())).toString()); - TagletOutput text = new TagletOutputImpl( - htmlWriter.commentTagsToString(throwsTag, null, - throwsTag.inlineTags(), false)); - if (text != null && text.toString().length() > 0) { - result += " - " + text; - } - result += "
"; + ContentBuilder result = new ContentBuilder(); + result.addContent(HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, new RawHtml(header)))); + Content body = new RawHtml(htmlWriter.commentTagsToString( + simpleTag, null, simpleTag.inlineTags(), false)); + result.addContent(HtmlTree.DD(body)); return new TagletOutputImpl(result); } + /** + * {@inheritDoc} + */ + public TagletOutput getThrowsHeader() { + HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.strong, + new StringContent(configuration.getText("doclet.Throws")))); + return new TagletOutputImpl(result); + } + + /** + * {@inheritDoc} + */ + public TagletOutput 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)); + String desc = htmlWriter.commentTagsToString(throwsTag, null, + throwsTag.inlineTags(), false); + if (desc != null && !desc.isEmpty()) { + body.addContent(" - "); + body.addContent(new RawHtml(desc)); + } + HtmlTree res2 = HtmlTree.DD(body); + return new TagletOutputImpl(res2); + } + /** * {@inheritDoc} */ public TagletOutput throwsTagOutput(Type throwsType) { - return new TagletOutputImpl(DocletConstants.NL + "
" + - htmlWriter.codeText(htmlWriter.getLink( - new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, throwsType)).toString()) + "
"); + HtmlTree result = HtmlTree.DD(HtmlTree.CODE(htmlWriter.getLink( + new LinkInfoImpl(configuration, LinkInfoImpl.Kind.MEMBER, throwsType)))); + return new TagletOutputImpl(result); } /** @@ -303,7 +315,7 @@ public class TagletWriterImpl extends TagletWriter { boolean includeLink) { return new TagletOutputImpl(includeLink ? htmlWriter.getDocLink(LinkInfoImpl.Kind.VALUE_TAG, field, - constantVal, false).toString() : constantVal); + constantVal, false) : new RawHtml(constantVal)); } /** @@ -325,8 +337,8 @@ public class TagletWriterImpl extends TagletWriter { */ public TagletOutput commentTagsToOutput(Tag holderTag, Doc holderDoc, Tag[] tags, boolean isFirstSentence) { - return new TagletOutputImpl(htmlWriter.commentTagsToString( - holderTag, holderDoc, tags, isFirstSentence)); + return new TagletOutputImpl(new RawHtml(htmlWriter.commentTagsToString( + holderTag, holderDoc, tags, isFirstSentence))); } /** @@ -335,13 +347,4 @@ public class TagletWriterImpl extends TagletWriter { public Configuration configuration() { return configuration; } - - /** - * Return an instance of a TagletWriter that knows how to write HTML. - * - * @return an instance of a TagletWriter that knows how to write HTML. - */ - public TagletOutput getTagletOutputInstance() { - return new TagletOutputImpl(""); - } } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java index 4360cff64db..7d6ec7dc8eb 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java @@ -53,12 +53,12 @@ public class CodeTaglet extends BaseInlineTaglet { private static final String NAME = "code"; public static void register(Map map) { - map.remove(NAME); - map.put(NAME, new CodeTaglet()); + map.remove(NAME); + map.put(NAME, new CodeTaglet()); } public String getName() { - return NAME; + return NAME; } /** diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/InheritDocTaglet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/InheritDocTaglet.java index 01fb04a61b0..924a7f72677 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/InheritDocTaglet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/InheritDocTaglet.java @@ -116,7 +116,7 @@ public class InheritDocTaglet extends BaseInlineTaglet { */ private TagletOutput retrieveInheritedDocumentation(TagletWriter writer, ProgramElementDoc ped, Tag holderTag, boolean isFirstSentence) { - TagletOutput replacement = writer.getTagletOutputInstance(); + TagletOutput replacement = writer.getOutputInstance(); Configuration configuration = writer.configuration(); Taglet inheritableTaglet = holderTag == null ? diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java index 0797a78c43f..6576b66012a 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java @@ -26,7 +26,6 @@ package com.sun.tools.doclets.internal.toolkit.taglets; import java.util.Map; -import com.sun.javadoc.Doc; import com.sun.javadoc.Tag; diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/Taglet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/Taglet.java index 1e2664ae4ca..d327cd5b901 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/Taglet.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/Taglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -152,4 +152,6 @@ public interface Taglet { */ public abstract TagletOutput getTagletOutput(Doc holder, TagletWriter writer) throws IllegalArgumentException; + @Override + public abstract String toString(); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletOutput.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletOutput.java index c7bbef457c1..25249aa68ac 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletOutput.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletOutput.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -52,9 +52,6 @@ public interface TagletOutput { */ public abstract void appendOutput(TagletOutput o); - /** - * Return true if this output has any occurances of @inheritDoc. - * @return true if inheritDoc tag is found. - */ - public abstract boolean hasInheritDocTag(); + @Override + public String toString(); } diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java index 684d97f92c1..1d3f96f6370 100644 --- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java @@ -307,9 +307,4 @@ public abstract class TagletWriter { * @return an instance of the configuration used for this doclet. */ public abstract Configuration configuration(); - - /** - * @return an instance of the taglet output object. - */ - public abstract TagletOutput getTagletOutputInstance(); } diff --git a/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java index c238abfe68d..e65f81aaa88 100644 --- a/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java +++ b/langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -86,12 +86,12 @@ public class AuthorDD // Test single @since tag: - { "
Since:
"+NL+"
JDK 1.0
", + { "
Since:
"+NL+"
JDK 1.0
", BUGID + FS + "p1" + FS + "C1.html" }, // Test multiple @author tags: - { "
Author:
"+NL+"
Doug Kramer, Jamie, Neal
", + { "
Author:
"+NL+"
Doug Kramer, Jamie, Neal
", BUGID + FS + "p1" + FS + "C1.html" }, }; diff --git a/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java index 17b3462a2f7..04b7db27cc9 100644 --- a/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java +++ b/langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -47,8 +47,8 @@ public class TestConstructorIndent extends JavadocTester { private static final String[][] TEST = { {BUG_ID + FS + "C.html", "
" + "This is just a simple constructor.
" + NL + - "
Parameters:
" + - "i - a param.
" + "
Parameters:
" + NL + + "
i - a param.
" } }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testHref/TestHref.java b/langtools/test/com/sun/javadoc/testHref/TestHref.java index d7952f63c14..297ddc69164 100644 --- a/langtools/test/com/sun/javadoc/testHref/TestHref.java +++ b/langtools/test/com/sun/javadoc/testHref/TestHref.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -70,7 +70,7 @@ public class TestHref extends JavadocTester { }, //@see test. {BUG_ID + FS + "pkg" + FS + "C2.html", - "See Also:
" + "See Also:" + NL + "
" }, //Header does not link to the page itself. diff --git a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java index 7c403e5b5b0..75d15227778 100644 --- a/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java +++ b/langtools/test/com/sun/javadoc/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java @@ -55,43 +55,43 @@ public class TestHtmlDefinitionListTag extends JavadocTester { private static final String[][] TEST_CMNT_DEPR = { {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
" + "
Since:
" + NL + - "
JDK1.0
"}, + "
JDK1.0
"}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Since:
" + NL + - "
JDK1.0
" + NL + "
See Also:
" + + "
JDK1.0
" + NL + "
See Also:
" + NL + "
" + "C2, " + NL + "" + "Serialized Form
"}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Since:
" + NL + - "
1.4
" + NL + - "
See Also:
" + + "
1.4
" + NL + + "
See Also:
" + NL + "
" + "" + "setUndecorated(boolean)
"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Parameters:
title" + - " - the title
test - boolean value" + + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Parameters:
" + NL + "
title" + + " - the title
" + NL + "
test - boolean value" + "
" + NL + "
Throws:
" + NL + "
java.lang.IllegalArgumentException - if the " + "owner's" + NL + " GraphicsConfiguration is not from a screen " + "device
" + NL + "
HeadlessException
"}, - {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Parameters:
undecorated" + + {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Parameters:
" + NL + "
undecorated" + " - true if no decorations are" + NL + " to be enabled;" + NL + " false " + - "if decorations are to be enabled.
Since:" + - "
" + NL + "
1.4
" + NL + - "
See Also:
" + + "if decorations are to be enabled.
" + NL + "
Since:" + + "
" + NL + "
1.4
" + NL + + "
See Also:
" + NL + "
" + "readObject()" + "
"}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Throws:
" + NL + - "
java.io.IOException
See Also:" + - "
" + + "
java.io.IOException
" + NL + "
See Also:" + + "
" + NL + "
" + "setUndecorated(boolean)
"}, {BUG_ID + FS + "pkg1" + FS + "C2.html", "
Parameters:" + - "
set - boolean
" + - "Since:
" + NL + "
1.4
"}, + "" + NL + "
set - boolean
" + NL + "
" + + "Since:
" + NL + "
1.4
"}, {BUG_ID + FS + "serialized-form.html", "
Throws:" + "
" + NL + "
" + - "java.io.IOException
See Also:" + - "
" + + "java.io.IOException
" + NL + "
See Also:" + + "
" + NL + "
" + "C1.setUndecorated(boolean)
"}, {BUG_ID + FS + "serialized-form.html", "Deprecated." + " As of JDK version 1.5, replaced by" + NL + @@ -99,8 +99,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester { "setUndecorated(boolean)." + NL + "
This field indicates whether the C1 is " + "undecorated.
" + NL + " " + NL + "
Since:
" + NL + - "
1.4
" + NL + "
See Also:" + - "
" + + "
1.4
" + NL + "
See Also:" + + "
" + NL + "
" + "C1.setUndecorated(boolean)
"}, {BUG_ID + FS + "serialized-form.html", "Deprecated." + " As of JDK version 1.5, replaced by" + NL + @@ -123,34 +123,34 @@ public class TestHtmlDefinitionListTag extends JavadocTester { private static final String[][] TEST_NODEPR = { {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "
" + "
Since:
" + NL + - "
JDK1.0
"}, + "
JDK1.0
"}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Since:" + - "
" + NL + "
JDK1.0
" + NL + "
See Also:" + - "
" + + "" + NL + "
JDK1.0
" + NL + "
See Also:" + + "
" + NL + "
" + "C2, " + NL + "" + "Serialized Form
"}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Parameters:" + - "
title - the title
" + + "" + NL + "
title - the title
" + NL + "
" + "test - boolean value
" + NL + "
Throws:" + "
" + NL + "
java.lang.IllegalArgumentException" + " - if the owner's" + NL + " GraphicsConfiguration" + " is not from a screen device
" + NL + "
" + "HeadlessException
"}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Parameters:" + - "
undecorated - true" + + "" + NL + "
undecorated - true" + " if no decorations are" + NL + " to be enabled;" + NL + " false if decorations are to be enabled." + - "
Since:
" + NL + "
1.4
" + NL + - "
See Also:
" + + "
" + NL + "
Since:
" + NL + "
1.4
" + NL + + "
See Also:
" + NL + "
" + "readObject()
"}, {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Throws:" + - "
" + NL + "
java.io.IOException
" + - "See Also:
" + + "" + NL + "
java.io.IOException
" + NL + "
" + + "See Also:
" + NL + "
" + "setUndecorated(boolean)
"}, {BUG_ID + FS + "serialized-form.html", "
Throws:" + "
" + NL + "
" + - "java.io.IOException
See Also:" + - "
" + + "java.io.IOException
" + NL + "
See Also:" + + "
" + NL + "
" + "C1.setUndecorated(boolean)
"}, {BUG_ID + FS + "serialized-form.html", "Deprecated." + " As of JDK version 1.5, replaced by" + NL + @@ -158,8 +158,8 @@ public class TestHtmlDefinitionListTag extends JavadocTester { "setUndecorated(boolean)." + NL + "
This field indicates whether the C1 is " + "undecorated.
" + NL + " " + NL + "
Since:
" + NL + - "
1.4
" + NL + "
See Also:" + - "
" + + "
1.4
" + NL + "
See Also:" + + "
" + NL + "
" + "C1.setUndecorated(boolean)
"}, {BUG_ID + FS + "serialized-form.html", "Deprecated." + " As of JDK version 1.5, replaced by" + NL + diff --git a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java index 266abfdaa89..20cb68b97d1 100644 --- a/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java +++ b/langtools/test/com/sun/javadoc/testJavaFX/TestJavaFX.java @@ -38,7 +38,7 @@ public class TestJavaFX extends JavadocTester { private static final String[][] TEST = new String[][] { {"./" + BUG_ID + "/C.html", - "
See Also:
getRate(), " + NL + + "
See Also:
" + NL + "
getRate(), " + NL + "setRate(double)
"}, {"./" + BUG_ID + "/C.html", "
public final void setRate(double value)
" + NL + diff --git a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java index a370c8563a2..7feeb28662f 100644 --- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java +++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java @@ -80,11 +80,11 @@ public class TestNewLanguageFeatures extends JavadocTester { "Class TypeParameters<E>"}, //Check class type parameters section. {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "
Type Parameters:
E - " + + "
Type Parameters:
" + NL + "
E - " + "the type parameter for this class."}, //Type parameters in @see/@link {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "
See Also:
" + + "
See Also:
" + NL + "
" + "" + "TypeParameters
"}, //Method that uses class type parameter. @@ -93,8 +93,8 @@ public class TestNewLanguageFeatures extends JavadocTester { "parameter in TypeParameters\">E param)"}, //Method type parameter section. {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", - "Type Parameters:
T - This is the first " + - "type parameter.
V - This is the second type " + + "Type Parameters:" + NL + "
T - This is the first " + + "type parameter.
" + NL + "
V - This is the second type " + "parameter."}, //Signature of method with type parameters {BUG_ID + FS + "pkg" + FS + "TypeParameters.html", diff --git a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java index 3def6b87882..22715395250 100644 --- a/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java +++ b/langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -48,13 +48,13 @@ public class TestParamTaglet extends JavadocTester { private static final String[][] TEST = { //Regular param tags. {BUG_ID + FS + "pkg" + FS + "C.html", - "Parameters:
param1 - testing 1 2 3.
" + - "
param2 - testing 1 2 3." + "Parameters:" + NL + "
param1 - testing 1 2 3.
" + + NL + "
param2 - testing 1 2 3." }, //Param tags that don't match with any real parameters. {BUG_ID + FS + "pkg" + FS + "C.html", - "Parameters:
p1 - testing 1 2 3.
" + - "
p2 - testing 1 2 3." + "Parameters:" + NL + "
p1 - testing 1 2 3.
" + + NL + "
p2 - testing 1 2 3." }, //{@inherit} doc misuse does not cause doclet to throw exception. // Param is printed with nothing inherited. diff --git a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java index 4a2a1ccb8cc..594769cafc8 100644 --- a/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java +++ b/langtools/test/com/sun/javadoc/testSerializedFormDeprecationInfo/TestSerializedFormDeprecationInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -43,8 +43,8 @@ public class TestSerializedFormDeprecationInfo extends JavadocTester { private static final String[][] TEST_CMNT_DEPR = { {BUG_ID + FS + "serialized-form.html", "
" + "
Throws:
" + NL + "
" + - "java.io.IOException
See Also:" + - "
" + + "java.io.IOException
"+ NL + "
See Also:" + + "
" + NL + "
" + "C1.setUndecorated(boolean)
"}, {BUG_ID + FS + "serialized-form.html", "Deprecated." + " As of JDK version 1.5, replaced by" + NL + @@ -53,8 +53,8 @@ public class TestSerializedFormDeprecationInfo extends JavadocTester { "
This field indicates whether the C1 " + "is undecorated.
" + NL + " " + NL + "
Since:
" + NL + - "
1.4
" + NL + "
See Also:" + - "
" + + "
1.4
" + NL + "
See Also:" + + "
" + NL + "
" + "C1.setUndecorated(boolean)
"}, {BUG_ID + FS + "serialized-form.html", "Deprecated." + " As of JDK version 1.5, replaced by" + NL + diff --git a/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java b/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java index 0b2ac660510..4b5ac2310b9 100644 --- a/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java +++ b/langtools/test/com/sun/javadoc/testSimpleTagInherit/TestSimpleTagInherit.java @@ -47,10 +47,10 @@ public class TestSimpleTagInherit extends JavadocTester { private static final String[][] TEST = { { BUG_ID + FS + "p" + FS + "TestClass.html", "
Custom:
" + NL + - "
doc for BaseClass class
" }, + "
doc for BaseClass class
" }, { BUG_ID + FS + "p" + FS + "TestClass.html", "
Custom:
" + NL + - "
doc for BaseClass method
" } + "
doc for BaseClass method
" } }; private static final String[][] NEGATED_TEST = NO_TEST; diff --git a/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java b/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java index c340431dbf8..cd11bf2f422 100644 --- a/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java +++ b/langtools/test/com/sun/javadoc/testSinceTag/TestSinceTag.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -49,11 +49,11 @@ public class TestSinceTag extends JavadocTester { private static final String[][] TEST = { {BUG_ID + FS + "pkg1" + FS + "C1.html", "
Since:
" + NL + - "
JDK1.0
" + "
JDK1.0
" }, {BUG_ID + FS + "serialized-form.html", "
Since:
" + NL + - "
1.4
" + "
1.4
" } }; diff --git a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java index f53e6f4f1a5..ba0f291dc81 100644 --- a/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java +++ b/langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java @@ -90,7 +90,7 @@ public class TestValueTag extends JavadocTester { //Test @value tag used with custom tag. {BUG_ID + FS + "pkg1" + FS + "CustomTagUsage.html", "
Todo:
" + NL + - "
the value of this constant is 55.
"}, + "
the value of this constant is 55.
"}, //Test @value warning printed when used with non-constant. {WARNING_OUTPUT,"warning - @value tag (which references nonConstant) " + "can only be used in constants."