protected String precedence = "DEFAULT";
protected int order = 100000;
protected void setPrecedence(Class<?> clazz)
{
Precedence precedence = clazz.getAnnotation(Precedence.class);
if (precedence != null)
{
this.precedence = precedence.value();
Integer o = precedenceOrder.get(this.precedence);
if (o == null) throw new RuntimeException("Unknown interceptor precedence: " + this.precedence);
this.order = o;
}
else
{
for (Annotation annotation : clazz.getAnnotations())
{
precedence = annotation.annotationType().getAnnotation(Precedence.class);
if (precedence != null)
{
this.precedence = precedence.value();
Integer o = precedenceOrder.get(this.precedence);
if (o == null) throw new RuntimeException("Unknown interceptor precedence: " + this.precedence);
this.order = o;
break;
}