最佳答案
Java annotations are marked with a @Target
annotation to declare possible joinpoints which can be decorated by that annotation. Values TYPE
, FIELD
, METHOD
, etc. of the ElementType
enum are clear and simply understandable.
WHY to use @Target(ANNOTATION_TYPE)
value? What are the annotated annotations good for? What is their contribution? Give me an explanation of an idea how it works and why I should use it. Some already existing and well-known example of its usage would be great too.