Aop/AspectJ

来源:互联网 发布:arttemplate 遍历数组 编辑:程序博客网 时间:2024/06/08 18:08

捕获构造函数连接点

pointcut myClassConstructorPointcut() : call(MyClass.new(int,String));
//构造函数之前
before() : myClassConstructorPointcut()
{
}
//构造函数之后
after() : myClassConstructorPointcut()
{
}

捕获对象属性连接点

public pointcut getNamePointcut() : get(String Hello.name);
//构造函数之前
before() : getNamePointcut()
{
}
//构造函数之后
after() : getNamePointcut()
{
}

访问程序中的常量

public pointcut getConstantPointcunt() : get(public static final String Hello.CONSTANT);

0 0
原创粉丝点击