【发布时间】:2011-12-20 10:57:07
【问题描述】:
我得到了以下方面
@Around("execution(public * (@DisabledForBlockedAccounts *).*(..))" + " && @annotation(denyForTeam)")
public Object translateExceptionsDenySelectedAccount(ProceedingJoinPoint pjp, Deny deny) throws Throwable
{
Account account = (Account) pjp.getArgs()[0];
Account selectedAccount = (Account) pjp.getArgs()[1];
if (ArrayUtils.contains(deny.value(), account.getRole()))
{
if (account.getType().equals(Type.CHEF) && !selectedAccount.getType().equals(Type.CHEF))
{
throw new IllegalAccessException("");
}
}
return pjp.proceed();
}
还有这个注解:
@Target({TYPE, METHOD, FIELD})
@Retention(RUNTIME)
public @interface DenyForTeam
{
Role[] value();
}
我得到错误:错误类型不是注释类型:denyForTeam
为什么 DenyForTeam 没有注释?它用@interface标记
【问题讨论】:
标签: spring aop spring-aop