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

x33g5p2x  于2022-01-29 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(119)

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

Tag.kind介绍

[英]Return the kind of this tag. For most tags, kind() == name(); the following table lists those cases where there is more than one tag of a given kind: kind() name() @throws @throws @throws @exception @see @see @see @link @see @linkplain @serial @serial @serial @serialData
[中]返回这种标签。对于大多数标签,[$0$];下表列出了给定种类的多个标记的情况:kind()name()@throws@throws@exception@see@see@see@link@see@linkplain@serial@serial@serialData

代码示例

代码示例来源:origin: jersey/jersey

private static String print(final Tag tag) {
  return String.valueOf(tag.getClass()) + "["
      + "firstSentenceTags=" + toCSV(tag.firstSentenceTags())
      + ", inlineTags=" + toCSV(tag.inlineTags())
      + ", kind=" + tag.kind()
      + ", name=" + tag.name()
      + ", text=" + tag.text()
      + "]";
}

代码示例来源:origin: ch.raffael.pegdown-doclet/pegdown-doclet

/**
 * Process a tag.
 *
 * @param tag      The tag.
 * @param target   The target string builder.
 */
@SuppressWarnings("unchecked")
protected void processTag(Tag tag, StringBuilder target) {
  TagRenderer<Tag> renderer = (TagRenderer<Tag>)tagRenderers.get(tag.kind());
  if ( renderer == null ) {
    renderer = TagRenderer.VERBATIM;
  }
  renderer.render(tag, target, this);
}

代码示例来源:origin: com.atlassian.jersey/atlassian-jersey-restdoc

private static String print( Tag tag ) {
  final StringBuilder sb = new StringBuilder();
  sb.append( tag.getClass() ).append( "[" );
  sb.append( "firstSentenceTags=" ).append( toCSV( tag.firstSentenceTags() ) );
  sb.append( ", inlineTags=" ).append( toCSV( tag.inlineTags() ) );
  sb.append( ", kind=" ).append( tag.kind() );
  sb.append( ", name=" ).append( tag.name() );
  sb.append( ", text=" ).append( tag.text() );
  sb.append( "]" );
  return sb.toString();
}

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

private static String getDocWithIncludes(Doc doc)
{
  StringBuilder sb = new StringBuilder();
  if (!Strings.isNullOrEmpty(doc.commentText()))
  {
    for (Tag tag : doc.inlineTags())
    {
      if (tag.kind().equals(TEXT_TAG))
      {
        sb.append(P).append(tag.text());
      }
      else if (tag.kind().equals(SEE_TAG))
      {
        sb.append(getIncludeFromLink((SeeTag) tag));
      }
    }
    //sb.append(doc.commentText()).append(LS).append(LS);
  }
  String example = getExamples(doc);
  if (!Strings.isNullOrEmpty(example))
  {
    sb.append(example);
  }
  return sb.toString();
}

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

private static String getExamples(Doc doc)
{
  Tag[] exampleTags = getTagsOrNull(doc, EXAMPLE_TAG);
  StringBuilder sb = new StringBuilder(P);
  if (null != exampleTags)
  {
    for (Tag exampleTag : exampleTags)
    {
      final Tag[] inlineTags = exampleTag.inlineTags();
      if (null != inlineTags && inlineTags.length > 0)
      {
        for (Tag inlineTag : inlineTags)
        {
          if (SEE_TAG.equals(inlineTag.kind()))
          {
            final SeeTag linkTag = (SeeTag) inlineTag;
            sb.append(getExampleFromLink(linkTag));
          }
          else if (!Strings.isNullOrEmpty(inlineTag.text()))
          {
            sb.append(inlineTag.text());
          }
          sb.append(P);
        }
      }
    }
  }
  return sb.toString();
}

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

/**
 * Return tags of the specified kind in this comment.
 */
Tag[] tags(String tagname) {
  ListBuffer<Tag> found = new ListBuffer<Tag>();
  String target = tagname;
  if (target.charAt(0) != '@') {
    target = "@" + target;
  }
  for (Tag tag : tagList) {
    if (tag.kind().equals(target)) {
      found.append(tag);
    }
  }
  return found.toArray(new Tag[found.length()]);
}

代码示例来源:origin: com.github.markusbernhardt/xml-doclet

protected TagInfo parseTag(Tag tagDoc) {
  TagInfo tagNode = objectFactory.createTagInfo();
  tagNode.setName(tagDoc.kind());
  tagNode.setText(tagDoc.text());
  return tagNode;
}

相关文章