private boolean isTreatedAsPrivate(ProgramElementDoc pgmelem) { if (!configuration.javafx) { return false; } Tag[] aspTags = pgmelem.tags("@treatAsPrivate"); boolean result = (aspTags != null) && (aspTags.length > 0); return result; }
/** * This gets whether the given item has any of the given tags * * @param item The javadoc item * @param matchTags The names of the tags to look for * @return True if the item has any of the given tags */ private static boolean hasTag(ProgramElementDoc item, Collection<String> matchTags) { if (matchTags != null) { for (String matchTag : matchTags) { Tag[] tags = item.tags(matchTag); if (tags != null && tags.length > 0) { return true; } } } return false; }
/** * Return array of class members whose documentation is to be generated. * If the member is deprecated do not include such a member in the * returned array. * * @param members Array of members to choose from. * @return List List of eligible members for whom * documentation is getting generated. */ public static List<ProgramElementDoc> excludeDeprecatedMembersAsList( ProgramElementDoc[] members) { List<ProgramElementDoc> list = new ArrayList<ProgramElementDoc>(); for (int i = 0; i < members.length; i++) { if (members[i].tags("deprecated").length == 0) { list.add(members[i]); } } Collections.sort(list); return list; }
private static boolean isDeprecated(ProgramElementDoc doc) { return (getAnnotation(doc, Deprecated.class) != null) || (doc.tags("deprecated").length != 0); }
/** * Return array of class members whose documentation is to be generated. * If the member is deprecated do not include such a member in the * returned array. * * @param members Array of members to choose from. * @return List List of eligible members for whom * documentation is getting generated. */ public static List<ProgramElementDoc> excludeDeprecatedMembersAsList( ProgramElementDoc[] members) { List<ProgramElementDoc> list = new ArrayList<ProgramElementDoc>(); for (int i = 0; i < members.length; i++) { if (members[i].tags("deprecated").length == 0) { list.add(members[i]); } } Collections.sort(list); return list; }
private static boolean isDeprecated(ProgramElementDoc doc) { return (getAnnotation(doc, Deprecated.class) != null) || (doc.tags("deprecated").length != 0); }
/** * Returns all the tags of a method including its overridden methods. * * @param methodDoc the method to check * @return a list of tags */ private static List<Tag> getInheritableTags(ProgramElementDoc methodDoc) { List<Tag> tags = new ArrayList<>(); while (methodDoc != null) { tags.addAll(asList(methodDoc.tags())); methodDoc = getAncestor(methodDoc); } Collections.reverse(tags); return tags; }
/** * Prints the documentation for the specified tag. * * @param pw the writer to print the tag documentation to * @param referenceDoc the member to document the tags for * @param label the label to print for the tag documentation * @param tagName the name of the tags to print the documentation for */ private static void printTags(PrintWriter pw, ProgramElementDoc referenceDoc, String label, String tagName) { Tag[] tags = referenceDoc.tags(tagName); for (Tag tag : tags) { pw.print("<para><c>"); pw.print(label); pw.print("</c> "); printComment(pw, referenceDoc, tag.inlineTags()); pw.println("</para>"); } }
@Override public void inherit(DocFinder.Input input, DocFinder.Output output) { Tag[] tags = input.element.tags(tagName); if (tags.length > 0) { output.holder = input.element; output.holderTag = tags[0]; output.inlineTags = input.isFirstSentence ? tags[0].firstSentenceTags() : tags[0].inlineTags(); } }
/** * {@inheritDoc} */ public void inherit(DocFinder.Input input, DocFinder.Output output) { Tag[] tags = input.element.tags("return"); if (tags.length > 0) { output.holder = input.element; output.holderTag = tags[0]; output.inlineTags = input.isFirstSentence ? tags[0].firstSentenceTags() : tags[0].inlineTags(); } }
/** Return true if c has a @hidden tag associated with it */ private boolean hidden(ProgramElementDoc c) { Tag tags[] = c.tags("hidden"); if (tags.length > 0) return true; tags = c.tags("view"); if (tags.length > 0) return true; Options opt; if(c instanceof ClassDoc) opt = optionProvider.getOptionsFor((ClassDoc) c); else opt = optionProvider.getOptionsFor(c.containingClass()); return opt.matchesHideExpression(c.toString()); }
/** Return true if c has a @hidden tag associated with it */ private boolean hidden(ProgramElementDoc c) { if (c.tags("hidden").length > 0 || c.tags("view").length > 0) return true; Options opt = optionProvider.getOptionsFor(c instanceof ClassDoc ? (ClassDoc) c : c.containingClass()); return opt.matchesHideExpression(c.toString()) // || (opt.hidePrivateInner && c instanceof ClassDoc && c.isPrivate() && ((ClassDoc) c).containingClass() != null); }
/** * This gets the value of the first tag found from the given collection of tag names * * @param item The item to get the tag value of * @param matchTags The collection of tag names of the tag to get a value of * @param options The doclet options * @return The value of the first tag found with the name in the given collection or null if either the tag * was not present or had no value */ private static String getTagValue(ProgramElementDoc item, Collection<String> matchTags, DocletOptions options) { String customValue = null; if (matchTags != null) { for (String matchTag : matchTags) { Tag[] tags = item.tags(matchTag); if (tags != null && tags.length > 0) { customValue = tags[0].text().trim(); if (customValue.length() == 0) { customValue = null; } break; } } } return options.replaceVars(customValue); }
/** * Return true if the given Doc is deprecated. * * @param doc the Doc to check. * @return true if the given Doc is deprecated. */ public static boolean isDeprecated(ProgramElementDoc doc) { if (doc.tags("deprecated").length > 0) { return true; } AnnotationDesc[] annotationDescList = doc.annotations(); for (int i = 0; i < annotationDescList.length; i++) { if (annotationDescList[i].annotationType().qualifiedName().equals( java.lang.Deprecated.class.getName())){ return true; } } return false; } }
/** * This gets the first sentence tags of a method or its overridden ancestor method * * @param methodDoc The method * @return The first sentence tag or null if there is none */ static String getInheritableCommentText(ProgramElementDoc methodDoc, DocletOptions options) { String result = null; while (result == null && methodDoc != null) { final Tag[] tags = methodDoc.tags(); String versionedCommentText = options.getDialect() .flatMap(dialect -> getVersionedOperationCommentText(tags, dialect)) .orElse(""); String commentText = methodDoc.commentText() + " " + versionedCommentText; if (!commentText.isEmpty()) { result = commentText; } methodDoc = getAncestor(methodDoc); } return result; }
/** * Generate the code for listing the deprecated APIs. Create the table * format for listing the API. Call methods from the sub-class to complete * the generation. */ protected void printDeprecatedAPI(List<Doc> deprmembers, String headingKey, String tableSummary, String[] tableHeader) { if (deprmembers.size() > 0) { writer.tableIndexSummary(tableSummary); writer.tableCaptionStart(); writer.printText(headingKey); writer.tableCaptionEnd(); writer.summaryTableHeader(tableHeader, "col"); for (int i = 0; i < deprmembers.size(); i++) { ProgramElementDoc member =(ProgramElementDoc)deprmembers.get(i); writer.trBgcolorStyle("white", "TableRowColor"); writer.summaryRow(0); writeDeprecatedLink(member); writer.br(); writer.printNbsps(); if (member.tags("deprecated").length > 0) writer.printInlineDeprecatedComment(member, member.tags("deprecated")[0]); writer.space(); writer.summaryRowEnd(); writer.trEnd(); } writer.tableEnd(); writer.space(); writer.p(); } }
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)
if (programElementDoc.tags("@exclude").length > 0) { return;
/** * Print 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. */ protected void printComment(ProgramElementDoc element) { Tag[] tags; if (Util.isDeprecated(element)) { strongText("doclet.Deprecated"); space(); if ((tags = element.tags("deprecated")).length > 0) printInlineDeprecatedComment(element, tags[0]); } else { ClassDoc cont = element.containingClass(); while (cont != null) { if (Util.isDeprecated(cont)) { strongText("doclet.Deprecated"); space(); break; } cont = cont.containingClass(); } printSummaryComment(element); } }
if (Util.isDeprecated(element)) { div.addContent(span); if ((tags = element.tags("deprecated")).length > 0) addInlineDeprecatedComment(element, tags[0], div); contentTree.addContent(div);