com.sun.javadoc.Doc.tags()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中com.sun.javadoc.Doc.tags()方法的一些代码示例,展示了Doc.tags()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Doc.tags()方法的具体详情如下:
包路径:com.sun.javadoc.Doc
类名称:Doc
方法名:tags

Doc.tags介绍

[英]Return all tags in this Doc item.
[中]

代码示例

代码示例来源:origin: io.atlassian.json-schemagen/json-schemagen-scanner

  1. private static Tag[] getTagsOrNull(Doc taggedDoc, String tagName)
  2. {
  3. final Tag[] tags = taggedDoc.tags(tagName);
  4. if (tags != null && tags.length > 0)
  5. {
  6. return tags;
  7. }
  8. return null;
  9. }
  10. }

代码示例来源:origin: io.atlassian.json-schemagen/json-schemagen-scanner

  1. private static Tag getSingleTagOrNull(Doc taggedDoc, String tagName)
  2. {
  3. final Tag[] tags = taggedDoc.tags(tagName);
  4. if (tags != null && tags.length > 0)
  5. {
  6. return tags[0];
  7. }
  8. return null;
  9. }

代码示例来源:origin: uk.org.retep.doclet/core

  1. /**
  2. * Return true if the doc element is getting documented, depending upon
  3. * -nodeprecated option and @deprecated tag used. Return true if
  4. * -nodeprecated is not used or @deprecated tag is not used.
  5. */
  6. public boolean isGeneratedDoc(Doc doc) {
  7. if (!nodeprecated) {
  8. return true;
  9. }
  10. return (doc.tags("deprecated")).length == 0;
  11. }

代码示例来源:origin: uk.org.retep.doclet/core

  1. /**
  2. * Should this doc element be added to the index map?
  3. */
  4. protected boolean shouldAddToIndexMap(Doc element) {
  5. return !(noDeprecated && element.tags("deprecated").length > 0);
  6. }

代码示例来源:origin: org.apache.tapestry/tapestry-javadoc

  1. private static String getTagValue(Doc doc, String tagName)
  2. {
  3. Tag[] tags = doc.tags(tagName);
  4. return 0 < tags.length ? tags[0].text() : "";
  5. }

代码示例来源:origin: com.github.linkeer8802/api-resolver-core

  1. private static Tag[] getTag(Doc doc, String name, boolean check) {
  2. Tag[] tags = doc.tags(name);
  3. if (check && tags.length <= 0) {
  4. throw new IllegalStateException("api doc:Tag[@"+name+"] must requied in position: " + doc.position());
  5. }
  6. if (tags.length <= 0) {
  7. return null;
  8. } else {
  9. return tags;
  10. }
  11. }

代码示例来源:origin: apache/tapestry-5

  1. private static String getTagValue(Doc doc, String tagName)
  2. {
  3. Tag[] tags = doc.tags(tagName);
  4. return 0 < tags.length ? tags[0].text() : "";
  5. }

代码示例来源:origin: org.jboss.apiviz/apiviz

  1. static boolean isHidden(Doc node) {
  2. if (node.tags(TAG_HIDDEN).length > 0) {
  3. return true;
  4. }
  5. Tag[] tags = node.tags(TAG_EXCLUDE);
  6. if (tags == null) {
  7. return false;
  8. }
  9. for (Tag t: tags) {
  10. if (t.text() == null || t.text().trim().length() == 0) {
  11. return true;
  12. }
  13. }
  14. return false;
  15. }

代码示例来源:origin: konsoletyper/teavm-javac

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public Content getTagletOutput(Doc holder, TagletWriter writer) {
  5. if (header == null || holder.tags(getName()).length == 0) {
  6. return null;
  7. }
  8. return writer.simpleTagOutput(holder.tags(getName()), header);
  9. }
  10. }

代码示例来源:origin: uk.org.retep.doclet/core

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) {
  5. if (header == null || holder.tags(getName()).length == 0) {
  6. return null;
  7. }
  8. return writer.simpleTagOutput(holder.tags(getName()), header);
  9. }
  10. }

代码示例来源:origin: org.jboss.apiviz/apiviz

  1. private void checkCategoryExistance(Doc node) {
  2. //check the if the category for this class exists
  3. if (node.tags(TAG_CATEGORY).length > 0 && !categories.containsKey(node.tags(TAG_CATEGORY)[0].text())) {
  4. final String categoryName = node.tags(TAG_CATEGORY)[0].text();
  5. if (ColorCombination.values().length > nonconfiguredCategoryCount) {
  6. categories.put(categoryName, new CategoryOptions(categoryName, ColorCombination.values()[nonconfiguredCategoryCount]));
  7. nonconfiguredCategoryCount++;
  8. } else {
  9. categories.put(categoryName, new CategoryOptions(categoryName, "#FFFFFF", null));
  10. }
  11. }
  12. }

代码示例来源:origin: dspinellis/UMLGraph

  1. /** Set the options based on the tag elements of the ClassDoc parameter */
  2. public void setOptions(Doc p) {
  3. if (p == null)
  4. return;
  5. for (Tag tag : p.tags("opt"))
  6. setOption(StringUtil.tokenize(tag.text()));
  7. }

