I was wondering if it is possible to add an annotation to a Java class based on a condition.
For example, suppose I have two standard classes (Foo
and Bar
) and an abstract one (AbstractGeneric
). Can I add an annotation to AbstractGeneric
just if Foo
extends it?
I searched and just found some people suggesting using Adapter, but I never used it. If it is possible, could someone give me a simple example on how to implement that?