wood burning stoves 2.0*
The moose likes Java in General and the fly likes @interface inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "@interface inheritance" Watch "@interface inheritance" New topic
Author

@interface inheritance

Philip Pomario
Ranch Hand

Joined: Oct 03, 2003
Posts: 113
Why isn't it possible to extend custom annotations... ?

the following example does not compile:
@interface Base {}
@interface Derived extends Base {}
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1753
    
    7

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.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @interface inheritance
 
Similar Threads
WA #1.....word association
serialization question
WA #2 ..... word association
interfaces and subclasses
apache in "org.apache.jsp"