Hi Everyone,
I have written a custom annotation which i have included below
I wrote a separate class while uses the above annotation. This class uses two more annotations defined by me, but i have not included them since they have the same structure as the above one except that they are for methods and instance variables.
I have also written a main Class described below
What happens is that my Main class calls the Handler class which handles the annotation in the AnnotationUser class. I have included the handler class below
My concern is this, I have called the Handler class to handle the annotations used by the AnnotationUser from my Main. The point to note here is this:
My handler class has been hardcoded with the Class name that i must check for annotations. I may look it up from a xml property file but i believe it negates the entire use of annotations.What i mean is, i am working on a big project and i have defined custom annotations to be used by my team members. How to automate the handling of those custom annotations that are in my source code(without the program calling the handler and the handler knowing beforehand the classes which uses the annotations)?Is it possible to add these Custom Annotations and their Handlers(defined by me) to the Compiler so that when i compile i dont have to specifically call the handler , rather the compiler will check the files for annotations and call the appropriate annotationhandler(Ex:suppresswarning annotation).
Again sorry for the big
thread, just wanted to make myself clear.