Exemplo n.º 1
0
 /**
  * Generate separate index files, for each Unicode character, listing all the members starting
  * with the particular unicode character.
  *
  * @param indexbuilder IndexBuilder built by {@link IndexBuilder}
  * @throws DocletAbortException
  */
 public static void generate(ConfigurationImpl configuration, IndexBuilder indexbuilder) {
   SplitIndexWriter indexgen;
   String filename = "";
   String path = DirectoryManager.getPath("index-files");
   String relpath = DirectoryManager.getRelativePath("index-files");
   try {
     for (int i = 0; i < indexbuilder.elements().length; i++) {
       int j = i + 1;
       int prev = (j == 1) ? -1 : i;
       int next = (j == indexbuilder.elements().length) ? -1 : j + 1;
       filename = "index-" + j + ".html";
       indexgen =
           new SplitIndexWriter(configuration, path, filename, relpath, indexbuilder, prev, next);
       indexgen.generateIndexFile((Character) indexbuilder.elements()[i]);
       indexgen.close();
     }
   } catch (IOException exc) {
     configuration.standardmessage.error("doclet.exception_encountered", exc.toString(), filename);
     throw new DocletAbortException();
   }
 }
Exemplo n.º 2
0
  /**
   * Start the generation of files. Call generate methods in the individual writers, which will in
   * turn genrate the documentation files. Call the TreeWriter generation first to ensure the Class
   * Hierarchy is built first and then can be used in the later generation.
   *
   * <p>For new format.
   *
   * @see pl.wcislo.sbql4j.javadoc.RootDoc
   */
  protected void generateOtherFiles(RootDoc root, ClassTree classtree) throws Exception {
    super.generateOtherFiles(root, classtree);
    if (configuration.linksource) {
      if (configuration.destDirName.length() > 0) {
        SourceToHTMLConverter.convertRoot(
            configuration,
            root,
            configuration.destDirName + File.separator + DocletConstants.SOURCE_OUTPUT_DIR_NAME);
      } else {
        SourceToHTMLConverter.convertRoot(
            configuration, root, DocletConstants.SOURCE_OUTPUT_DIR_NAME);
      }
    }

    if (configuration.topFile.length() == 0) {
      configuration.standardmessage.error("doclet.No_Non_Deprecated_Classes_To_Document");
      return;
    }
    boolean nodeprecated = configuration.nodeprecated;
    String configdestdir = configuration.destDirName;
    String confighelpfile = configuration.helpfile;
    String configstylefile = configuration.stylesheetfile;
    performCopy(configdestdir, confighelpfile);
    performCopy(configdestdir, configstylefile);
    Util.copyResourceFile(configuration, "inherit.gif", false);
    // do early to reduce memory footprint
    if (configuration.classuse) {
      ClassUseWriter.generate(configuration, classtree);
    }
    IndexBuilder indexbuilder = new IndexBuilder(configuration, nodeprecated);

    if (configuration.createtree) {
      TreeWriter.generate(configuration, classtree);
    }
    if (configuration.createindex) {
      if (configuration.splitindex) {
        SplitIndexWriter.generate(configuration, indexbuilder);
      } else {
        SingleIndexWriter.generate(configuration, indexbuilder);
      }
    }

    if (!(configuration.nodeprecatedlist || nodeprecated)) {
      DeprecatedListWriter.generate(configuration);
    }

    AllClassesFrameWriter.generate(
        configuration, new IndexBuilder(configuration, nodeprecated, true));

    FrameOutputWriter.generate(configuration);

    if (configuration.createoverview) {
      PackageIndexWriter.generate(configuration);
    }
    if (configuration.helpfile.length() == 0 && !configuration.nohelp) {
      HelpWriter.generate(configuration);
    }
    if (configuration.stylesheetfile.length() == 0) {
      StylesheetWriter.generate(configuration);
    }
  }