本文整理匯總了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);
}
}