I'm trying to force class SomeImpl to declare an annotation @SomeAnnotation if it is implementing interface SomeInterface. Solution can modify SomeInterface declaration.
public interface SomeInterface {}
public class SomeImpl implements SomeInterface -> compilation error
@SomeAnnotation
public class SomeInterfaceImpl implements SomeInterface -> compilation ok
Use case: I'm using objects implementing SomeInterface in a method (not written by me, it's an external library) that always read the annotation @SomeAnnotation and it can not be empty or default.
Thanks!