ClassPathXmlApplicationContext
and FileSystemXmlApplicationContext, to be configured via setters,
with an eventual refresh() call activating the context.
In case of multiple configuration files, bean definitions in later files will override those defined in earlier files. This can be leveraged to intentionally override certain bean definitions via an extra configuration file appended to the list.
load, XmlBeanDefinitionReader, org.springframework.context.annotation.AnnotationConfigApplicationContext
| Modifier and Type | Field and Description |
|---|---|
| private final XmlBeanDefinitionReader |
| Access | Constructor and Description |
|---|---|
| public | GenericXmlApplicationContext()
Create a new GenericXmlApplicationContext that needs to be
|
| public | GenericXmlApplicationContext(Resource...
the resources to load from resources)Create a new GenericXmlApplicationContext, loading bean definitions from the given resources and automatically refreshing the context. |
| public | GenericXmlApplicationContext(String...
the resources to load from resourceLocations)Create a new GenericXmlApplicationContext, loading bean definitions from the given resource locations and automatically refreshing the context. |
| public | GenericXmlApplicationContext(Class<?>
class whose package will be used as a prefix when
loading each specified resource name relativeClass, String... relatively-qualified names of resources to load resourceNames)Create a new GenericXmlApplicationContext, loading bean definitions from the given resource locations and automatically refreshing the context. |
| Modifier and Type | Method and Description |
|---|---|
| public final XmlBeanDefinitionReader | getReader()
Exposes the underlying |
| public void | |
| public void | |
| public void | |
| public void | setEnvironment(ConfigurableEnvironment
the new environment environment)Overrides org. Implements org. XmlBeanDefinitionReader.
|
| public void |
| reader | back to summary |
|---|---|
| private final XmlBeanDefinitionReader reader | |
| GenericXmlApplicationContext | back to summary |
|---|---|
| public GenericXmlApplicationContext() Create a new GenericXmlApplicationContext that needs to be
| |
| GenericXmlApplicationContext | back to summary |
|---|---|
| public GenericXmlApplicationContext(Resource... resources) Create a new GenericXmlApplicationContext, loading bean definitions from the given resources and automatically refreshing the context.
| |
| GenericXmlApplicationContext | back to summary |
|---|---|
| public GenericXmlApplicationContext(String... resourceLocations) Create a new GenericXmlApplicationContext, loading bean definitions from the given resource locations and automatically refreshing the context.
| |
| GenericXmlApplicationContext | back to summary |
|---|---|
| public GenericXmlApplicationContext(Class<?> relativeClass, String... resourceNames) Create a new GenericXmlApplicationContext, loading bean definitions from the given resource locations and automatically refreshing the context. | |
| getReader | back to summary |
|---|---|
| public final XmlBeanDefinitionReader getReader() Exposes the underlying | |
| load | back to summary |
|---|---|
| public void load(Resource... resources) Load bean definitions from the given XML resources.
| |
| load | back to summary |
|---|---|
| public void load(String... resourceLocations) Load bean definitions from the given XML resources.
| |
| load | back to summary |
|---|---|
| public void load(Class<?> relativeClass, String... resourceNames) Load bean definitions from the given XML resources. | |
| setEnvironment | back to summary |
|---|---|
| public void setEnvironment(ConfigurableEnvironment environment) Overrides org. Implements org. Delegates the given environment to underlying
| |
| setValidating | back to summary |
|---|---|
| public void setValidating(boolean validating) Set whether to use XML validation. Default is | |