我的界面:
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface LogMethod {
boolean isEnabled() default false;
}
我的长相:
@Aspect
@Component
public class LogMethodAspect {
@Pointcut("@within(com.middleware.internal.aspect.LogMethod) || @annotation(com.middleware.internal.aspect.LogMethod)")
public void loggingPointcut() {
}
@Before("loggingPointcut()")
public Object logBefore(final JoinPoint joinPoint) throws Throwable {
//...
return null;
}
}
有什么方法可以读取logBefore方法中的inEnabled值吗?