Java Meta Annotations at Runtime -


i have java meta annotation such

@retention(value = retentionpolicy.runtime) @target(value = { elementtype.annotation_type }) public @interface qualifier { } 

i have annotation:

@qualifier @retention(value = retentionpolicy.runtime) @target(value = { elementtype.type }) public @interface leafentity {    string name() default ""; } 

at runtime can extract leafentity annotation using

getclass().getannotation(leafentity.class); 

however, know if possible access qualifier? mean purpose of annotations on annotations if can't access them?

i have tried of following:

getclass().getannotation(qualifier.class); getclass().getannotation(leafentity.class).getclass().getannotation(qualifier.class); getclass().getannotation(leafentity.class) instanceof qualifier.class; 

if knows how access qualifier annotation appreciate example..

the reason important have base annotation called qualifier. allow users define annotation applying qualifier annotation it. scan class annotation annotated qualifier annotation. that's impossible if can't access or identify qualifier annotations.

thanks in advance.

did try:

getclass().getannotation(leafentity.class).annotationtype().getannotation(qualifier.class); 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -