This content has been marked as final. Show 2 replies
Using class loaders and byte code manipulation is one way to make use of annotation.
But you can do a ton of different things with annotations. If you simply want to get some values from the annotations and don't need them to magically influence the behaviour or the annotated object itself, then you don't need to do any class loader magic at all.
A third way is to use apt to react to the presence of an annotation at compilation time, in which case you usually don't need any class loader tricks either.
wellington7 wrote:You need to be a more specific than that. Some are using custom classloaders, but most of them aren't. It all depends on what you want to accomplish.
I was reading about the ClassLoader class, and wondering if the usual way to handle annotations (by frameworks, for example) is by overriding the default class loader.