Hello fellow Ranchers,
Need a way to create a source code stub (a new
Java source file from a pre-existing Java source file) which includes JavaDoc (but does not contain any implementation specifics or private properties / private members). Read that the best way to go about doing this is by using the
Doclet API located in the JVM's tools.jar archive.
Basically, need to write a Java program which does the following:
(1) Reads a top-level source directory (containing multiple source files) or a single Java source file.
(2) Parses a Java file and and then outputs a new Java file to a different directory.
(3) The newly created Java file, is the same as the first, but does not include implementation / details of the code, inside the methods. Also, it doesn't contain the private members and private fields from the original, but does contain public and protected properties and methods. It does need to include the JavaDoc comments from the original.
Here's an example:
e.g. Original .java source file:
The newly "stubbed" file still has the same name: Inventory.java (but is placed in a different directory):
Question(s):
(1) Is the Doclet API the best way to go about doing this?
(2) Are there any 3rd party tools that do this for a developer?
Happy coding to all,
Mike
[ July 18, 2008: Message edited by: Michael K. Wilson ]