Interface BeanDefinitionReader
- All Known Implementing Classes:
- AbstractBeanDefinitionReader,- GroovyBeanDefinitionReader,- PropertiesBeanDefinitionReader,- XmlBeanDefinitionReader
Resource and String location parameters.
 Concrete bean definition readers can of course add additional load and register methods for bean definitions, specific to their bean definition format.
Note that a bean definition reader does not have to implement this interface. It only serves as a suggestion for bean definition readers that want to follow standard naming conventions.
- Since:
- 1.1
- Author:
- Juergen Hoeller
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionReturn the class loader to use for bean classes.Return theBeanNameGeneratorto use for anonymous beans (without explicit bean name specified).Return the bean factory to register the bean definitions with.Return theResourceLoaderto use for resource locations.intloadBeanDefinitions(String location) Load bean definitions from the specified resource location.intloadBeanDefinitions(String... locations) Load bean definitions from the specified resource locations.intloadBeanDefinitions(Resource resource) Load bean definitions from the specified resource.intloadBeanDefinitions(Resource... resources) Load bean definitions from the specified resources.
- 
Method Details- 
getRegistryBeanDefinitionRegistry getRegistry()Return the bean factory to register the bean definitions with.The factory is exposed through the BeanDefinitionRegistryinterface, encapsulating the methods that are relevant for bean definition handling.
- 
getResourceLoaderReturn theResourceLoaderto use for resource locations.Can be checked for the ResourcePatternResolverinterface and cast accordingly, for loading multiple resources for a given resource pattern.A nullreturn value suggests that absolute resource loading is not available for this bean definition reader.This is mainly meant to be used for importing further resources from within a bean definition resource, for example via the "import" tag in XML bean definitions. It is recommended, however, to apply such imports relative to the defining resource; only explicit full resource locations will trigger absolute path based resource loading. There is also a loadBeanDefinitions(String)method available, for loading bean definitions from a resource location (or location pattern). This is a convenience to avoid explicitResourceLoaderhandling.
- 
getBeanClassLoaderReturn the class loader to use for bean classes.nullsuggests to not load bean classes eagerly but rather to just register bean definitions with class names, with the corresponding classes to be resolved later (or never).
- 
getBeanNameGeneratorBeanNameGenerator getBeanNameGenerator()Return theBeanNameGeneratorto use for anonymous beans (without explicit bean name specified).
- 
loadBeanDefinitionsLoad bean definitions from the specified resource.- Parameters:
- resource- the resource descriptor
- Returns:
- the number of bean definitions found
- Throws:
- BeanDefinitionStoreException- in case of loading or parsing errors
 
- 
loadBeanDefinitionsLoad bean definitions from the specified resources.- Parameters:
- resources- the resource descriptors
- Returns:
- the number of bean definitions found
- Throws:
- BeanDefinitionStoreException- in case of loading or parsing errors
 
- 
loadBeanDefinitionsLoad bean definitions from the specified resource location.The location can also be a location pattern, provided that the ResourceLoaderof this bean definition reader is aResourcePatternResolver.- Parameters:
- location- the resource location, to be loaded with the- ResourceLoader(or- ResourcePatternResolver) of this bean definition reader
- Returns:
- the number of bean definitions found
- Throws:
- BeanDefinitionStoreException- in case of loading or parsing errors
- See Also:
 
- 
loadBeanDefinitionsLoad bean definitions from the specified resource locations.- Parameters:
- locations- the resource locations, to be loaded with the- ResourceLoader(or- ResourcePatternResolver) of this bean definition reader
- Returns:
- the number of bean definitions found
- Throws:
- BeanDefinitionStoreException- in case of loading or parsing errors
 
 
-