-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom annotations instead of custom doc tags #59
Comments
Nice idea, thanks! This will however break backward compatibility. How do you suggest to address this problem? |
There's no need to break backward compatibility. The annotations are add-ons.
|
OK, I see, so we should support both. Makes sense, thank you! |
I had been considering to propose this. There is a problem with this approach:
This would work much better when actually parsing the java sources with, e.g., the javaparser module. But at some point this means completely rewriting JavaDoc itself to a substantial extend... |
We can do it a hacky way by making it update the source to put in the "@opt" tags in the generated javadoc. However, this will not help with JDK9+. The problem with JDK9+ is they locked down Standard Doclet/HtmlDoclet so we can't just inject our own HTML along theirs. (Unless you guys found a way around it, I tried and failed for the moment) |
Mind you the way UMLGraph has it now with UMLOptions adds code for the VM as well. |
@kno10 can CLASS retention be usable for JavaDoc? Class retention makes the class size bigger but the data is not available in runtime so the VM memory shouldn't be impacted as much. |
A class such as UMLOptions will not be loaded into the VM unless you use it somewhere (but I would also prefer using the package-info, but this may be much harder to access). It should be easy to omit it from the jar altogether. |
A common approach for extending javadoc HTML always was to wait until the standard doclet has done its job, then 'edit' the generated HTML and insert your extensions. :-( But of course that breaks every other JDK version. its really an anti-API what Oracle does with javadoc... |
So this idea suggests that the custommade tags should coexist with the javadoc tags, right? Please correct me if Im wrong, |
@ekaratarakis almost (I am talking about custom annotations not tags) I don't want to break compatibility by adding support for the Java Annotations that are UMLGraph specific. |
Right I see. So apart from avoiding the warnings that the tag is unknown in javadoc, would you suggest any another benefit in using custom annotations? |
Annotations have a clear API and a much less fragile. Javadoc tags can break when e.g. code formatting adds a line break. |
Rather than javadoc doc tags, perhaps use custom annotations (since you're targetting JDK5+ anyway) that way we won't get warnings that the tag is unknown in javadoc and we can make it type safe.
The text was updated successfully, but these errors were encountered: