Java Comments and Annotation with Code Generation [message #1749724] |
Sat, 10 December 2016 09:40 |
Eclipse User |
|
|
|
Hi Guys,
I am fearly new to Papyrus but I have found myself wondering on how to create Comments and Annotations in Papyrus that are supported by the CodeGenerator.
To be exact what do I have to do that Java annotations and JAvaDocs are generated from comments in a plugin.
Thanks in advance.
Best Regards
Hannes
|
|
|
Re: Java Comments and Annotation with Code Generation [message #1749903 is a reply to message #1749724] |
Tue, 13 December 2016 16:03 |
|
Hi,
it's not clear which code generation do you mean. If you want to generate code from a model, a UML comment whose "annoted element" reference points to an operation of a class or the class itself is taken into account in the generated C++ code or Java code and produce JavaDoc compatible comments in the code.
However, since you talk about JavaDocs generated from comments in a plugin, you refer to a different kind of generator?
|
|
|
|
Re: Java Comments and Annotation with Code Generation [message #1749967 is a reply to message #1749922] |
Wed, 14 December 2016 14:24 |
Eclipse User |
|
|
|
I was refering to the standard Java Code Generator.
I found the option to get JavaDocs comments automatically generated:
- Create a Comment
- In properties click the plus on Annotaded Element and choose the Item that should have this comment written in JavaDocs (also possible is to use the Link connector)
What I now also like to know:
Karim Deif wrote on Tue, 13 December 2016 20:40Hi,
I would like to add Java annotations not javadocs. For example I would like the generated java code to have @Document annotation not in a javadoc. I hope thats possible.
|
|
|
Re: Java Comments and Annotation with Code Generation [message #1750084 is a reply to message #1749967] |
Thu, 15 December 2016 22:07 |
|
Currently, Java annotations are not supported. The "Import" stereotype can be used to add an arbitrary string to the header of a Java file which could be used to add an annotation to a class, but not to specific methods.
If you feel that this is a bug, please file a bug with "severity = enhancement",
If you want to have a look at the generator code yourself:
The (xtend) class JavaDocumentation in plugin oepd.languages.java.codegen generates the JavaDoc. It could for instance be modified to use the comment text without JavaDoc prefixes, if comment text starts with a special character such as "@".
|
|
|
|
Powered by
FUDForum. Page generated in 0.04145 seconds