how can i trigger my custom annotation when method called?

前端 未结 1 1755
误落风尘
误落风尘 2021-01-21 04:59

I want to write my own Secure module library for web but i not solution somethings. Example; I have a class and have a method. Method have my custom annotation.

         


        
1条回答
  •  说谎
    说谎 (楼主)
    2021-01-21 05:31

    Annotations are not "triggered"... you have to write code that looks for their presence and takes action.

    The "code" can either be executed at runtime, but is more commonly executed at compile time using the Annotation Processing Tool to alter the source to inject extra, typically cross-cutting, code appropriate for the annotation.

    0 讨论(0)
提交回复
热议问题