File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@interface inheritance

 
Philip Pomario
Ranch Hand
Posts: 113
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why isn't it possible to extend custom annotations... ?

the following example does not compile:
@interface Base {}
@interface Derived extends Base {}
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The specification doesn't allow it.
JLS3 wrote:
No extends clause is permitted. (Annotation types implicitly extend annotation.Annotation.)

Maybe the rationale behind this can be found somewhere in the discussions leading up to the specification in JSR175.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic