Book a Demo

Author Topic: Custom Java Annotations (@interface)  (Read 3084 times)

domi55

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Custom Java Annotations (@interface)
« on: May 18, 2012, 04:16:38 am »
In our java project we use custom annotations. For example:

Code: [Select]
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.FIELD, ElementType.PARAMETER })
public @interface MyAnnotation {
    String value();
    String value2();
    boolean debug() default false;
}

Unfortunately EA is not able to generate the source code properly for custom annotations during forward enginnering. If I use "Synchronize Package with Code" my custom annotations changes to the following:

Code: [Select]
@Retention(RetentionPolicy.RUNTIME)@Target({ ElementType.FIELD, ElementType.PARAMETER })
public interface MyAnnotation {
    String value();
    String value2();
    boolean debug() default false;
}

1. The @ sign before interface gets lost.
2. All Annotations (@Retention and @Target) are now on one line.


So basically the model and the source are never in sync.

Do I miss a setting or is there another workaround? Thanks for help.

UPDATE:

The problem is that the initial stereotype (after reversing) is set to "interface" and not "annotation". Can I change this behaviour somehow?
« Last Edit: May 18, 2012, 05:44:59 am by domi55 »