Meta ‘Inherited’ Annotation

This is a bit of a complex annotation type. It indicates that the annotated class with this type is automatically inherited. More specifically, if you define an annotation with the @Inherited tag, then annotate a class with your annotation, and finally extend the class in a subclass, all properties of the parent class will be inherited into its subclass.

 

 

We just need to use custom annotation to be used, instead of full traditional style of “implements interface”.

 

 

If annotation is not there then we could have written the boilerplate code with “implements” keyword. 

 

 

Don’t you feel that Annotation based programming is more better to standardize your codebase?

 

@Annotations

  1. Annotations and Its Benefits in Java
  2. Advantages Of Annotations Over XML
  3. Annotation Programming Basics
  4. Annotation Types
    1. Simple Annotation
    2. Meta Annotation
      1. Meta ‘Target’ Annotation
      2. Meta ‘Retention’ Annotation
      3. Meta ‘Documented’ Annotation
      4. Meta ‘Inherited’ Annotation
  5. Reflection to Extract Annotation Details

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.