This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Bill Shirley
Ranch Hand
Joined: Nov 08, 2007
Posts: 457
posted
0
Originally posted by Anoop Krishnan: ...
the annotation is not present on the class (enum Numbers)
it's still not present on the class,
[B]
should return true, [/B] [ January 03, 2008: Message edited by: Bill Shirley ] [ January 03, 2008: Message edited by: Bill Shirley ]
Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Anoop Krishnan
Ranch Hand
Joined: May 03, 2001
Posts: 163
posted
0
Dear Friends
Thank you for your updates.
I am aware of the solutions which you suggested but my real problem is much more complex and I just explained it with a simple example
I want to find out why is it not possible to get the Annotation via reflection I am sure that I am doing something wrong otherwise it should work.
Java doc for Annotation Target says ElementType.FIELD can be applied to Enum constants
Well Bill already gave you the answer. The annotation is not for the class, so of course you can't get it through the class. It is for the enum constants which are in fact special kinds of fields.
To make it a bit more generic:
An enum constant's toString returns the name of the constant, so this code should work also for TWO and THREE.
Anoop Krishnan
Ranch Hand
Joined: May 03, 2001
Posts: 163
posted
0
Thank you Bill Shirley
It works now
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.