use of app.hongs.action.anno.FilterInvoker in project HongsCORE by ihongs.
the class ActionRunner method doAction.
/**
* 执行动作方法
* 会执行 action 方法上 annotation 指定的过滤器
* @throws HongsException
*/
public void doAction() throws HongsException {
// 如果超出链长度, 则终止执行
if (idx > annarr.length) {
throw new HongsException(0x110f, "Action annotation out of index: " + idx + ">" + annarr.length);
}
// 如果已到达链尾, 则执行动作
if (idx == annarr.length) {
doInvoke();
return;
}
Filter actw;
Annotation anno = annarr[idx++];
if (anno instanceof Filter) {
actw = (Filter) anno;
} else {
actw = anno.annotationType().getAnnotation(Filter.class);
}
// 如果不是动作链, 则跳过注解
if (actw == null) {
doAction();
return;
}
// 执行注解过滤器
Class<? extends FilterInvoker> classo = actw.value();
FilterInvoker filter = Core.getInstance(classo);
filter.invoke(helper, this, anno);
}
Aggregations