List of usage examples for org.springframework.beans.factory.xml ParserContext pushContainingComponent
public void pushContainingComponent(CompositeComponentDefinition containingComponent)
From source file:com.mtgi.analytics.aop.config.v11.BtConfigBeanDefinitionParser.java
public BeanDefinition parse(Element element, ParserContext parserContext) { CompositeComponentDefinition component = new CompositeComponentDefinition(element.getNodeName(), parserContext.extractSource(element)); parserContext.pushContainingComponent(component); try {/*from w ww . java 2 s. co m*/ NodeList children = element.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) parserContext.getDelegate().parseCustomElement((Element) node, null); } //no actual bean generated for bt:config. return null; } finally { parserContext.popAndRegisterContainingComponent(); } }
From source file:org.devefx.httpmapper.spring.config.ListenersBeanDefinitionParser.java
public BeanDefinition parse(Element element, ParserContext parserContext) { CompositeComponentDefinition compDefinition = new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element)); parserContext.pushContainingComponent(compDefinition); RuntimeBeanReference pathMatcherRef = null; if (element.hasAttribute("path-matcher")) { pathMatcherRef = new RuntimeBeanReference(element.getAttribute("path-matcher")); }// w w w.jav a 2 s . c om List<Element> listeners = DomUtils.getChildElementsByTagName(element, "bean", "ref", "listener"); for (Element listener : listeners) { RootBeanDefinition mappedListenerDef = new RootBeanDefinition(MappedListener.class); mappedListenerDef.setSource(parserContext.extractSource(listener)); mappedListenerDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); ManagedList<String> includePatterns = null; ManagedList<String> excludePatterns = null; Object listenerBean; if ("listener".equals(listener.getLocalName())) { includePatterns = getIncludePatterns(listener, "mapping"); excludePatterns = getIncludePatterns(listener, "exclude-mapping"); Element beanElem = DomUtils.getChildElementsByTagName(listener, "bean", "ref").get(0); listenerBean = parserContext.getDelegate().parsePropertySubElement(beanElem, null); } else { listenerBean = parserContext.getDelegate().parsePropertySubElement(listener, null); } mappedListenerDef.getConstructorArgumentValues().addIndexedArgumentValue(0, includePatterns); mappedListenerDef.getConstructorArgumentValues().addIndexedArgumentValue(1, excludePatterns); mappedListenerDef.getConstructorArgumentValues().addIndexedArgumentValue(2, listenerBean); if (pathMatcherRef != null) { mappedListenerDef.getPropertyValues().add("pathMatcher", pathMatcherRef); } String beanName = parserContext.getReaderContext().registerWithGeneratedName(mappedListenerDef); parserContext.registerComponent(new BeanComponentDefinition(mappedListenerDef, beanName)); } parserContext.popAndRegisterContainingComponent(); return null; }
From source file:com.ryantenney.metrics.spring.config.RegisterMetricBeanDefinitionParser.java
@Override public BeanDefinition parse(Element element, ParserContext parserContext) { final CompositeComponentDefinition compDefinition = new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element)); parserContext.pushContainingComponent(compDefinition); final String metricRegistryBeanName = element.getAttribute("metric-registry"); if (!StringUtils.hasText(metricRegistryBeanName)) { throw new RuntimeException(); // TODO }/*w w w .j a v a2s . co m*/ final RuntimeBeanReference metricRegistryBeanRef = new RuntimeBeanReference(metricRegistryBeanName); final List<Element> metricElements = DomUtils.getChildElementsByTagName(element, new String[] { "bean", "ref" }); for (Element metricElement : metricElements) { // Get the name attribute and remove it (to prevent Spring from looking for a BeanDefinitionDecorator) final String name = metricElement.getAttributeNS(METRICS_NAMESPACE, "name"); if (name != null) { metricElement.removeAttributeNS(METRICS_NAMESPACE, "name"); } final Object metric = parserContext.getDelegate().parsePropertySubElement(metricElement, null); final RootBeanDefinition metricRegistererDef = new RootBeanDefinition(MetricRegisterer.class); metricRegistererDef.setSource(parserContext.extractSource(metricElement)); metricRegistererDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); final ConstructorArgumentValues args = metricRegistererDef.getConstructorArgumentValues(); args.addIndexedArgumentValue(0, metricRegistryBeanRef); args.addIndexedArgumentValue(1, name); args.addIndexedArgumentValue(2, metric); final String beanName = parserContext.getReaderContext().registerWithGeneratedName(metricRegistererDef); parserContext.registerComponent(new BeanComponentDefinition(metricRegistererDef, beanName)); } parserContext.popAndRegisterContainingComponent(); return null; }
From source file:com.ryantenney.metrics.spring.config.AnnotationDrivenBeanDefinitionParser.java
@Override public BeanDefinition parse(Element element, ParserContext parserContext) { final Object source = parserContext.extractSource(element); final CompositeComponentDefinition compDefinition = new CompositeComponentDefinition(element.getTagName(), source);//from w w w . ja v a 2 s.com parserContext.pushContainingComponent(compDefinition); String metricsBeanName = element.getAttribute("metric-registry"); if (!StringUtils.hasText(metricsBeanName)) { metricsBeanName = registerComponent(parserContext, build(MetricRegistry.class, source, ROLE_APPLICATION)); } String healthCheckBeanName = element.getAttribute("health-check-registry"); if (!StringUtils.hasText(healthCheckBeanName)) { healthCheckBeanName = registerComponent(parserContext, build(HealthCheckRegistry.class, source, ROLE_APPLICATION)); } final ProxyConfig proxyConfig = new ProxyConfig(); if (StringUtils.hasText(element.getAttribute("expose-proxy"))) { proxyConfig.setExposeProxy(Boolean.valueOf(element.getAttribute("expose-proxy"))); } if (StringUtils.hasText(element.getAttribute("proxy-target-class"))) { proxyConfig.setProxyTargetClass(Boolean.valueOf(element.getAttribute("proxy-target-class"))); } //@formatter:off registerComponent(parserContext, build(MetricsBeanPostProcessorFactory.class, source, ROLE_INFRASTRUCTURE) .setFactoryMethod("exceptionMetered").addConstructorArgReference(metricsBeanName) .addConstructorArgValue(proxyConfig)); registerComponent(parserContext, build(MetricsBeanPostProcessorFactory.class, source, ROLE_INFRASTRUCTURE) .setFactoryMethod("metered").addConstructorArgReference(metricsBeanName) .addConstructorArgValue(proxyConfig)); registerComponent(parserContext, build(MetricsBeanPostProcessorFactory.class, source, ROLE_INFRASTRUCTURE).setFactoryMethod("timed") .addConstructorArgReference(metricsBeanName).addConstructorArgValue(proxyConfig)); registerComponent(parserContext, build(MetricsBeanPostProcessorFactory.class, source, ROLE_INFRASTRUCTURE) .setFactoryMethod("gauge").addConstructorArgReference(metricsBeanName)); registerComponent(parserContext, build(MetricsBeanPostProcessorFactory.class, source, ROLE_INFRASTRUCTURE) .setFactoryMethod("injectMetric").addConstructorArgReference(metricsBeanName)); registerComponent(parserContext, build(MetricsBeanPostProcessorFactory.class, source, ROLE_INFRASTRUCTURE) .setFactoryMethod("healthCheck").addConstructorArgReference(healthCheckBeanName)); //@formatter:on parserContext.popAndRegisterContainingComponent(); return null; }
From source file:de.itsvs.cwtrpc.controller.config.RemoteServiceControllerConfigBeanDefinitionParser.java
public BeanDefinition parse(Element element, ParserContext parserContext) { final CompositeComponentDefinition compositeDef; final BeanDefinitionBuilder bdd; final AbstractBeanDefinition beanDefinition; String id;/*from www . j a v a 2 s . c o m*/ compositeDef = new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element)); parserContext.pushContainingComponent(compositeDef); bdd = BeanDefinitionBuilder.rootBeanDefinition(RemoteServiceControllerConfig.class); bdd.getRawBeanDefinition().setSource(parserContext.extractSource(element)); if (parserContext.isDefaultLazyInit()) { bdd.setLazyInit(true); } bdd.addConstructorArgReference(getSerializationPolicyProviderBeanRef(element, parserContext).getBeanName()); bdd.addPropertyValue("serviceModuleConfigs", parseModules(element, parserContext)); getBaseServiceConfigParser().update(element, parserContext, bdd, RemoteServiceControllerConfig.DEFAULT_RPC_VALIDATOR_SERVICE_NAME); id = element.getAttribute(XmlNames.ID_ATTR); if (!StringUtils.hasText(id)) { id = RemoteServiceControllerConfig.DEFAULT_BEAN_ID; } beanDefinition = bdd.getBeanDefinition(); parserContext.registerBeanComponent(new BeanComponentDefinition(beanDefinition, id)); parserContext.popAndRegisterContainingComponent(); return beanDefinition; }
From source file:com.mtgi.analytics.aop.config.v11.BtManagerBeanDefinitionParser.java
@Override protected void transform(ConfigurableListableBeanFactory factory, BeanDefinition template, Element element, ParserContext parserContext) {// w ww. ja va 2 s. c o m ManagerComponentDefinition def = (ManagerComponentDefinition) parserContext.getContainingComponent(); String managerId = overrideAttribute(ATT_ID, template, element); if (managerId == null) template.setAttribute(ATT_ID, managerId = "defaultTrackingManager"); if ("false".equals(element.getAttribute(ATT_ENABLED))) { //manager is disabled. replace definition with dummy instance. template.setBeanClassName(DisabledBehaviorTrackingManager.class.getName()); //clear properties and attributes. for (String att : template.attributeNames()) if (!ATT_ID.equals(att)) template.removeAttribute(att); template.getPropertyValues().clear(); //terminate immediately, do not parse any nested definitions (persisters, AOP config, context beans, etc) return; } overrideProperty(ATT_APPLICATION, template, element, false); overrideProperty(ATT_FLUSH_THRESHOLD, template, element, false); //wake up MBeanExporter if we're going to be doing MBean registration. if ("true".equalsIgnoreCase(element.getAttribute(ATT_REGISTER_MBEANS))) { AbstractBeanDefinition exporter = (AbstractBeanDefinition) factory .getBeanDefinition(CONFIG_MBEAN_EXPORTER); exporter.setLazyInit(false); //append manager ID to mbean name, in case of multiple managers in a single application. BeanDefinition naming = factory.getBeanDefinition(CONFIG_NAMING_STRATEGY); naming.getPropertyValues().addPropertyValue("value", managerId); } //prefer references to beans in the parent factory if they've been specified if (element.hasAttribute(ATT_MBEAN_SERVER)) factory.registerAlias(element.getAttribute(ATT_MBEAN_SERVER), CONFIG_MBEAN_SERVER); if (element.hasAttribute(ATT_SCHEDULER)) factory.registerAlias(element.getAttribute(ATT_SCHEDULER), CONFIG_SCHEDULER); if (element.hasAttribute(ATT_TASK_EXECUTOR)) factory.registerAlias(element.getAttribute(ATT_TASK_EXECUTOR), CONFIG_EXECUTOR); //make note of external persister element so that we don't activate log rotation. if (element.hasAttribute(ATT_PERSISTER)) { def.addNestedProperty(ATT_PERSISTER); MutablePropertyValues props = template.getPropertyValues(); props.removePropertyValue(ATT_PERSISTER); props.addPropertyValue(ATT_PERSISTER, new RuntimeBeanReference(element.getAttribute(ATT_PERSISTER))); } if (element.hasAttribute(ATT_SESSION_CONTEXT)) { //override default session context with reference def.addNestedProperty("sessionContext"); factory.registerAlias(element.getAttribute(ATT_SESSION_CONTEXT), CONFIG_SESSION_CONTEXT); } //handle AOP configuration if needed if (element.hasAttribute(ATT_METHOD_EXPRESSION)) { //activate global AOP proxying if it hasn't already been done (borrowed logic from AopNamespaceHandler / config element parser) activateAopProxies(parserContext, element); //register pointcut definition for the provided expression. RootBeanDefinition pointcut = new RootBeanDefinition(AspectJExpressionPointcut.class); //rely on deprecated method to maintain spring 2.0 support pointcut.setSingleton(false); pointcut.setSynthetic(true); pointcut.getPropertyValues().addPropertyValue("expression", element.getAttribute(ATT_METHOD_EXPRESSION)); //create implicit pointcut advice bean. RootBeanDefinition advice = new RootBeanDefinition(BehaviorTrackingAdvice.class); advice.getPropertyValues().addPropertyValue("trackingManager", new RuntimeBeanReference(managerId)); //register advice, pointcut, and advisor entry to bind the two together. XmlReaderContext ctx = parserContext.getReaderContext(); String pointcutId = ctx.registerWithGeneratedName(pointcut); String adviceId = ctx.registerWithGeneratedName(advice); RootBeanDefinition advisorDefinition = new RootBeanDefinition(DefaultBeanFactoryPointcutAdvisor.class); advisorDefinition.getPropertyValues().addPropertyValue("adviceBeanName", new RuntimeBeanNameReference(adviceId)); advisorDefinition.getPropertyValues().addPropertyValue("pointcut", new RuntimeBeanReference(pointcutId)); ctx.registerWithGeneratedName(advisorDefinition); } //configure flush trigger and job to be globally unique based on manager name. BeanDefinition flushTrigger = factory.getBeanDefinition("com.mtgi.analytics.btFlushTrigger"); SchedulerActivationPostProcessor.configureTriggerDefinition(flushTrigger, element.getAttribute(ATT_FLUSH_SCHEDULE), managerId + "_flush"); //set up a post-processor to register the flush job with the selected scheduler instance. the job and scheduler //come from the template factory, but the post-processor runs when the currently-parsing factory is finished. SchedulerActivationPostProcessor.registerPostProcessor(parserContext, factory, CONFIG_SCHEDULER, CONFIG_NAMESPACE + ".btFlushTrigger"); //ManagerComponentDefinition is a flag to nested parsers that they should push their parsed bean definitions into //the manager bean definition. for example, see BtPersisterBeanDefinitionParser. //descend on nested child nodes to pick up persister and session context configuration NodeList children = element.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node node = children.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { String namespaceUri = node.getNamespaceURI(); NamespaceHandler handler = parserContext.getReaderContext().getNamespaceHandlerResolver() .resolve(namespaceUri); ParserContext nestedCtx = new ParserContext(parserContext.getReaderContext(), parserContext.getDelegate(), template); nestedCtx.pushContainingComponent(def); handler.parse((Element) node, nestedCtx); } } if (!def.nestedProperties.contains(ATT_PERSISTER)) { //no persister registered. schedule default log rotation trigger. BtXmlPersisterBeanDefinitionParser.configureLogRotation(parserContext, factory, null); } if (!def.nestedProperties.contains("sessionContext")) { //custom session context not registered. select appropriate default class //depending on whether we are in a web context or not. if (parserContext.getReaderContext().getReader().getResourceLoader() instanceof WebApplicationContext) { BeanDefinition scDef = factory.getBeanDefinition(CONFIG_SESSION_CONTEXT); scDef.setBeanClassName(SpringSessionContext.class.getName()); } } }
From source file:be.hikage.springtemplate.ImportTemplateBeanDefinitionParser.java
public BeanDefinition parse(Element element, ParserContext parserContext) { Map<String, String> patternMap = prepareReplacement(element); MappingBeanDefinitionVisitor visitor = new MappingBeanDefinitionVisitor(patternMap); Map<String, BeanDefinition> beansDefinition = loadTemplateBeans(element, visitor); CompositeComponentDefinition def = new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element)); parserContext.pushContainingComponent(def); registerBeans(parserContext, beansDefinition); parserContext.popAndRegisterContainingComponent(); return null;/*w ww . j a v a2 s. c om*/ }
From source file:org.jdal.beans.TableBeanDefinitionParser.java
/** * {@inheritDoc}//from ww w. ja v a 2s .c o m */ @SuppressWarnings("rawtypes") public BeanDefinition parse(Element element, ParserContext parserContext) { // Defaults String entity = null; if (element.hasAttribute(ENTITY)) entity = element.getAttribute(ENTITY); String name = StringUtils.uncapitalize(StringUtils.substringAfterLast(entity, ".")); if (element.hasAttribute(ID)) name = element.getAttribute(ID); parserContext.pushContainingComponent( new CompositeComponentDefinition(name, parserContext.extractSource(element))); // Bean names String tableModelBeanName = name + LIST_TABLE_MODEL_SUFFIX; String tablePanelBeanName = name + TABLE_PANEL_SUFFIX; String pageableTableBeanName = name + PAGEABLE_TABLE_SUFFIX; String dataSource = name + SERVICE_SUFFIX; String paginator = PAGINATOR_VIEW; String editor = name + EDITOR_SUFFIX; String actions = DefaultsBeanDefinitionParser.DEFAULT_TABLE_ACTIONS; String guiFactory = DefaultsBeanDefinitionParser.DEFAULT_GUI_FACTORY; String scope = BeanDefinition.SCOPE_PROTOTYPE; if (element.hasAttribute(SERVICE_ATTRIBUTE)) dataSource = element.getAttribute(SERVICE_ATTRIBUTE); if (element.hasAttribute(PAGINATOR)) paginator = element.getAttribute(PAGINATOR); if (element.hasAttribute(ACTIONS)) actions = element.getAttribute(ACTIONS); if (element.hasAttribute(GUI_FACTORY)) guiFactory = element.getAttribute(GUI_FACTORY); if (element.hasAttribute(EDITOR)) editor = element.getAttribute(EDITOR); if (element.hasAttribute(SCOPE)) scope = element.getAttribute(SCOPE); // create ListTableModel BeanDefinitionBuilder bdb = BeanDefinitionBuilder.genericBeanDefinition(ListTableModel.class); bdb.setScope(scope); bdb.addPropertyValue("modelClass", entity); NodeList nl = element.getElementsByTagNameNS(element.getNamespaceURI(), COLUMNS); if (nl.getLength() > 0) { List columns = parserContext.getDelegate().parseListElement((Element) nl.item(0), bdb.getRawBeanDefinition()); bdb.addPropertyValue(COLUMNS, columns); } registerBeanDefinition(element, parserContext, tableModelBeanName, bdb); // create PageableTable bdb = BeanDefinitionBuilder.genericBeanDefinition(PageableTable.class); bdb.setScope(BeanDefinition.SCOPE_PROTOTYPE); bdb.addPropertyReference(DATA_SOURCE, dataSource); bdb.addPropertyReference(PAGINATOR_VIEW, paginator); bdb.addPropertyReference(TABLE_MODEL, tableModelBeanName); bdb.addPropertyValue(NAME, pageableTableBeanName); if (element.hasAttribute(TABLE_SERVICE)) bdb.addPropertyReference(Conventions.attributeNameToPropertyName(TABLE_SERVICE), element.getAttribute(TABLE_SERVICE)); if (element.hasAttribute(FILTER)) bdb.addPropertyReference(FILTER, element.getAttribute(FILTER)); if (element.hasAttribute(SHOW_MENU)) bdb.addPropertyValue(Conventions.attributeNameToPropertyName(SHOW_MENU), element.getAttribute(SHOW_MENU)); if (element.hasAttribute(MESSAGE_SOURCE)) bdb.addPropertyReference(MESSAGE_SOURCE, element.getAttribute(MESSAGE_SOURCE)); registerBeanDefinition(element, parserContext, pageableTableBeanName, bdb); // create TablePanel String tablePanelClassName = "org.jdal.swing.table.TablePanel"; if (element.hasAttribute(TABLE_PANEL_CLASS)) tablePanelClassName = element.getAttribute(TABLE_PANEL_CLASS); bdb = BeanDefinitionBuilder.genericBeanDefinition(tablePanelClassName); bdb.setScope(BeanDefinition.SCOPE_PROTOTYPE); bdb.addPropertyReference(TABLE, pageableTableBeanName); bdb.addPropertyReference(GUI_FACTORY, guiFactory); bdb.addPropertyValue(EDITOR_NAME, editor); bdb.addPropertyReference(PERSISTENT_SERVICE, dataSource); if (element.hasAttribute(FILTER_VIEW)) bdb.addPropertyReference(Conventions.attributeNameToPropertyName(FILTER_VIEW), element.getAttribute(FILTER_VIEW)); if (!element.hasAttribute(USE_ACTIONS) || "true".equals(element.getAttribute(USE_ACTIONS))) bdb.addPropertyReference(ACTIONS, actions); registerBeanDefinition(element, parserContext, tablePanelBeanName, bdb); parserContext.popAndRegisterContainingComponent(); return null; }
From source file:eap.config.ConfigBeanDefinitionParser.java
public BeanDefinition parse(Element element, ParserContext parserContext) { CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element)); parserContext.pushContainingComponent(compositeDef); configureAutoProxyCreator(parserContext, element); List<Element> childElts = DomUtils.getChildElements(element); for (Element elt : childElts) { String localName = parserContext.getDelegate().getLocalName(elt); if (POINTCUT.equals(localName)) { parsePointcut(elt, parserContext); } else if (ADVISOR.equals(localName)) { parseAdvisor(elt, parserContext); } else if (ASPECT.equals(localName)) { parseAspect(elt, parserContext); }//from w w w. j a v a2s .c o m } parserContext.popAndRegisterContainingComponent(); return null; }
From source file:org.jdal.vaadin.beans.TableBeanDefinitionParser.java
/** * {@inheritDoc}//from www. j av a2s. c o m */ @SuppressWarnings("rawtypes") public BeanDefinition parse(Element element, ParserContext parserContext) { // Defaults String entity = null; if (element.hasAttribute(ENTITY)) entity = element.getAttribute(ENTITY); String name = StringUtils.uncapitalize(StringUtils.substringAfterLast(entity, ".")); if (element.hasAttribute(ID)) name = element.getAttribute(ID); parserContext.pushContainingComponent( new CompositeComponentDefinition(name, parserContext.extractSource(element))); // Bean names String pageableTableBeanName = name + PAGEABLE_TABLE_SUFFIX; String tableBeanName = name + TABLE_SUFFIX; String dataSource = name + SERVICE_SUFFIX; String paginator = PAGINATOR_VIEW; String editor = name + EDITOR_SUFFIX; String actions = DefaultsBeanDefinitionParser.DEFAULT_TABLE_ACTIONS; String guiFactory = DefaultsBeanDefinitionParser.DEFAULT_GUI_FACTORY; String scope = BeanDefinition.SCOPE_PROTOTYPE; String pageableTableClass = DEFAULT_PAGEABLE_TABLE_CLASS; String tableClass = DEFAULT_TABLE_CLASS; if (element.hasAttribute(DATA_SOURCE)) dataSource = element.getAttribute(DATA_SOURCE); if (element.hasAttribute(PAGINATOR)) paginator = element.getAttribute(PAGINATOR); if (element.hasAttribute(ACTIONS)) actions = element.getAttribute(ACTIONS); if (element.hasAttribute(GUI_FACTORY)) guiFactory = element.getAttribute(GUI_FACTORY); if (element.hasAttribute(EDITOR)) editor = element.getAttribute(EDITOR); if (element.hasAttribute(SCOPE)) scope = element.getAttribute(SCOPE); if (element.hasAttribute(PAGEABLE_TABLE_CLASS)) pageableTableClass = element.getAttribute(PAGEABLE_TABLE_CLASS); if (element.hasAttribute(TABLE_CLASS)) tableClass = element.getAttribute(TABLE_CLASS); // create PageableTable BeanDefinitionBuilder bdb = BeanDefinitionBuilder.genericBeanDefinition(pageableTableClass); bdb.setScope(scope); bdb.addPropertyReference(DATA_SOURCE, dataSource); bdb.addPropertyReference(PAGINATOR_VIEW, paginator); bdb.addPropertyValue(NAME, pageableTableBeanName); bdb.addPropertyReference(TABLE, tableBeanName); bdb.addPropertyReference(GUI_FACTORY, guiFactory); bdb.addPropertyValue(EDITOR_NAME, editor); bdb.addPropertyValue(ENTITY_CLASS, entity); BeanDefinitionUtils.addPropertyReferenceIfNeeded(bdb, element, TABLE_SERVICE); BeanDefinitionUtils.addPropertyReferenceIfNeeded(bdb, element, FILTER); BeanDefinitionUtils.addPropertyReferenceIfNeeded(bdb, element, MESSAGE_SOURCE); BeanDefinitionUtils.addPropertyReferenceIfNeeded(bdb, element, FILTER_FORM); BeanDefinitionUtils.addPropertyValueIfNeeded(bdb, element, SORT_PROPERTY); BeanDefinitionUtils.addPropertyValueIfNeeded(bdb, element, ORDER); BeanDefinitionUtils.addPropertyValueIfNeeded(bdb, element, PAGE_SIZE); BeanDefinitionUtils.addPropertyValueIfNeeded(bdb, element, NATIVE_BUTTONS); BeanDefinitionUtils.addPropertyValueIfNeeded(bdb, element, PROPAGATE_SERVICE); if (!element.hasAttribute(USE_ACTIONS) || "true".equals(element.getAttribute(USE_ACTIONS))) bdb.addPropertyReference(ACTIONS, actions); parserContext.getDelegate().parseBeanDefinitionAttributes(element, pageableTableBeanName, null, bdb.getBeanDefinition()); BeanDefinitionHolder holder = new BeanDefinitionHolder(bdb.getBeanDefinition(), pageableTableBeanName); // Test Decorators like aop:scoped-proxy NodeList childNodes = element.getChildNodes(); for (int i = 0; i < childNodes.getLength(); i++) { Node n = childNodes.item(i); if (Node.ELEMENT_NODE != n.getNodeType() || COLUMNS.equals(n.getLocalName())) continue; NamespaceHandler handler = parserContext.getReaderContext().getNamespaceHandlerResolver() .resolve(n.getNamespaceURI()); if (handler != null) { holder = handler.decorate(n, holder, parserContext); } } parserContext.registerBeanComponent(new BeanComponentDefinition(holder)); // create ConfigurableTable bdb = BeanDefinitionBuilder.genericBeanDefinition(tableClass); bdb.setScope(BeanDefinition.SCOPE_PROTOTYPE); BeanDefinitionUtils.addPropertyReferenceIfNeeded(bdb, element, FIELD_FACTORY); BeanDefinitionUtils.addPropertyValueIfNeeded(bdb, element, MULTISELECT); if (element.hasAttribute(SELECTABLE)) { bdb.addPropertyValue(SELECTABLE, element.getAttribute(SELECTABLE)); } else { // set selectable by default bdb.addPropertyValue(SELECTABLE, true); } // parse columns NodeList nl = element.getElementsByTagNameNS(element.getNamespaceURI(), COLUMNS); if (nl.getLength() > 0) { List columns = parserContext.getDelegate().parseListElement((Element) nl.item(0), bdb.getRawBeanDefinition()); bdb.addPropertyValue(COLUMNS, columns); } registerBeanDefinition(element, parserContext, tableBeanName, bdb); parserContext.popAndRegisterContainingComponent(); return null; }