# Java annotations in class diagram and code generation

**URL:** <https://forums.visual-paradigm.com/t/java-annotations-in-class-diagram-and-code-generation/14609>\
**Category:** General Questions/Discussions\
**Tags:** uml, modeling\
**Created:** [October 17, 2018, 7:57am UTC](https://forums.visual-paradigm.com/t/java-annotations-in-class-diagram-and-code-generation/14609 "2018-10-17T07:57:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cryptology](https://avatars.discourse-cdn.com/v2/letter/c/6bbea6/32.png) [@cryptology](https://forums.visual-paradigm.com/u/cryptology)\
**Post date:** [October 17, 2018, 7:57am UTC](https://forums.visual-paradigm.com/t/java-annotations-in-class-diagram-and-code-generation/14609/1 "2018-10-17T07:57:51Z")

</div>

Hello. I am modelling a java websocket endpoint in a class diagram. The class and methods need to be decorated with the relevant annotations (i.e. @ServerEndpoint, @OnMessage, etc…).

My questions are:

Is there a way to show the annotations in the class diagram other than using stereotypes?

Is there a way to import the necessary libraries (javax.websocket._, javax.websocket.server._) based on the annotations during code generation?

---

<div class="post-metadata">

**Author:** ![Kit.So](https://forums.visual-paradigm.com/user_avatar/forums.visual-paradigm.com/kit.so/32/3594_2.png) [@Kit.So](https://forums.visual-paradigm.com/u/Kit.So)\
**Post date:** [November 2, 2018, 4:01am UTC](https://forums.visual-paradigm.com/t/java-annotations-in-class-diagram-and-code-generation/14609/2 "2018-11-02T04:01:11Z")

</div>

Hi cryptology,

Sorry that both are not available, you have to generate fully qualified annotation.
