org.springframework.context.ApplicationContext implementation
which supports programmatic registration of beans and messages,
rather than reading bean definitions from external configuration sources.
Mainly useful for testing.
registerSingleton, registerPrototype, registerBeanDefinition, refresh
| Modifier and Type | Field and Description |
|---|---|
| private final StaticMessageSource |
| Access | Constructor and Description |
|---|---|
| public | |
| public | StaticApplicationContext(ApplicationContext parent)
Create a new StaticApplicationContext with the given parent. |
| Modifier and Type | Method and Description |
|---|---|
| public void | addMessage(String
lookup code code, Locale the locale message should be found within locale, String message associated with this lookup code defaultMessage)Associate the given message with the given code. |
| protected void | assertBeanFactoryActive()
Overrides org. Overridden to turn it into a no-op, to be more lenient towards test cases. |
| public final StaticMessageSource | |
| public void | registerPrototype(String name, Class<?> clazz)
Register a prototype bean with the underlying bean factory. |
| public void | registerPrototype(String name, Class<?> clazz, MutablePropertyValues pvs)
Register a prototype bean with the underlying bean factory. |
| public void | registerSingleton(String name, Class<?> clazz)
Register a singleton bean with the underlying bean factory. |
| public void | registerSingleton(String name, Class<?> clazz, MutablePropertyValues pvs)
Register a singleton bean with the underlying bean factory. |
| staticMessageSource | back to summary |
|---|---|
| private final StaticMessageSource staticMessageSource | |
| StaticApplicationContext | back to summary |
|---|---|
| public StaticApplicationContext() throws BeansException Create a new StaticApplicationContext. | |
| StaticApplicationContext | back to summary |
|---|---|
| public StaticApplicationContext(ApplicationContext parent) throws BeansException Create a new StaticApplicationContext with the given parent. | |
| addMessage | back to summary |
|---|---|
| public void addMessage(String code, Locale locale, String defaultMessage) Associate the given message with the given code.
| |
| assertBeanFactoryActive | back to summary |
|---|---|
| protected void assertBeanFactoryActive() Overrides org. Overridden to turn it into a no-op, to be more lenient towards test cases.
| |
| getStaticMessageSource | back to summary |
|---|---|
| public final StaticMessageSource getStaticMessageSource() Return the internal StaticMessageSource used by this context. Can be used to register messages on it.
| |
| registerPrototype | back to summary |
|---|---|
| public void registerPrototype(String name, Class<?> clazz) throws BeansException Register a prototype bean with the underlying bean factory. For more advanced needs, register with the underlying BeanFactory directly.
| |
| registerPrototype | back to summary |
|---|---|
| public void registerPrototype(String name, Class<?> clazz, MutablePropertyValues pvs) throws BeansException Register a prototype bean with the underlying bean factory. For more advanced needs, register with the underlying BeanFactory directly.
| |
| registerSingleton | back to summary |
|---|---|
| public void registerSingleton(String name, Class<?> clazz) throws BeansException Register a singleton bean with the underlying bean factory. For more advanced needs, register with the underlying BeanFactory directly.
| |
| registerSingleton | back to summary |
|---|---|
| public void registerSingleton(String name, Class<?> clazz, MutablePropertyValues pvs) throws BeansException Register a singleton bean with the underlying bean factory. For more advanced needs, register with the underlying BeanFactory directly.
| |