Skip to content
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

Add Documentation annotation #104

Closed
U1F984 opened this issue Apr 29, 2024 · 1 comment
Closed

Add Documentation annotation #104

U1F984 opened this issue Apr 29, 2024 · 1 comment

Comments

@U1F984
Copy link

U1F984 commented Apr 29, 2024

There are cases where the JavaDoc (KDoc) documentation of a method/field (or in Kotlin property) is useful at runtime (think e.g. describing a configuration class, which is used both by the developer and the enduser). If a custom annotation is used for this purpose it must be kept in sync with the normal documentation. I propose adding a @Doc or @Documentation or similar in which this documentation can be written. IDEs can then display this as-if it was written as real JavaDoc/KDoc.

@amaembo
Copy link
Collaborator

amaembo commented Apr 29, 2024

I think this goes outside the scope of java-annotations project. It looks like the use-case is pretty limited, and this would enforce a completely new form of documentation, incompatible with any known tools, including javadoc, or any Java IDEs. Instead, if you really need this in your project, you can write a source file processor which will dump the documentation from normal Javadoc into a format you like. E.g., you can generate a JSON file in the resources, which contains all the documentation, and load it at runtime. You may probably even reuse the existing javadoc tool providing a custom doclet.

@amaembo amaembo closed this as completed Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants