The purpose for the doclet is to load Java source files and create stubs (which are identical Java source files but do not contain any method implementation details).
Need the JavaDoc comments (located inside the newly created stub source file) to be properly formatted / match the format with the original source file using this doclet that I created...
Here's my doclet:
For example, lets say I run it against this target source file:
The newly created Java source file's JavaDoc looks like this:
Notice how with the exception of the first line, the second line and subsequent lines are pushed to the left side of the screen and don't containing leading asterisks before them...
This is definitely some type of weird formatting issue...
What am I possibly doing wrong?
Is there any easier way to correctly format the JavaDoc comments to match the target source file which is loaded by MyDoclet?
Should I be using the com.sun.javadoc.SourcePosition.line() or com.sun.javadoc.SourcePosition.column() methods?
posted 7 years ago
Put a breakpoint at method.commentText() and inspect that value, I suspect it contains the entire comment, and you then print it all on one line....
You're not looping through a list of lines in the file, what you might consider doing is splitting that text with String's split method, pass it the new line character and print the TAB plus an asterisk for each line and then close the comment.