4
我有以下看點錯誤類型所指的,不是註釋類型:
@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
非常感謝! – 2011-12-20 11:11:21
您能否請您將答案標記爲已接受。 – gkamal 2011-12-20 11:17:44
註解名稱區分大小寫@annotation(DenyForTeam)不起作用。它應該是@annotation(denyForTeam) – Chandru 2016-12-21 16:39:41