Java – Comments for calling methods

I'll start with a piece of code

class Clazz {

    public void doSomething() {
        ...
        check();
    }

    public void doSomethingElse() {
        ...
        check();
    }

    ... // etc.,these methods look basically the same - they all call check() at the end
}

Is it possible to annotate methods like @Checked that will lead to the last call to check ()? If so, can you provide some examples?

Solution

Yes – possible You need to examine the code, usually using aspects (AOP) If you want to see what it looks like, please check this example

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>