Is it possible to instantiate a Java Annotation given a Class<? extends Annotation>?

Posted by Steve on Stack Overflow See other posts from Stack Overflow or by Steve
Published on 2010-05-07T04:53:34Z Indexed on 2010/05/07 4:58 UTC
Read the original article Hit count: 219

Filed under:
|
|

I have a Class<? extends Annotation> and tried calling newInstance() but Java yelled at me for the obvious reason that I can't instantiate an interface. But I know frameworks like EasyMock are perfectly capable of instantiating interfaces. What would it take to get a completely dumb Annotation instance out of my Class?

© Stack Overflow or respective owner

Related posts about java

Related posts about annotations