[jboss-user] [Javassist] New message: "How to get the values of annotation's members?"
Cristiano Gavião
do-not-reply at jboss.com
Thu Feb 18 20:46:00 EST 2010
User development,
A new message was posted in the thread "How to get the values of annotation's members?":
http://community.jboss.org/message/527159#527159
Author : Cristiano Gavião
Profile : http://community.jboss.org/people/cvgaviao
Message:
--------------------------------------------------------------
Hi people,
I'm trying to learn to use javassist and I need some help with my study.
I want first to get all annotations used from one class and its hierarchy (recursively until Object class) . Second, to create a Map<String, List<?>> for each annotation founded and get all annotation's members and its values for each class. And third, to merge all annotation's member whose types are array.
Well I could do the first part, but I've no lock on the second one. I couldn't found a way to get the members real values...
I've used these method:
{code}
...
for (javassist.bytecode.annotation.Annotation testAnnotation : annotations) {
..
Set<String> memberNames = testAnnotation.getMemberNames();
for (String memberName : memberNames) {
MemberValue value = testAnnotation.getMemberValue(memberNames);
Class[] myRelatedClasses = value.???
...
}
{code}
But I couldn't see any method on MemberValue that I could use to get the value. Actualy there is a method, but not public...
Could someone give a clue how could I do that?
thanks
Cristiano
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/527159#527159
More information about the jboss-user
mailing list