How to specify ClassParser constructor parameter?
I'm trying to use ClassParser to get method parameter names, ClassParser constructor takes class name as parameter for example:
ClassParser parser = new ClassParser("Main.class");
I 'm trying to set the par开发者_运维知识库ameter to String class I 've tried to use "String.class" but it doesn't work. I've also used "java.lang.String.class" but it doesn't work. Finally, I've tried this.getClass().getResource("java/lang/String").toString() but also this doesn't work. How can I solve this?
Thanks
I guess this is BCEL? Then ClassParser does not really take a a class name parameter, but rather an input stream, a file name or a zip file and entry (a.k.a jar file entry). I would expect that
ClassParser parser = new ClassParser("your/package/name/Main.class");
would work, given that your class is not part of a jar file.
精彩评论