• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Himai Minh

annotating annotations

Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a special situation where I have to annotate an existing annotation:

I am some annotations written by thirdparty:


I am writing new annotations where one of the parameter is the above annotations.

So the new annotation would look like

@newannot(param1="value1", param2=@annot1)

I want to pass any of the above 5 annotations in param2.

But the declaration is not allowing me to do that.

public @interface newannot {
String param1();
Annotation param2(); // This is not allowed.

So I am forced to declare it as :

public @interface newannot {
String param1();
annot1 param2();

This way I have to write 5 new annotations.

Is there a way to achieve this using only one annotation.
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic