public class

StaticApplicationContext

extends GenericApplicationContext
java.lang.Object
   ↳ org.springframework.core.io.DefaultResourceLoader
     ↳ org.springframework.context.support.AbstractApplicationContext
       ↳ org.springframework.context.support.GenericApplicationContext
         ↳ org.springframework.context.support.StaticApplicationContext
Known Direct Subclasses

Class Overview

ApplicationContext implementation which supports programmatic registration of beans and messages, rather than reading bean definitions from external configuration sources. Mainly useful for testing.

Summary

[Expand]
Inherited Constants
From class org.springframework.context.support.AbstractApplicationContext
From interface org.springframework.beans.factory.BeanFactory
From interface org.springframework.context.ConfigurableApplicationContext
From interface org.springframework.core.io.ResourceLoader
From interface org.springframework.core.io.support.ResourcePatternResolver
[Expand]
Inherited Fields
From class org.springframework.context.support.AbstractApplicationContext
Public Constructors
StaticApplicationContext()
Create a new StaticApplicationContext.
StaticApplicationContext(ApplicationContext parent)
Create a new StaticApplicationContext with the given parent.
Public Methods
void addMessage(String code, Locale locale, String defaultMessage)
Associate the given message with the given code.
final StaticMessageSource getStaticMessageSource()
Return the internal StaticMessageSource used by this context.
void registerPrototype(String name, Class clazz, MutablePropertyValues pvs)
Register a prototype bean with the underlying bean factory.
void registerPrototype(String name, Class clazz)
Register a prototype bean with the underlying bean factory.
void registerSingleton(String name, Class clazz, MutablePropertyValues pvs)
Register a singleton bean with the underlying bean factory.
void registerSingleton(String name, Class clazz)
Register a singleton bean with the underlying bean factory.
[Expand]
Inherited Methods
From class org.springframework.context.support.GenericApplicationContext
From class org.springframework.context.support.AbstractApplicationContext
From class org.springframework.core.io.DefaultResourceLoader
From class java.lang.Object
From interface org.springframework.beans.factory.BeanFactory
From interface org.springframework.beans.factory.DisposableBean
From interface org.springframework.beans.factory.HierarchicalBeanFactory
From interface org.springframework.beans.factory.ListableBeanFactory
From interface org.springframework.beans.factory.support.BeanDefinitionRegistry
From interface org.springframework.context.ApplicationContext
From interface org.springframework.context.ApplicationEventPublisher
From interface org.springframework.context.ConfigurableApplicationContext
From interface org.springframework.context.Lifecycle
From interface org.springframework.context.MessageSource
From interface org.springframework.core.AliasRegistry
From interface org.springframework.core.env.EnvironmentCapable
From interface org.springframework.core.io.ResourceLoader
From interface org.springframework.core.io.support.ResourcePatternResolver

Public Constructors

public StaticApplicationContext ()

public StaticApplicationContext (ApplicationContext parent)

Public Methods

public void addMessage (String code, Locale locale, String defaultMessage)

Associate the given message with the given code.

Parameters
code lookup code
locale locale message should be found within
defaultMessage message associated with this lookup code

public final StaticMessageSource getStaticMessageSource ()

Return the internal StaticMessageSource used by this context. Can be used to register messages on it.

public void registerPrototype (String name, Class clazz, MutablePropertyValues pvs)

Register a prototype bean with the underlying bean factory.

For more advanced needs, register with the underlying BeanFactory directly.

public void registerPrototype (String name, Class clazz)

Register a prototype bean with the underlying bean factory.

For more advanced needs, register with the underlying BeanFactory directly.

public void registerSingleton (String name, Class clazz, MutablePropertyValues pvs)

Register a singleton bean with the underlying bean factory.

For more advanced needs, register with the underlying BeanFactory directly.

public void registerSingleton (String name, Class clazz)

Register a singleton bean with the underlying bean factory.

For more advanced needs, register with the underlying BeanFactory directly.