Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
考虑这种方法:
@Access(rights = GUEST) public void foo() { doSomething(); }
如果方法具有@Access注释,则此切入点基本匹配:
@Access
pointcut check() : execution(@Access * *(..));
但是我怎样才能访问rights存储特定访问级别的@Access 字段,以便我可以使用它呢?
rights
尝试使用:
pointcut check(Access access) : execution(@Access * *(..)) && @annotation(access);
请参阅此处的文档。