I want to use aspectj aop in kotlin, here is my code:
my annotation in annotation.lazy_list:
Kotlin:
package anotation
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.FUNCTION)
annotation class lazy_list
my aspectj aop class:
@Aspect
class ActiveListAop{
@Pointcut("execution(@annotation.lazy_list * *(..))")
fun profile() {
}
@Before("profile()")
fun testModeOnly(joinPoint: JoinPoint) {
println("123")
}
}
my use:
@lazy_list
fun all():List<T>{
return lazy_obj?.all() as List<T>
}
when I call the all () function, there is no error, but I do not print "123", why?
source
share