/** * Global Filters apply to all classes * @param clazz The class to use as a filter * @param globalFilterAnn The filter annotation * @param container The IoC container to configure * @throws InstantiationException In case we can't create the given clazz * @throws IllegalAccessException In case we can't create the given clazz */ protected void processGlobalFilter(Class<?> clazz, GlobalFilter globalFilterAnn, Container container) throws InstantiationException, IllegalAccessException { if (!AjaxFilter.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException(clazz.getName() + " is not an AjaxFilter implementation"); } Map<String, String> filterParams = getParamsMap(globalFilterAnn.params()); AjaxFilter filter = (AjaxFilter) clazz.newInstance(); if (filter != null) { LocalUtil.setParams(filter, filterParams, null); AjaxFilterManager filterManager = container.getBean(AjaxFilterManager.class); filterManager.addAjaxFilter(filter); } }
Map<String, String> params = getParamsMap(convertAnn.params()); if (LocalUtil.hasText(convertAnn.javascript()))
params.putAll(getParamsMap(createAnn.creatorParams())); if (createAnn.name() != null && !createAnn.name().equals(""))
/** * Process the @Filter annotation * @param filterAnn The filter annotation * @param name The Javascript name of the class to filter * @param container The IoC container to configure */ protected void processFilter(Filter filterAnn, String name, Container container) { Map<String, String> filterParams = getParamsMap(filterAnn.params()); AjaxFilter filter = LocalUtil.classNewInstance(name, filterAnn.type().getName(), AjaxFilter.class); if (filter != null) { LocalUtil.setParams(filter, filterParams, null); AjaxFilterManager filterManager = container.getBean(AjaxFilterManager.class); filterManager.addAjaxFilter(filter, name); } }