我是从AOP开始的。我希望在以#34; start"开头的MainMenuActivity类的每个方法之前执行beforeStart()
。像这样:
@Before("call(void " + packaging + "MainMenuActivity.startCrearParte())" +
" || call(void" + packaging + "MainMenuActivity.startAsignar())" +
" || call(void" + packaging + "MainMenuActivity.startCargaTrabajo())" +
" || call(void" + packaging + "MainMenuActivity.startAsignados())" +
" || call(void" + packaging + "MainMenuActivity.startFinalizadosNoEnv())" +
" || call(void" + packaging + "MainMenuActivity.startSincronizar())"
)
public void beforeStart() {
//DO SOMETHING
}
我可以使用正则表达式吗?谢谢!
答案 0 :(得分:0)
您可以使用通配符:
@Before("call(void " + packaging + "MainMenuActivity.start*())")
请参阅http://www.eclipse.org/aspectj/doc/released/progguide/semantics-pointcuts.html