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

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

本文整理了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

private static Tag[] getTagsOrNull(Doc taggedDoc, String tagName)
  {
    final Tag[] tags = taggedDoc.tags(tagName);

    if (tags != null && tags.length > 0)
    {
      return tags;
    }

    return null;
  }
}

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

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;
}

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

/**
 * 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;
}

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

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

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

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

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

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;
  }
}

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

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

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

static boolean isHidden(Doc node) {
  if (node.tags(TAG_HIDDEN).length > 0) {
    return true;
  }
  Tag[] tags = node.tags(TAG_EXCLUDE);
  if (tags == null) {
    return false;
  }
  for (Tag t: tags) {
    if (t.text() == null || t.text().trim().length() == 0) {
      return true;
    }
  }
  return false;
}

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

/**
   * {@inheritDoc}
   */
  public Content getTagletOutput(Doc holder, TagletWriter writer) {
    if (header == null || holder.tags(getName()).length == 0) {
      return null;
    }
    return writer.simpleTagOutput(holder.tags(getName()), header);
  }
}

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

/**
   * {@inheritDoc}
   */
  public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) {
    if (header == null || holder.tags(getName()).length == 0) {
      return null;
    }
    return writer.simpleTagOutput(holder.tags(getName()), header);
  }
}

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

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));
    }
  }
}

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

/** 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()));
}

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

/**
 * 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];
}

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

/**
 * 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];
}

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

/**
 * 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]));
}
}

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

/**
   * {@inheritDoc}
   */
  public TagletOutput getTagletOutput(Doc holder, TagletWriter writer)
      throws IllegalArgumentException {
    TagletOutput output = writer.getOutputInstance();
    output.setOutput(legacyTaglet.toString(holder.tags(getName())));
    return output;
  }
}

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

/**
 * 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]));
}
}

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

/**
   * 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];
  }
}

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

/**
   * 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];
  }
}

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

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);
}

相关文章