Can Java Annotations help me with this?

前端 未结 7 563
日久生厌
日久生厌 2021-01-13 14:52

I\'m wondering if there is a way to specify that a method gets called in advance of a class method. I know something like this should be posssible, since JUnit has before(),

相关标签:
7条回答
  • 2021-01-13 15:28

    AOP does this with what are known as pointcuts AspectJ might have what you need.

    Simplistically speaking, you would add before advice to your foo() method which would call init()

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