For code snippets like:
@Value("classpath:somefile.txt")
private Resource myFile;
a validation could run to make sure that - if the @Value annotation points to a resource (e.g. classpath: in this case), that the type if the annotated element (field, parameter) is of type Resource. Otherwise, this might lead to unwanted behavior. E.g. if the type if the field is String, the name of the resource is being injected instead of the content of the file.