For example if I have annotation @MyOwnAnnotation and have these classes in my classpath, so that I could scan classpath possibly with some kind of filter (example. scan only packages starting with my.own.app.*) and get list of all classes with annotation @MyOwnAnnotation? I’m using guice as injection framework and I don’t use Spring.
For example if I have annotation @MyOwnAnnotation and have these classes in my classpath,
Share
Yes, check out the Scannotation library.
Also, see the following blog post that documents use of Scannotation.
Basic example:
Your annotations will need to have ‘runtime’ retention so that they are available in the
.classfile at runtime.