Home Press Releases Java Inherited Annotations ...

Press Releases by WebKnowHow


Java Inherited Annotations


Fusionsoft are pleases to announce the new product which is intended for Java developers: the Library of Inherited Java Annotations.

May 30, 2007; 05:44 AM

Fusionsoft are pleases to announce the new product which is intended for Java developers: the Library of Inherited Java Annotations.

Fully functional annotations are available in Java starting from SDK version 1.5. Now one can create a meta-description for classes and use it in a program code. Annotations are used in different aspects of program creation and mainly valuable as a mean for declarative description of program behavior. Java API allows getting access to annotations in run-time and reacting to them in one way or another. Meta-information, if it used correctly, improves readability and stability of a Java code.

Unfortunately, there are some situations when usage of annotations is difficult or impossible. For instance, the mechanism of java annotations doesn't provide annotation inheritance. If you have an annotated class or interface you can't get its annotations in a derived class. The same problem exists for methods of classes and interfaces. According to the Java annotation practice, neither derived class nor its methods inherit annotations defined in superclasses and superinterfaces.

Another way to solve this problem is using the meta-annotation @Inherited meaning that the annotation is inherited to derived classes, but the meta-annotation @Inherited is applicable to classes or interfaces only and can be useless in some cases.

This restriction is especially critical if some wrappers for Java classes are used with no way to add annotations manually to it.

If you have a purpose to inherit annotations declared for interfaces, classes and their methods, the library of inherited Java annotations is for you.

The library eliminates the restrictions of standard Java annotations and allows:

  • inheriting annotations declared for classes and interfaces;

  • inheriting annotations declared for methods;

  • overriding annotations in descendant.

 

Access to inherited annotations is identical to the standard one, but the special classes from the library are used along with Java API classes. The consistent inheritance model is used: inheritance proceeds only if the same annotation is not present on the same element (class, interface or method) within superclasses or superinterfaces. The lazy-initialization pattern is used here to cache annotations: annotations are cached only when requested for the first time.

The library is open-source and free, with no restriction for commercial application.

More detailed information and library are available on Fusionsoft official site: http://www.fusionsoft-online.com/annotation.php. We welcome you opinions and suggestions. Send e-mail today at: [email protected].

Contacts:

Michael Milonov (Deputy Director): [email protected]


Phone: +79103506044

Address: 67, May 9th St., Lipetsk 398017 Russian Federation

[email protected]

Advertisement

Partners

Related Resources

Other Resources