BeanDefinitionReader interface.
Provides common properties like the bean factory to work on and the class loader to use for loading bean classes.
BeanDefinitionReaderUtils
| Modifier and Type | Field and Description |
|---|---|
| private ClassLoader | |
| private BeanNameGenerator | |
| private Environment | |
| protected final Log | logger
Logger available to subclasses. |
| private final BeanDefinitionRegistry | |
| private ResourceLoader |
| Access | Constructor and Description |
|---|---|
| protected | AbstractBeanDefinitionReader(BeanDefinitionRegistry
the BeanFactory to load bean definitions into,
in the form of a BeanDefinitionRegistry registry)Create a new AbstractBeanDefinitionReader for the given bean factory. |
| Modifier and Type | Method and Description |
|---|---|
| public ClassLoader | getBeanClassLoader()
Implements org. Return the class loader to use for bean classes. |
| public BeanNameGenerator | getBeanNameGenerator()
Implements org. Return the |
| public Environment | getEnvironment()
Implements org. Return the |
| public final BeanDefinitionRegistry | getRegistry()
Implements org. Return the bean factory to register the bean definitions with. |
| public ResourceLoader | getResourceLoader()
Implements org. Return the |
| public int | loadBeanDefinitions(Resource...
the resource descriptors resources)Implements org. Load bean definitions from the specified resources. |
| public int | loadBeanDefinitions(String
the resource location, to be loaded with the location)ResourceLoader
(or ResourcePatternResolver) of this bean definition readerImplements org. Load bean definitions from the specified resource location. |
| public int | Returns: the number of bean definitions foundthe resource location, to be loaded with the ResourceLoader
(or ResourcePatternResolver) of this bean definition reader location, Set<Resource> a Set to be filled with the actual Resource objects
that have been resolved during the loading process. May be actualResources)null
to indicate that the caller is not interested in those Resource objects.Load bean definitions from the specified resource location. |
| public int | loadBeanDefinitions(String...
the resource locations, to be loaded with the locations)ResourceLoader
(or ResourcePatternResolver) of this bean definition readerImplements org. Load bean definitions from the specified resource locations. |
| public void | |
| public void | setBeanNameGenerator(BeanNameGenerator beanNameGenerator)
Set the BeanNameGenerator to use for anonymous beans (without explicit bean name specified). |
| public void | |
| public void | setResourceLoader(ResourceLoader resourceLoader)
Set the ResourceLoader to use for resource locations. |
| beanClassLoader | back to summary |
|---|---|
| private ClassLoader beanClassLoader
| |
| beanNameGenerator | back to summary |
|---|---|
| private BeanNameGenerator beanNameGenerator | |
| environment | back to summary |
|---|---|
| private Environment environment | |
| logger | back to summary |
|---|---|
| protected final Log logger Logger available to subclasses. | |
| registry | back to summary |
|---|---|
| private final BeanDefinitionRegistry registry | |
| resourceLoader | back to summary |
|---|---|
| private ResourceLoader resourceLoader
| |
| AbstractBeanDefinitionReader | back to summary |
|---|---|
| protected AbstractBeanDefinitionReader(BeanDefinitionRegistry registry) Create a new AbstractBeanDefinitionReader for the given bean factory. If the passed-in bean factory does not only implement the BeanDefinitionRegistry
interface but also the ResourceLoader interface, it will be used as default
ResourceLoader as well. This will usually be the case for
If given a plain BeanDefinitionRegistry, the default ResourceLoader will be a
If the passed-in bean factory also implements
| |
| getBeanClassLoader | back to summary |
|---|---|
| public ClassLoader getBeanClassLoader() Implements org. Doc from org. Return the class loader to use for bean classes.
| |
| getBeanNameGenerator | back to summary |
|---|---|
| public BeanNameGenerator getBeanNameGenerator() Implements org. Doc from org. Return the
| |
| getEnvironment | back to summary |
|---|---|
| public Environment getEnvironment() Implements org. Doc from org. Return the
| |
| getRegistry | back to summary |
|---|---|
| public final BeanDefinitionRegistry getRegistry() Implements org. Doc from org. Return the bean factory to register the bean definitions with. The factory is exposed through the
| |
| getResourceLoader | back to summary |
|---|---|
| public ResourceLoader getResourceLoader() Implements org. Doc from org. Return the Can be checked for the A 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 | back to summary |
|---|---|
| public int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStoreException Implements org. Doc from org. Load bean definitions from the specified resources.
| |
| loadBeanDefinitions | back to summary |
|---|---|
| public int loadBeanDefinitions(String location) throws BeanDefinitionStoreException Implements org. Doc from org. Load bean definitions from the specified resource location. The location can also be a location pattern, provided that the
| |
| loadBeanDefinitions | back to summary |
|---|---|
| public int loadBeanDefinitions(String location, Set<Resource> actualResources) throws BeanDefinitionStoreException Load bean definitions from the specified resource location. The location can also be a location pattern, provided that the ResourceLoader of this bean definition reader is a ResourcePatternResolver.
| |
| loadBeanDefinitions | back to summary |
|---|---|
| public int loadBeanDefinitions(String... locations) throws BeanDefinitionStoreException Implements org. Doc from org. Load bean definitions from the specified resource locations.
| |
| setBeanClassLoader | back to summary |
|---|---|
| public void setBeanClassLoader(ClassLoader beanClassLoader) Set the ClassLoader to use for bean classes. Default is
| |
| setBeanNameGenerator | back to summary |
|---|---|
| public void setBeanNameGenerator(BeanNameGenerator beanNameGenerator) Set the BeanNameGenerator to use for anonymous beans (without explicit bean name specified). Default is a | |
| setEnvironment | back to summary |
|---|---|
| public void setEnvironment(Environment environment) Set the Environment to use when reading bean definitions. Most often used for evaluating profile information to determine which bean definitions should be read and which should be omitted. | |
| setResourceLoader | back to summary |
|---|---|
| public void setResourceLoader(ResourceLoader resourceLoader) Set the ResourceLoader to use for resource locations. If specifying a ResourcePatternResolver, the bean definition reader will be capable of resolving resource patterns to Resource arrays. Default is PathMatchingResourcePatternResolver, also capable of resource pattern resolving through the ResourcePatternResolver interface. Setting this to | |