Is it possible to force (at compile-time) an annotated Class to have a an annotated Field?
I have this annotations:
@Target(value = ElementType.TYPE)
@interface MyClass {}
@Target(value = ElementType.FIELD)
@interface MyField {}
and now I would like that the compilation of a Class like this fails:
@MyClass
class Customer {
}
whereas this should work:
@MyClass
class Customer {
@MyField
String text;
}