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

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

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

Doc.isMethod介绍

[英]Is this Doc item a method (but not a constructor or annotation type element)?
[中]此文档项是否为方法(但不是构造函数或注释类型元素)?

代码示例

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

);
} else
if (to.isMethod()) {
  MethodDoc toMethodDoc = (MethodDoc) to;
  defaultLabelHtml += to.name() + this.prettyPrintParameterList(toMethodDoc);

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

);
} else
if (to.isMethod()) {
  MethodDoc toMethodDoc = (MethodDoc) to;
  defaultLabelHtml += to.name() + this.prettyPrintParameterList(toMethodDoc);

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

/**
 * Generates the "fragment" identifier for the given <var>doc</var>.
 * <dl>
 *   <dt>{@link FieldDoc}:</dt>
 *   <dd>{@code "#fieldName"}</dd>
 *   <dt>{@link MethodDoc}:</dt>
 *   <dd>{@code "#methodName(java.lang.String,int)"}</dd>
 *   <dt>Other:</dt>
 *   <dd>{@code ""}</dd>
 * </dl>
 */
private static String
fragmentIdentifier(Doc doc) {
  if (doc.isField()) return '#' + doc.name();
  if (doc.isConstructor()) {
    ConstructorDoc constructorDoc = (ConstructorDoc) doc;
    return (
      '#'
      + constructorDoc.containingClass().name()
      + Html.parameterListForFragmentIdentifier(constructorDoc)
    );
  }
  if (doc.isMethod()) {
    MethodDoc methodDoc = (MethodDoc) doc;
    return '#' + doc.name() + Html.parameterListForFragmentIdentifier(methodDoc);
  }
  return "";
}

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

/**
 * Generates the "fragment" identifier for the given <var>doc</var>.
 * <dl>
 *   <dt>{@link FieldDoc}:</dt>
 *   <dd>{@code "#fieldName"}</dd>
 *   <dt>{@link MethodDoc}:</dt>
 *   <dd>{@code "#methodName(java.lang.String,int)"}</dd>
 *   <dt>Other:</dt>
 *   <dd>{@code ""}</dd>
 * </dl>
 */
private static String
fragmentIdentifier(Doc doc) {
  if (doc.isField()) return '#' + doc.name();
  if (doc.isConstructor()) {
    ConstructorDoc constructorDoc = (ConstructorDoc) doc;
    return (
      '#'
      + constructorDoc.containingClass().name()
      + Html.parameterListForFragmentIdentifier(constructorDoc)
    );
  }
  if (doc.isMethod()) {
    MethodDoc methodDoc = (MethodDoc) doc;
    return '#' + doc.name() + Html.parameterListForFragmentIdentifier(methodDoc);
  }
  return "";
}

相关文章