Spring Framework BeanDefinitionRegistry - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework BeanDefinitionRegistry class.

This code example shows how to use the following methods:registerBeanDefinition
This code example shows how to use the following methods:getBeanDefinitionCount
This code example shows how to use the following methods:getBeanDefinitionCount
	 */ 
	@SuppressWarnings("deprecation") 
	public int registerBeanDefinitions(Document doc, Resource resource) throws BeanDefinitionStoreException {
		BeanDefinitionDocumentReader documentReader = createBeanDefinitionDocumentReader();
		documentReader.setEnvironment(getEnvironment());
		int countBefore = getRegistry().getBeanDefinitionCount();
		documentReader.registerBeanDefinitions(doc, createReaderContext(resource));
		return getRegistry().getBeanDefinitionCount() - countBefore;
	} 
 
	/** 
	 * Create the {@link BeanDefinitionDocumentReader} to use for actually 
	 * reading bean definitions from an XML document. 
	 * <p>The default implementation instantiates the specified "documentReaderClass". 
	 * @see #setDocumentReaderClass 
	 */ 
	protected BeanDefinitionDocumentReader createBeanDefinitionDocumentReader() {
		return BeanDefinitionDocumentReader.class.cast(BeanUtils.instantiateClass(this.documentReaderClass));
	} 
 
4
CodeRank
See Code Examples for Spring Framework BeanDefinitionRegistry Methods: