ary*_*axt 5 java android annotations interception
有没有一种简单的方法来拦截java中的方法.我需要为所需的方法添加一个注释,以便在通过该方法之前调用一段逻辑.
public void verifyActivity() {
// Asset if you are on a wrong page
}
@VerifyActivity
public void testLogin() {
// Login for my automate test
}
@VerifyActivity
public void testSomethingElse() {
// Test some other UI Automation stuff
}
Run Code Online (Sandbox Code Playgroud)
编辑:
Android应用程序推荐的guice库不包含AOP.是否可以在不添加任何库的情况下使用反射实现此目的?
Guice 提供了实现注释的简单方法。看一下这个。
http://code.google.com/p/google-guice/wiki/AOP
http://code.google.com/p/google-guice/
归档时间: |
|
查看次数: |
1731 次 |
最近记录: |