Example #1
0
 /**
  * Get list of all the deprecated classes and members in all the Packages specified on the Command
  * Line. Then instantiate DeprecatedListWriter and generate File.
  *
  * @param configuration the current configuration of the doclet.
  */
 public static void generate(ConfigurationImpl configuration) {
   String filename = "deprecated-list.html";
   try {
     DeprecatedListWriter depr = new DeprecatedListWriter(configuration, filename);
     depr.generateDeprecatedListFile(new DeprecatedAPIListBuilder(configuration.root));
     depr.close();
   } catch (IOException exc) {
     configuration.standardmessage.error("doclet.exception_encountered", exc.toString(), filename);
     throw new DocletAbortException();
   }
 }
 /**
  * Create a TreeWriter object and use it to generate the "overview-tree.html" file.
  *
  * @param classtree the class tree being documented.
  * @throws DocletAbortException
  */
 public static void generate(ConfigurationImpl configuration, ClassTree classtree) {
   TreeWriter treegen;
   String filename = "overview-tree.html";
   try {
     treegen = new TreeWriter(configuration, filename, classtree);
     treegen.generateTreeFile();
     treegen.close();
   } catch (IOException exc) {
     configuration.standardmessage.error("doclet.exception_encountered", exc.toString(), filename);
     throw new DocletAbortException();
   }
 }
Example #3
0
 /**
  * Construct FrameOutputWriter object and then use it to generate the Html file which will have
  * the description of all the frames in the documentation. The name of the generated file is
  * "index.html" which is the default first file for Html documents.
  *
  * @throws DocletAbortException
  */
 public static void generate(ConfigurationImpl configuration) {
   FrameOutputWriter framegen;
   String filename = "";
   try {
     filename = "index.html";
     framegen = new FrameOutputWriter(configuration, filename);
     framegen.generateFrameFile();
     framegen.close();
   } catch (IOException exc) {
     configuration.standardmessage.error("doclet.exception_encountered", exc.toString(), filename);
     throw new DocletAbortException();
   }
 }
 /**
  * Generate a class page.
  *
  * @param configuration the current configuration of the doclet.
  * @param mapper the mapping of the class usage.
  * @param pkgdoc the package doc being documented.
  */
 public static void generate(
     ConfigurationImpl configuration, ClassUseMapper mapper, PackageDoc pkgdoc) {
   PackageUseWriter pkgusegen;
   DocPath filename = DocPaths.PACKAGE_USE;
   try {
     pkgusegen = new PackageUseWriter(configuration, mapper, filename, pkgdoc);
     pkgusegen.generatePackageUseFile();
     pkgusegen.close();
   } catch (IOException exc) {
     configuration.standardmessage.error("doclet.exception_encountered", exc.toString(), filename);
     throw new DocletAbortException(exc);
   }
 }
 /**
  * Convert the given Class to an HTML.
  *
  * @param cd the class to convert.
  * @param outputdir the name of the directory to output to.
  */
 public void convertClass(ClassDoc cd, DocPath outputdir) {
   if (cd == null) {
     return;
   }
   try {
     SourcePosition sp = cd.position();
     if (sp == null) return;
     Reader r;
     // temp hack until we can update SourcePosition API.
     if (sp instanceof SourcePositionImpl) {
       FileObject fo = ((SourcePositionImpl) sp).fileObject();
       if (fo == null) return;
       r = fo.openReader(true);
     } else {
       File file = sp.file();
       if (file == null) return;
       r = new FileReader(file);
     }
     int lineno = 1;
     String line;
     relativePath = DocPaths.SOURCE_OUTPUT.resolve(DocPath.forPackage(cd)).invert();
     Content body = getHeader();
     Content pre = new HtmlTree(HtmlTag.PRE);
     try (LineNumberReader reader = new LineNumberReader(r)) {
       while ((line = reader.readLine()) != null) {
         addLineNo(pre, lineno);
         addLine(pre, line, lineno);
         lineno++;
       }
     }
     addBlankLines(pre);
     Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
     body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(div) : div);
     writeToFile(body, outputdir.resolve(DocPath.forClass(cd)));
   } catch (IOException e) {
     e.printStackTrace();
   }
 }