本文整理汇总了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]);
}
示例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;
}
示例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;
}
示例4: isOpenAPIMethod
import com.sun.javadoc.MethodDoc; //导入方法依赖的package包/类
@Override
protected boolean isOpenAPIMethod(MethodDoc methodDoc) {
return methodDoc.isPublic();
}
示例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();
}
示例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);
}
}
示例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);
}
}