當前位置: 首頁>>代碼示例>>Java>>正文


Java RootDoc.specifiedClasses方法代碼示例

本文整理匯總了Java中com.sun.javadoc.RootDoc.specifiedClasses方法的典型用法代碼示例。如果您正苦於以下問題:Java RootDoc.specifiedClasses方法的具體用法?Java RootDoc.specifiedClasses怎麽用?Java RootDoc.specifiedClasses使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sun.javadoc.RootDoc的用法示例。


在下文中一共展示了RootDoc.specifiedClasses方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: test

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
void test(boolean withOption) {
    System.err.println("Testing " + (withOption ? "with" : "without") + " option");
    try {
        String dump = "";
        RootDoc root = getRootDoc(withOption);
        for (ClassDoc cd: root.specifiedClasses()) {
            dump += dump(cd);
        }
        if (dump.contains("lib.Lib2.i")) {
            if (!withOption) {
                error("control case failed: Lib2 class file was read, unexpectedly, without using option");
            }
        } else {
            if (withOption) {
                error("test case failed: could not read Lib2 class file, using option");
            }
        }
    } catch (ClosedFileSystemException e) {
        error("Unexpected exception: " + e);
    }
    System.err.println();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:23,代碼來源:T8147801.java

示例2: test

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
void test(boolean withOption) {
    System.err.println("Testing " + (withOption ? "with" : "without") + " option");
    try {
        RootDoc root = getRootDoc(withOption);
        for (ClassDoc cd: root.specifiedClasses()) {
            dump("", cd);
        }
        if (!withOption) {
            error("expected option did not occur");
        }
    } catch (ClosedFileSystemException e) {
        if (withOption) {
            error("Unexpected exception: " + e);
        } else {
            System.err.println("Exception received as expected: " + e);
        }
    }
    System.err.println();
}
 
開發者ID:campolake,項目名稱:openjdk9,代碼行數:20,代碼來源:T8147801.java

示例3: run

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
private void run(RootDoc rootDoc)
{
   printHeader("Overview");

   printSubHeader("Specified Packages");

   PackageDoc[] specifiedPackages = rootDoc.specifiedPackages();
   Arrays.sort(specifiedPackages);
   for (int i=0; i<specifiedPackages.length; ++i) {
      out.println(specifiedPackages[i].name());
   }

   printSubHeader("Specified Classes");

   ClassDoc[] specifiedClasses = rootDoc.specifiedClasses();
   Arrays.sort(specifiedClasses);
   for (int i=0; i<specifiedClasses.length; ++i) {
      out.println(specifiedClasses[i].qualifiedTypeName());
   }
   printSubHeader("Classes");

   ClassDoc[] classes = rootDoc.classes();
   Arrays.sort(classes);
   for (int i=0; i<classes.length; ++i) {
      out.println(classes[i].qualifiedTypeName());
   }

   printHeader("Class Detail");

   for (int i=0; i<classes.length; ++i) {
      printSubHeader(classes[i].qualifiedTypeName());

      printTags(classes[i].firstSentenceTags());

      printSub2Header("Methods");

      MethodDoc[] methods = classes[i].methods();

      for (int j=0; j<methods.length; ++j) {
         out.println("name: \"" + methods[j].name() + "\"");
         out.println("signature: \"" + methods[j].signature() + "\"");
         out.println("modifiers: \"" + methods[j].modifiers() + "\"");
         out.print("throws: ");
         ClassDoc[] thrownExceptions = methods[j].thrownExceptions();
         for (int k=0; k<thrownExceptions.length; ++k) {
            if (k>0) { out.print(", "); }
            out.print(thrownExceptions[k].qualifiedTypeName());
         }
         out.println();
      }

      printSub2Header("Fields");

      FieldDoc[] fields = classes[i].fields();

      for (int j=0; j<fields.length; ++j) {
         out.println("name: \"" + fields[j].name() + "\"");
         out.println("modifiers: \"" + fields[j].modifiers() + "\"");
         out.println();
      }

      printSub2Header("Serializable Fields");

      FieldDoc[] sfields = classes[i].serializableFields();

      for (int j=0; j<sfields.length; ++j) {
         out.println("name: \"" + sfields[j].name() + "\"");
         out.println("modifiers: \"" + sfields[j].modifiers() + "\"");
         out.println();
      }
   }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:73,代碼來源:DebugDoclet.java

示例4: run

import com.sun.javadoc.RootDoc; //導入方法依賴的package包/類
private void run(RootDoc rootDoc) 
{
   printHeader("Overview");

   printSubHeader("Specified Packages");

   PackageDoc[] specifiedPackages = rootDoc.specifiedPackages();
   Arrays.sort(specifiedPackages);
   for (int i=0; i<specifiedPackages.length; ++i) {
      out.println(specifiedPackages[i].name());
   }

   printSubHeader("Specified Classes");

   ClassDoc[] specifiedClasses = rootDoc.specifiedClasses();
   Arrays.sort(specifiedClasses);
   for (int i=0; i<specifiedClasses.length; ++i) {
      out.println(specifiedClasses[i].qualifiedTypeName());
   }
   printSubHeader("Classes");

   ClassDoc[] classes = rootDoc.classes();
   Arrays.sort(classes);
   for (int i=0; i<classes.length; ++i) {
      out.println(classes[i].qualifiedTypeName());
   }

   printHeader("Class Detail");

   for (int i=0; i<classes.length; ++i) {
      printSubHeader(classes[i].qualifiedTypeName());

      printTags(classes[i].firstSentenceTags());

      printSub2Header("Methods");

      MethodDoc[] methods = classes[i].methods();

      for (int j=0; j<methods.length; ++j) {
         out.println("name: \"" + methods[j].name() + "\"");
         out.println("signature: \"" + methods[j].signature() + "\"");
         out.println("modifiers: \"" + methods[j].modifiers() + "\"");
         out.print("throws: ");
         ClassDoc[] thrownExceptions = methods[j].thrownExceptions();
         for (int k=0; k<thrownExceptions.length; ++k) {
            if (k>0) { out.print(", "); }
            out.print(thrownExceptions[k].qualifiedTypeName());
         }
         out.println();
      }

      printSub2Header("Fields");

      FieldDoc[] fields = classes[i].fields();

      for (int j=0; j<fields.length; ++j) {
         out.println("name: \"" + fields[j].name() + "\"");
         out.println("modifiers: \"" + fields[j].modifiers() + "\"");
         out.println();
      }

      printSub2Header("Serializable Fields");

      FieldDoc[] sfields = classes[i].serializableFields();

      for (int j=0; j<sfields.length; ++j) {
         out.println("name: \"" + sfields[j].name() + "\"");
         out.println("modifiers: \"" + sfields[j].modifiers() + "\"");
         out.println();
      }
   }
}
 
開發者ID:nmldiegues,項目名稱:jvm-stm,代碼行數:73,代碼來源:DebugDoclet.java


注:本文中的com.sun.javadoc.RootDoc.specifiedClasses方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。