I am learning Java annotations and I want to design a annotation like @NotNull which enforces compiler to throw an error on following:
@NotNull
private String myVar = null;
Now, I am not getting any lead in what to write in the body of the annotation:
@interface NotNull{
// what goes here
}
Can I design such a functionality using Annotations or I have read it all wrong? I am looking at the checker package and it contains one such annotation.