private static Tag[] getTagsOrNull(Doc taggedDoc, String tagName) { final Tag[] tags = taggedDoc.tags(tagName); if (tags != null && tags.length > 0) { return tags; } return null; } }
private static Tag getSingleTagOrNull(Doc taggedDoc, String tagName) { final Tag[] tags = taggedDoc.tags(tagName); if (tags != null && tags.length > 0) { return tags[0]; } return null; }
/** * Return true if the doc element is getting documented, depending upon * -nodeprecated option and @deprecated tag used. Return true if * -nodeprecated is not used or @deprecated tag is not used. */ public boolean isGeneratedDoc(Doc doc) { if (!nodeprecated) { return true; } return (doc.tags("deprecated")).length == 0; }
/** * Should this doc element be added to the index map? */ protected boolean shouldAddToIndexMap(Doc element) { return !(noDeprecated && element.tags("deprecated").length > 0); }
private static String getTagValue(Doc doc, String tagName) { Tag[] tags = doc.tags(tagName); return 0 < tags.length ? tags[0].text() : ""; }
private static Tag[] getTag(Doc doc, String name, boolean check) { Tag[] tags = doc.tags(name); if (check && tags.length <= 0) { throw new IllegalStateException("api doc:Tag[@"+name+"] must requied in position: " + doc.position()); } if (tags.length <= 0) { return null; } else { return tags; } }
private static String getTagValue(Doc doc, String tagName) { Tag[] tags = doc.tags(tagName); return 0 < tags.length ? tags[0].text() : ""; }
private void checkCategoryExistance(Doc node) { //check the if the category for this class exists if (node.tags(TAG_CATEGORY).length > 0 && !categories.containsKey(node.tags(TAG_CATEGORY)[0].text())) { final String categoryName = node.tags(TAG_CATEGORY)[0].text(); if (ColorCombination.values().length > nonconfiguredCategoryCount) { categories.put(categoryName, new CategoryOptions(categoryName, ColorCombination.values()[nonconfiguredCategoryCount])); nonconfiguredCategoryCount++; } else { categories.put(categoryName, new CategoryOptions(categoryName, "#FFFFFF", null)); } } }
/** Set the options based on the tag elements of the ClassDoc parameter */ public void setOptions(Doc p) { if (p == null) return; for (Tag tag : p.tags("opt")) setOption(StringUtil.tokenize(tag.text())); }
/** * Verifies that the named block tag exists at most <b>once</b>, and returns it. * * @return {@code null} iff the tag does not exist */ @Nullable public static Tag optionalTag(Doc doc, String tagName, DocErrorReporter docErrorReporter) { Tag[] tags = doc.tags(tagName); if (tags.length == 0) return null; if (tags.length > 1) { docErrorReporter.printError(doc.position(), "'" + tagName + "' must appear at most once"); } return tags[0]; }
/** * Verifies that the named block tag exists at most <b>once</b>, and returns it. * * @return {@code null} iff the tag does not exist */ @Nullable public static Tag optionalTag(Doc doc, String tagName, DocErrorReporter docErrorReporter) { Tag[] tags = doc.tags(tagName); if (tags.length == 0) return null; if (tags.length > 1) { docErrorReporter.printError(doc.position(), "'" + tagName + "' must appear at most once"); } return tags[0]; }
/** * Return as a string the stereotypes associated with c * terminated by the escape character term */ private void stereotype(Options opt, Doc c, Align align) { for (Tag tag : c.tags("stereotype")) { String t[] = tokenize(tag.text()); if (t.length != 1) { System.err.println("@stereotype expects one field: " + tag.text()); continue; } tableLine(align, guilWrap(opt, t[0])); } }
/** * {@inheritDoc} */ public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) throws IllegalArgumentException { TagletOutput output = writer.getOutputInstance(); output.setOutput(legacyTaglet.toString(holder.tags(getName()))); return output; } }
/** * Return as a string the stereotypes associated with c * terminated by the escape character term */ private void stereotype(Options opt, Doc c, Align align) { for (Tag tag : c.tags("stereotype")) { String t[] = StringUtil.tokenize(tag.text()); if (t.length != 1) { System.err.println("@stereotype expects one field: " + tag.text()); continue; } tableLine(align, guilWrap(opt, t[0])); } }
/** * Verifies that the named block tag exists exactly <b>once</b>, and returns it. */ public static Tag requiredTag(Doc doc, String tagName, DocErrorReporter docErrorReporter) { Tag[] tags = doc.tags(tagName); if (tags.length == 0) { docErrorReporter.printError(doc.position(), "'" + tagName + "' is missing"); } if (tags.length > 1) { docErrorReporter.printError(doc.position(), "'" + tagName + "' must appear only once"); } return tags[0]; } }
/** * Verifies that the named block tag exists exactly <b>once</b>, and returns it. */ public static Tag requiredTag(Doc doc, String tagName, DocErrorReporter docErrorReporter) { Tag[] tags = doc.tags(tagName); if (tags.length == 0) { docErrorReporter.printError(doc.position(), "'" + tagName + "' is missing"); } if (tags.length > 1) { docErrorReporter.printError(doc.position(), "'" + tagName + "' must appear only once"); } return tags[0]; } }
protected void printIndexComment(Doc member, Tag[] firstSentenceTags) { Tag[] deprs = member.tags("deprecated"); if (Util.isDeprecated((ProgramElementDoc) member)) { strongText("doclet.Deprecated"); space(); if (deprs.length > 0) { printInlineDeprecatedComment(member, deprs[0]); } return; } else { ClassDoc cd = ((ProgramElementDoc)member).containingClass(); if (cd != null && Util.isDeprecated(cd)) { strongText("doclet.Deprecated"); space(); } } printSummaryComment(member, firstSentenceTags); }