Java Custom Annotations - Read using Reflection API

After reading this article , you will be able to create an Annotation in Java and Read the annotations using Java Reflection API.

Java Annotations can be created as follows :

Custom Annotations Example :


Contents at glance - Custom Annotation for methods - Custom Annotation for Class - Class having methods annotated with custom annotations - Read annotation using Java Reflection API


Class : MyClassWithAnnotations , rootPath = /employee
method : getName , path : /getname , returnType = json
method : getResourceType , path : /getResourceType , returnType = text


References :



Submit a Comment

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">