< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java

Print this page




 180      * {@inheritDoc}
 181      */
 182     protected Content literalTagOutput(Element element, DocTree tag) {
 183         CommentHelper ch = utils.getCommentHelper(element);
 184         Content result = new StringContent(utils.normalizeNewlines(ch.getText(tag)));
 185         return result;
 186     }
 187 
 188     /**
 189      * {@inheritDoc}
 190      */
 191     public Content getParamHeader(String header) {
 192         HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.paramLabel,
 193                 new StringContent(header)));
 194         return result;
 195     }
 196 
 197     /**
 198      * {@inheritDoc}
 199      */
 200     @SuppressWarnings("removal")
 201     public Content paramTagOutput(Element element, DocTree paramTag, String paramName) {
 202         ContentBuilder body = new ContentBuilder();
 203         CommentHelper ch = utils.getCommentHelper(element);
 204         // define id attributes for state components so that generated descriptions may refer to them
 205         boolean defineID = (element.getKind() == ElementKind.RECORD)
 206                 && (paramTag instanceof ParamTree) && !((ParamTree) paramTag).isTypeParameter();
 207         Content nameTree = new StringContent(paramName);
 208         body.add(HtmlTree.CODE(defineID ? HtmlTree.A_ID("param-" + paramName, nameTree) : nameTree));
 209         body.add(" - ");
 210         List<? extends DocTree> description = ch.getDescription(configuration, paramTag);
 211         body.add(htmlWriter.commentTagsToContent(paramTag, element, description, false, inSummary));
 212         return HtmlTree.DD(body);
 213     }
 214 
 215     /**
 216      * {@inheritDoc}
 217      */
 218     public Content propertyTagOutput(Element element, DocTree tag, String prefix) {
 219         Content body = new ContentBuilder();
 220         CommentHelper ch = utils.getCommentHelper(element);


 403     public Content commentTagsToOutput(Element holder, List<? extends DocTree> tags) {
 404         return commentTagsToOutput(null, holder, tags, false);
 405     }
 406 
 407     /**
 408      * {@inheritDoc}
 409      */
 410     public Content commentTagsToOutput(DocTree holderTag,
 411         Element holder, List<? extends DocTree> tags, boolean isFirstSentence) {
 412         return htmlWriter.commentTagsToContent(holderTag, holder,
 413                 tags, isFirstSentence, inSummary);
 414     }
 415 
 416     /**
 417      * {@inheritDoc}
 418      */
 419     public BaseConfiguration configuration() {
 420         return configuration;
 421     }
 422 
 423     @SuppressWarnings("removal")
 424     private Content createAnchorAndSearchIndex(Element element, String tagText, String desc){
 425         Content result = null;
 426         if (isFirstSentence && inSummary) {
 427             result = new StringContent(tagText);
 428         } else {
 429             String anchorName = htmlWriter.links.getName(tagText);
 430             int count = htmlWriter.indexAnchorTable.computeIfAbsent(anchorName, s -> 0);
 431             htmlWriter.indexAnchorTable.put(anchorName, count + 1);
 432             if (count > 0) {
 433                 anchorName += "-" + count;
 434             }
 435             result = HtmlTree.A_ID(HtmlStyle.searchTagResult, anchorName, new StringContent(tagText));
 436             if (configuration.createindex && !tagText.isEmpty()) {
 437                 SearchIndexItem si = new SearchIndexItem();
 438                 si.setLabel(tagText);
 439                 si.setDescription(desc);
 440                 si.setUrl(htmlWriter.path.getPath() + "#" + anchorName);
 441                 DocPaths docPaths = configuration.docPaths;
 442                 new SimpleElementVisitor14<Void, Void>() {
 443                     @Override




 180      * {@inheritDoc}
 181      */
 182     protected Content literalTagOutput(Element element, DocTree tag) {
 183         CommentHelper ch = utils.getCommentHelper(element);
 184         Content result = new StringContent(utils.normalizeNewlines(ch.getText(tag)));
 185         return result;
 186     }
 187 
 188     /**
 189      * {@inheritDoc}
 190      */
 191     public Content getParamHeader(String header) {
 192         HtmlTree result = HtmlTree.DT(HtmlTree.SPAN(HtmlStyle.paramLabel,
 193                 new StringContent(header)));
 194         return result;
 195     }
 196 
 197     /**
 198      * {@inheritDoc}
 199      */
 200     @SuppressWarnings("preview")
 201     public Content paramTagOutput(Element element, DocTree paramTag, String paramName) {
 202         ContentBuilder body = new ContentBuilder();
 203         CommentHelper ch = utils.getCommentHelper(element);
 204         // define id attributes for state components so that generated descriptions may refer to them
 205         boolean defineID = (element.getKind() == ElementKind.RECORD)
 206                 && (paramTag instanceof ParamTree) && !((ParamTree) paramTag).isTypeParameter();
 207         Content nameTree = new StringContent(paramName);
 208         body.add(HtmlTree.CODE(defineID ? HtmlTree.A_ID("param-" + paramName, nameTree) : nameTree));
 209         body.add(" - ");
 210         List<? extends DocTree> description = ch.getDescription(configuration, paramTag);
 211         body.add(htmlWriter.commentTagsToContent(paramTag, element, description, false, inSummary));
 212         return HtmlTree.DD(body);
 213     }
 214 
 215     /**
 216      * {@inheritDoc}
 217      */
 218     public Content propertyTagOutput(Element element, DocTree tag, String prefix) {
 219         Content body = new ContentBuilder();
 220         CommentHelper ch = utils.getCommentHelper(element);


 403     public Content commentTagsToOutput(Element holder, List<? extends DocTree> tags) {
 404         return commentTagsToOutput(null, holder, tags, false);
 405     }
 406 
 407     /**
 408      * {@inheritDoc}
 409      */
 410     public Content commentTagsToOutput(DocTree holderTag,
 411         Element holder, List<? extends DocTree> tags, boolean isFirstSentence) {
 412         return htmlWriter.commentTagsToContent(holderTag, holder,
 413                 tags, isFirstSentence, inSummary);
 414     }
 415 
 416     /**
 417      * {@inheritDoc}
 418      */
 419     public BaseConfiguration configuration() {
 420         return configuration;
 421     }
 422 
 423     @SuppressWarnings("preview")
 424     private Content createAnchorAndSearchIndex(Element element, String tagText, String desc){
 425         Content result = null;
 426         if (isFirstSentence && inSummary) {
 427             result = new StringContent(tagText);
 428         } else {
 429             String anchorName = htmlWriter.links.getName(tagText);
 430             int count = htmlWriter.indexAnchorTable.computeIfAbsent(anchorName, s -> 0);
 431             htmlWriter.indexAnchorTable.put(anchorName, count + 1);
 432             if (count > 0) {
 433                 anchorName += "-" + count;
 434             }
 435             result = HtmlTree.A_ID(HtmlStyle.searchTagResult, anchorName, new StringContent(tagText));
 436             if (configuration.createindex && !tagText.isEmpty()) {
 437                 SearchIndexItem si = new SearchIndexItem();
 438                 si.setLabel(tagText);
 439                 si.setDescription(desc);
 440                 si.setUrl(htmlWriter.path.getPath() + "#" + anchorName);
 441                 DocPaths docPaths = configuration.docPaths;
 442                 new SimpleElementVisitor14<Void, Void>() {
 443                     @Override


< prev index next >