代码示例来源:origin: de.unkrig.commons/commons-doclet

  1. /**
  2. * Verifies that the named block tag exists at most <b>once</b>, and returns it.
  3. *
  4. * @return {@code null} iff the tag does not exist
  5. */
  6. @Nullable public static Tag
  7. optionalTag(Doc doc, String tagName, DocErrorReporter docErrorReporter) {
  8. Tag[] tags = doc.tags(tagName);
  9. if (tags.length == 0) return null;
  10. if (tags.length > 1) {
  11. docErrorReporter.printError(doc.position(), "'" + tagName + "' must appear at most once");
  12. }
  13. return tags[0];
  14. }

代码示例来源:origin: de.unkrig/de-unkrig-commons

  1. /**
  2. * Verifies that the named block tag exists at most <b>once</b>, and returns it.
  3. *
  4. * @return {@code null} iff the tag does not exist
  5. */
  6. @Nullable public static Tag
  7. optionalTag(Doc doc, String tagName, DocErrorReporter docErrorReporter) {
  8. Tag[] tags = doc.tags(tagName);
  9. if (tags.length == 0) return null;
  10. if (tags.length > 1) {
  11. docErrorReporter.printError(doc.position(), "'" + tagName + "' must appear at most once");
  12. }
  13. return tags[0];
  14. }

代码示例来源:origin: dspinellis/UMLGraph

  1. /**
  2. * Return as a string the stereotypes associated with c
  3. * terminated by the escape character term
  4. */
  5. private void stereotype(Options opt, Doc c, Align align) {
  6. for (Tag tag : c.tags("stereotype")) {
  7. String t[] = tokenize(tag.text());
  8. if (t.length != 1) {
  9. System.err.println("@stereotype expects one field: " + tag.text());
  10. continue;
  11. }
  12. tableLine(align, guilWrap(opt, t[0]));
  13. }
  14. }

代码示例来源:origin: uk.org.retep.doclet/core

  1. /**
  2. * {@inheritDoc}
  3. */
  4. public TagletOutput getTagletOutput(Doc holder, TagletWriter writer)
  5. throws IllegalArgumentException {
  6. TagletOutput output = writer.getOutputInstance();
  7. output.setOutput(legacyTaglet.toString(holder.tags(getName())));
  8. return output;
  9. }
  10. }

代码示例来源:origin: org.umlgraph/umlgraph

  1. /**
  2. * Return as a string the stereotypes associated with c
  3. * terminated by the escape character term
  4. */
  5. private void stereotype(Options opt, Doc c, Align align) {
  6. for (Tag tag : c.tags("stereotype")) {
  7. String t[] = StringUtil.tokenize(tag.text());
  8. if (t.length != 1) {
  9. System.err.println("@stereotype expects one field: " + tag.text());
  10. continue;
  11. }
  12. tableLine(align, guilWrap(opt, t[0]));
  13. }
  14. }

代码示例来源:origin: de.unkrig.commons/commons-doclet

  1. /**
  2. * Verifies that the named block tag exists exactly <b>once</b>, and returns it.
  3. */
  4. public static Tag
  5. requiredTag(Doc doc, String tagName, DocErrorReporter docErrorReporter) {
  6. Tag[] tags = doc.tags(tagName);
  7. if (tags.length == 0) {
  8. docErrorReporter.printError(doc.position(), "'" + tagName + "' is missing");
  9. }
  10. if (tags.length > 1) {
  11. docErrorReporter.printError(doc.position(), "'" + tagName + "' must appear only once");
  12. }
  13. return tags[0];
  14. }
  15. }

代码示例来源:origin: de.unkrig/de-unkrig-commons

  1. /**
  2. * Verifies that the named block tag exists exactly <b>once</b>, and returns it.
  3. */
  4. public static Tag
  5. requiredTag(Doc doc, String tagName, DocErrorReporter docErrorReporter) {
  6. Tag[] tags = doc.tags(tagName);
  7. if (tags.length == 0) {
  8. docErrorReporter.printError(doc.position(), "'" + tagName + "' is missing");
  9. }
  10. if (tags.length > 1) {
  11. docErrorReporter.printError(doc.position(), "'" + tagName + "' must appear only once");
  12. }
  13. return tags[0];
  14. }
  15. }

代码示例来源:origin: uk.org.retep.doclet/core

  1. protected void printIndexComment(Doc member, Tag[] firstSentenceTags) {
  2. Tag[] deprs = member.tags("deprecated");
  3. if (Util.isDeprecated((ProgramElementDoc) member)) {
  4. strongText("doclet.Deprecated");
  5. space();
  6. if (deprs.length > 0) {
  7. printInlineDeprecatedComment(member, deprs[0]);
  8. }
  9. return;
  10. } else {
  11. ClassDoc cd = ((ProgramElementDoc)member).containingClass();
  12. if (cd != null && Util.isDeprecated(cd)) {
  13. strongText("doclet.Deprecated"); space();
  14. }
  15. }
  16. printSummaryComment(member, firstSentenceTags);
  17. }

相关文章