Java Inherited Annotations Tutorial
The open-source library of inherited annotations is for Java-developers solving the annotation inheritance task. The annotations being inherited are of classes, interfaces, or their methods. It uses the consistent inheritance model: inheritance proceeds only if the same annotation is not present on the same element (class, interface or method) within superclasses or superinterfaces. Annotations can be overridden within descendants. The library is open-source and free, with no restriction for commercial application.
This example contains two kinds of annotations: the annotation @A for types, and the annotation @B for methods. The annotations were used for describing one superclass and one superinterface. There was a derived class created which is inherited from the superclass and superinterface. According to Java annotation practice, neither derived class nor its methods inherit annotations defined in the superclass and superinterface. Therefore the following code returns null in both cases.
Get pdf download Java Inherited Annotations Tutorial
Related Tutorial
Tags: class interface, commercial application, descendants, element class, inheritance, java developers, open source library, proceeds, restriction, superclass, two kinds
Comments
Leave a Reply