/** * 增加Action类,已有的Action类将被覆盖<br> * 自动读取Route的注解来获得Path路径 * * @param action 带注解的Action对象 */ public static void setAction(Action action) { final Route route = action.getClass().getAnnotation(Route.class); if (route != null) { final String path = route.value(); if (StrUtil.isNotBlank(path)) { setAction(path, action); return; } } throw new ServerSettingException( "Can not find Route annotation,please add annotation to Action class!"); }