I
Ian Pilcher
Does anyone know of a simple way to determine whether a marker
annotation is present in a given class file?
TIA
annotation is present in a given class file?
TIA
Ian said:Does anyone know of a simple way to determine whether a marker
annotation is present in a given class file?
Ian Pilcher said:Does anyone know of a simple way to determine whether a marker
annotation is present in a given class file?
TIA
Tony said:Class.isAnnotationPresent
Chris said:BTW, I have just noticed the new "annotations processing tool" (apt)
which is a utility supplied with the 1.5 JDK. I'm not (yet) clear on
what it actually /does/, but then I'm not clear on what the OP /wants/
to do, so it's clearly the right tool for this job ;-)
Ian said:I don't suppose the string munging code is accessible somewhere in the
JDK?
Rather than use reflection, I have created a nested class with package
accessible methods, which can be called by the unit tests. I have
created an annotation (@TestCode) and applied it to this class. Now I
want to create an Ant task to move all class files with the @TestCode
annotation from the ${PROJECT}/bin tree to ${PROJECT}/test/bin.
Chris said:I may be missing something, but wouldn't it be simpler to skip annotations
altogether and always name your nested "backdoor access" classes something like
BackdoorAccessForTests ? Then you could identify the corresponding .class
files easily with any tool.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.