What's the point of package annotations?

前端 未结 6 2110
慢半拍i
慢半拍i 2020-12-08 13:35

I understand the purpose of class annotations, thanks to How and where are Annotations used in Java?. What is the purpose of package annotations, as described in this blog p

6条回答
  •  孤城傲影
    2020-12-08 13:54

    Two reasons that I can think of:

    • Annotating special packages to let some aspects (for example using AspectJ) to weave the classes in them for specific functionality.
    • Annotating some packages that are to be read by some tools, for example for source, meta-data or other kinds of resource generation.

提交回复
热议问题