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

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

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

Tag.text介绍

[英]Return the text of this tag, that is, the portion beyond tag name.
[中]返回此标记的文本,即标记名之外的部分。

代码示例

代码示例来源:origin: MorphiaOrg/morphia

@Override
public String toString(final Tag[] tags) {
  if (tags.length == 0) {
    return null;
  }
  StringBuilder buf = new StringBuilder(String.format("\n<dl><dt><span class=\"strong\">%s</span></dt>\n", getHeader()));
  for (Tag t : tags) {
    buf.append("   <dd>").append(genLink(t.text())).append("</dd>\n");
  }
  return buf.toString();
}

代码示例来源:origin: apache/ignite

if (tag.text() == null || tag.text().isEmpty())
  return "";
String[] tokens = tag.text().split("#");

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

} else if (!isEmpty(inlineTag.text())) {
    return inlineTag.text();
return tag.text();

代码示例来源: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: jersey/jersey

responseDoc.setReturnDoc(returnTag.text());
for (final Tag inlineTag : responseParamTag.inlineTags()) {
  final String tagName = inlineTag.name();
  final String tagText = inlineTag.text();
for (final Tag tag : entry.getValue()) {
  if (tag.name().endsWith(".qname")) {
    representationDoc.setElement(QName.valueOf(tag.text()));
  } else if (tag.name().endsWith(".mediaType")) {
    representationDoc.setMediaType(tag.text());
  } else if (tag.name().endsWith(".example")) {
    representationDoc.setExample(getSerializedExample(tag));
  } else if (tag.name().endsWith(".doc")) {
    representationDoc.setDoc(tag.text());
  } else {
    LOG.warning("Unknown response representation tag " + tag.name());

代码示例来源:origin: stackoverflow.com

public class ExtractCommentsDoclet {
  public static boolean start(RootDoc root) throws IOException {
    for (ClassDoc c : root.classes()) {
      print(c.qualifiedName(), c.commentText());
      for (FieldDoc f : c.fields(false)) {
        print(f.qualifiedName(), f.commentText());
      }
      for (MethodDoc m : c.methods(false)) {
        print(m.qualifiedName(), m.commentText());
        if (m.commentText() != null && m.commentText().length() > 0) {
          for (ParamTag p : m.paramTags())
            print(m.qualifiedName() + "@" + p.parameterName(), p.parameterComment());
          for (Tag t : m.tags("return")) {
            if (t.text() != null && t.text().length() > 0)
              print(m.qualifiedName() + "@return", t.text());
          }
        }
      }
    }
    return true;
  }

  private static void print(String name, String comment) throws IOException {
    if (comment != null && comment.length() > 0) {
      new FileWriter(name + ".txt").append(comment).close();
    }
  }
}

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

private static void addRequestRepresentationDoc(final MethodDoc methodDoc,
                        final MethodDocType methodDocType) {
  final Tag requestElement = getSingleTagOrNull(methodDoc, "request.representation.qname");
  final Tag requestExample = getSingleTagOrNull(methodDoc, "request.representation.example");
  if (requestElement != null || requestExample != null) {
    final RequestDocType requestDoc = new RequestDocType();
    final RepresentationDocType representationDoc = new RepresentationDocType();
    /* requestElement exists
     */
    if (requestElement != null) {
      representationDoc.setElement(QName.valueOf(requestElement.text()));
    }
    /* requestExample exists
     */
    if (requestExample != null) {
      final String example = getSerializedExample(requestExample);
      if (!isEmpty(example)) {
        representationDoc.setExample(example);
      } else {
        LOG.warning("Could not get serialized example for method " + methodDoc.qualifiedName());
      }
    }
    requestDoc.setRepresentationDoc(representationDoc);
    methodDocType.setRequestDoc(requestDoc);
  }
}

代码示例来源:origin: openmrs/openmrs-core

/**
 * Given the <code>Tag</code> representation of this custom tag, return its string
 * representation.
 * 
 * @param tag the <code>Tag</code> representation of this custom tag.
 */
@Override
public String toString(Tag tag) {
  return "\n<DT><B>" + HEADER + "</B></DT>\n  <DD>Should " + tag.text() + "</DD>";
}

代码示例来源:origin: openmrs/openmrs-core

/**
   * Given an array of <code>Tag</code>s representing this custom tag, return its string
   * representation.
   * 
   * @param tags the array of <code>Tag</code>s representing of this custom tag.
   */
  @Override
  public String toString(Tag[] tags) {
    if (tags.length == 0) {
      return null;
    }
    StringBuilder result = new StringBuilder("\n<DT><B>").append(HEADER).append("</B></DT>");
    for (Tag tag : tags) {
      result.append("\n  <DD>Should ").append(tag.text()).append("</DD>");
    }
    return result.toString();
  }
}

代码示例来源:origin: io.github.javaeden.orchid/OrchidJavadoc

public static String getText(Tag[] tags) {
    String text = "";
    for (Tag tag : tags) {
      text += tag.text();
    }
    return text;
  }
}

代码示例来源:origin: apache/odftoolkit

/**
 * Given the <code>Tag</code> representation of this custom
 * tag, return its string representation.
 * @param tag he <code>Tag</code> representation of this custom tag.
 * @return the string representation of the custom tag
 */
public String toString(Tag tag) {
  String fragmentIdentifier = "datatype-" + tag.text();
  return "<a href=\"" + mOdfSpecPath + "#" + fragmentIdentifier + "\">" + tag.text() + "</a>";
}

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

@Override
  public void render(Tag tag, StringBuilder target, PegdownDoclet doclet) {
    target.append(tag.name()).append(" ").append(tag.text());
  }
};

代码示例来源: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: io.github.javaeden.orchid/OrchidJavadoc

@Override
  public JSONElement processTag(Tag tag) {
    return new JSONElement(tag.text());
  }
}

代码示例来源: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: org.broadinstitute/barclay

/**
 * Add any custom freemarker bindings discovered via custom javadoc tags. Subclasses can override this to
 * provide additional custom bindings.
 *
 * @param currentWorkUnit the work unit for the feature being documented
 */
protected void addCustomBindings(final DocWorkUnit currentWorkUnit) {
  final String tagFilterPrefix = getTagPrefix();
  Arrays.stream(currentWorkUnit.getClassDoc().inlineTags())
      .filter(t -> t.name().startsWith(tagFilterPrefix))
      .forEach(t -> currentWorkUnit.setProperty(t.name().substring(tagFilterPrefix.length()), t.text()));
}

代码示例来源: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: improbable-research/keanu

@Before
public void initialiseMocks() {
  when(constructorDoc.tags(PARAM_TAG_NAME)).thenReturn(new Tag[] {tag1, tag2});
  when(tag1.name()).thenReturn(PARAM_TAG_NAME);
  when(tag1.text()).thenReturn(FIRST_PARAM_TEXT);
  when(tag2.name()).thenReturn(PARAM_TAG_NAME);
  when(tag2.text()).thenReturn(SECOND_PARAM_TEXT);
  when(tag3.name()).thenReturn(RETURN_TAG_NAME);
  when(tag3.text()).thenReturn(RETURN_TAG_TEXT);
}

代码示例来源: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;
}

相关文章