當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。