当前位置: 首页>>代码示例>>Java>>正文


Java MethodDoc.isPublic方法代码示例

本文整理汇总了Java中com.sun.javadoc.MethodDoc.isPublic方法的典型用法代码示例。如果您正苦于以下问题:Java MethodDoc.isPublic方法的具体用法?Java MethodDoc.isPublic怎么用?Java MethodDoc.isPublic使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.javadoc.MethodDoc的用法示例。


在下文中一共展示了MethodDoc.isPublic方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTestMethods

import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
/**
 * Returns an array containing all of the "test" methods (including those that are inherited) for
 * the given class.
 */
private static MethodDoc[] getTestMethods(ClassDoc c) {
  Set set = new TreeSet();
  while (c != null) {
    MethodDoc[] methods = c.methods();
    for (int i = 0; i < methods.length; i++) {
      MethodDoc method = methods[i];
      if (method.isPublic() && method.parameters().length == 0
          && method.name().startsWith("test")) {
        set.add(method);
      }
    }

    c = c.superclass();
  }

  return (MethodDoc[]) set.toArray(new MethodDoc[0]);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:22,代码来源:UnitTestDoclet.java

示例2: start

import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
public static boolean start(RootDoc root) {
  ClassDoc[] classes = root.classes();
  for (int i = 0; i < classes.length; i++) {
    System.out.println(classes[i]);
    ClassDoc classdoc = classes[i];
    String x = classdoc.getRawCommentText();
    System.out.println(x);
    MethodDoc[] methods = classes[i].methods();
    for (int j = 0; j < methods.length; j++) {
      MethodDoc m = methods[j];
      System.out.println(m.getRawCommentText());
      if (m.isPublic()) {
        System.out.println("\t" + m.name());
        Parameter[] parameters = m.parameters();
        for (int k = 0; k < parameters.length; k++) {
          Parameter p = parameters[k];
          System.out.println("\t\t" + p.name() + ": " + p.type().qualifiedTypeName());
        }
      }
    }
  }
  return true;
}
 
开发者ID:MyRobotLab,项目名称:myrobotlab,代码行数:24,代码来源:ListMethodsDoclet.java

示例3: build

import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
public static PSOperatorDoc build(ClassDoc classDoc, MethodDoc methodDoc) {
    if (methodDoc.isStatic() && methodDoc.isPublic()
            && Utils.instanceOf(methodDoc.returnType().asClassDoc(), Consts.TYPE_FUNCTION)) {
        return new PSOperatorDoc(classDoc, methodDoc);
    }
    return null;
}
 
开发者ID:PrivacyStreams,项目名称:PrivacyStreams,代码行数:8,代码来源:PSOperatorDoc.java

示例4: isOpenAPIMethod

import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
@Override
protected boolean isOpenAPIMethod(MethodDoc methodDoc) {
	return methodDoc.isPublic();
}
 
开发者ID:WinRoad-NET,项目名称:wrdocletbase,代码行数:5,代码来源:AbstractServiceDocBuilder.java

示例5: isSetter

import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
static boolean isSetter(MethodDoc m) {
  return isSetter(m.name()) && m.parameters().length == 1
      && m.isPublic() && !m.isStatic() && !m.isSynthetic();
}
 
开发者ID:mikesamuel,项目名称:closure-maven-plugin,代码行数:5,代码来源:PluginConfigDoclet.java

示例6: writeAttributes

import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
/**
	 * Write all Ant attributes in this class and superclasses.
	 *
	 * @param tf
	 *            destination.
	 * @param clazz
	 *            class documentation.
	 * @param processed
	 *            map of processed methods.
	 * @param referencedTypes
	 *            map of referenced types.
	 * @throws Exception
	 *             if IO or other exception.
	 */
	private static void writeAttributes(final TransformerHandler tf, final ClassDoc clazz,
			final Map<String, Comparable> processed, final Map<String, Type> referencedTypes) throws Exception {
		final MethodDoc[] methods = clazz.methods();
		for (int i = 0; i < methods.length; i++) {
			final MethodDoc method = methods[i];
			if (processed.get(method.name()) == null) {
				if (method.name().startsWith("set") && method.isPublic() && method.parameters().length == 1) {
					TaskDoclet.writeAttribute(tf, method);
					referencedTypes.put(method.parameters()[0].typeName(), method.parameters()[0].type());
				}
				processed.put(method.name(), method);
			}
		}
		if (clazz.superclass() != null) {
			TaskDoclet.writeAttributes(tf, clazz.superclass(), processed, referencedTypes);
		}

	} 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:33,代码来源:TaskDoclet.java

示例7: writeChildren

import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
/**
	 * Write all Ant nested elements in this class and superclasses.
	 *
	 * @param tf
	 *            destination.
	 * @param clazz
	 *            class documentation.
	 * @param processed
	 *            map of processed methods.
	 * @param referencedTypes
	 *            map of referenced types.
	 * @throws Exception
	 *             if IO or other exception.
	 */
	private static final void writeChildren(final TransformerHandler tf, final ClassDoc clazz,
			final Map<String, MethodDoc> processed, final Map<String, Type> referencedTypes) throws Exception {
		final MethodDoc[] methods = clazz.methods();
		for (int i = 0; i < methods.length; i++) {
			final MethodDoc method = methods[i];
			if (processed.get(method.name()) == null) {
				if (method.name().startsWith("addConfigured") && method.isPublic() && method.parameters().length == 1) {
					TaskDoclet.writeChild(tf, method, method.name().substring(13), method.parameters()[0].type(),
							referencedTypes);
				}
				if (method.name().startsWith("add") && method.isPublic() && method.parameters().length == 1) {
					TaskDoclet.writeChild(tf, method, method.name().substring(3), method.parameters()[0].type(),
							referencedTypes);
				}
				if (method.isPublic() && method.parameters().length == 0 && method.name().startsWith("create")) {
					TaskDoclet.writeChild(tf, method, method.name().substring(6), method.returnType(), referencedTypes);
				}
				processed.put(method.name(), method);
			}
		}
		if (clazz.superclass() != null) {
			TaskDoclet.writeChildren(tf, clazz.superclass(), processed, referencedTypes);
		}
	} 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:39,代码来源:TaskDoclet.java


注:本文中的com.sun.javadoc.MethodDoc.isPublic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。