I need something like
<sometype> myJavaElement = <something which gives class X>
myJavaElement.getComment();
One way which I was thinking of was using the AntLR and modifying the
lexer code generated by the AntLR. But was wondering that this problem
might (should ) have been faced by other people and if there exists
an open source tool which can be used for this purpose.
I looked at qdox but that I guess will not be able to handle package
level comments which is a basic requirement for me.
Any help is highly appreciated and highly awaited.
Thanks a lot,
Sudhanshu
>One way which I was thinking of was using the AntLR and modifying the
>lexer code generated by the AntLR. But was wondering that this problem
>might (should =EF=81=8A) have been faced by other people and if there exists
>an open source tool which can be used for this purpose.
>I looked at qdox but that I guess will not be able to handle package
>level comments which is a basic requirement for me.
I don't follow why you are doing this or what precisely you are
tracking. However, there are two techniques in general for tackling
this sort of problem.
1. annotations:
2. custom Javadoc comments you handle with a custom Doclet to generate
the HTML or other summaries.
See http://mindprod.com/jgloss/annotations.html
http://mindprod.com/jgloss/javadoc.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
> Hi!,
> I need a way to associate a javadoc comment with the corresponding
> Java Element. And access that programmatically in Java.
Comments (including "javadoc comments") are not retained by the compiler.
End of story. If you need some descriptive information about a class at
runtime, either store it in an annotation with runtime retention or create
a lookup table mapping symbols (class names, packages, class member names,
et cetera) to the information you need and access that.
Use a custom doclet, write <method,comment> pairs to some output file.
Read them back as required,
Richard
sudhanshu