我有下面的注释.
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
}
Run Code Online (Sandbox Code Playgroud)
public class SomeAspect{
@Around("execution(public * *(..)) && @annotation(com.mycompany.MyAnnotation)")
public Object procede(ProceedingJoinPoint call) throws Throwable {
//Some logic
}
}
Run Code Online (Sandbox Code Playgroud)
public class SomeOther{
@MyAnnotation("ABC")
public String someMethod(String name){
}
}
Run Code Online (Sandbox Code Playgroud)
在上面的类中我在@MyAnnotation中传递" ABC " .现在我如何在SomeAspect.java类的procede方法中访问" ABC "值?
谢谢!