示例#1
0
  public static void writeModules(String filename) {
    Data data = makeHDF();

    int i = 0;
    for (PackageInfo pkg : chooseModulePackages()) {

      data.setValue("reference", "1");
      data.setValue("reference.apilevels", sinceTagger.hasVersions() ? "1" : "0");
      data.setValue("docs.packages." + i + ".name", pkg.name());
      makeModuleListHDF(data, "docs.packages." + i + ".modules", pkg.modules());

      for (int j = 0; j < pkg.modules().length; j++) {
        Data classData = makeHDF();
        ClassInfo mod = pkg.modules()[j];
        writeModule(mod, classData);
      }

      i++;
    }

    setPageTitle(data, "Module Index");

    TagInfo.makeHDF(data, "root.descr", Converter.convertTags(root.inlineTags(), null));

    ClearPage.write(data, "modules.cs", filename);

    Proofread.writePackages(filename, Converter.convertTags(root.inlineTags(), null));
  }
示例#2
0
  public static void writePackage(PackageInfo pkg) {
    // these this and the description are in the same directory,
    // so it's okay
    Data data = makePackageHDF();

    String name = pkg.name();

    data.setValue("package.name", name);
    data.setValue("package.since.key", SinceTagger.keyForName(pkg.getSince()));
    data.setValue("package.since.name", pkg.getSince());
    data.setValue("package.descr", "...description...");
    pkg.setFederatedReferences(data, "package");

    makeClassListHDF(data, "package.annotations", ClassInfo.sortByName(pkg.getAnnotations()));
    makeClassListHDF(data, "package.interfaces", ClassInfo.sortByName(pkg.getInterfaces()));
    makeClassListHDF(data, "package.classes", ClassInfo.sortByName(pkg.ordinaryClasses()));
    makeClassListHDF(data, "package.modules", ClassInfo.sortByName(pkg.modules()));
    makeClassListHDF(data, "package.enums", ClassInfo.sortByName(pkg.enums()));
    makeClassListHDF(data, "package.exceptions", ClassInfo.sortByName(pkg.exceptions()));
    makeClassListHDF(data, "package.errors", ClassInfo.sortByName(pkg.errors()));

    TagInfo[] shortDescrTags = pkg.firstSentenceTags();
    TagInfo[] longDescrTags = pkg.inlineTags();
    TagInfo.makeHDF(data, "package.shortDescr", shortDescrTags);
    TagInfo.makeHDF(data, "package.descr", longDescrTags);
    data.setValue(
        "package.hasLongDescr", TagInfo.tagsEqual(shortDescrTags, longDescrTags) ? "0" : "1");

    String filename = Doclava.javadocDir + pkg.relativePath();
    setPageTitle(data, name);
    ClearPage.write(data, "package.cs", filename);

    filename = javadocDir + pkg.fullDescriptionFile();
    setPageTitle(data, name + " Details");
    ClearPage.write(data, "package-descr.cs", filename);

    Proofread.writePackage(filename, pkg.inlineTags());
  }