public class DefaultApplicationContextBuilder extends Object implements ApplicationContextBuilder
ApplicationContextBuilder
.Modifier | Constructor and Description |
---|---|
protected |
DefaultApplicationContextBuilder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ApplicationContext |
build()
Builds the
ApplicationContext , but does not start it. |
ApplicationContextBuilder |
classLoader(ClassLoader classLoader)
The class loader to be used.
|
ApplicationContextBuilder |
environments(String... environments)
The environments to use.
|
ApplicationContextBuilder |
exclude(String... configurations)
Allow customizing the configurations that will be loaded.
|
ApplicationContextBuilder |
include(String... configurations)
Allow customizing the configurations that will be loaded.
|
ApplicationContextBuilder |
mainClass(Class mainClass)
The main class used by this application.
|
ApplicationContextBuilder |
packages(String... packages)
The packages to include for package scanning.
|
ApplicationContextBuilder |
properties(Map<String,Object> properties)
Properties to override from the environment.
|
ApplicationContextBuilder |
propertySources(PropertySource... propertySources)
Additional property sources.
|
ApplicationContextBuilder |
singletons(Object... beans)
Additional singletons to register prior to startup.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run, start
protected DefaultApplicationContextBuilder()
public ApplicationContextBuilder singletons(Object... beans)
ApplicationContextBuilder
singletons
in interface ApplicationContextBuilder
beans
- The beanspublic ApplicationContextBuilder environments(@Nullable String... environments)
ApplicationContextBuilder
environments
in interface ApplicationContextBuilder
environments
- The environmentspublic ApplicationContextBuilder packages(@Nullable String... packages)
ApplicationContextBuilder
packages
in interface ApplicationContextBuilder
packages
- The packagespublic ApplicationContextBuilder properties(@Nullable Map<String,Object> properties)
ApplicationContextBuilder
properties
in interface ApplicationContextBuilder
properties
- The propertiespublic ApplicationContextBuilder propertySources(@Nullable PropertySource... propertySources)
ApplicationContextBuilder
propertySources
in interface ApplicationContextBuilder
propertySources
- The property sources to includepublic ApplicationContextBuilder mainClass(Class mainClass)
ApplicationContextBuilder
mainClass
in interface ApplicationContextBuilder
mainClass
- The main classpublic ApplicationContextBuilder classLoader(ClassLoader classLoader)
ApplicationContextBuilder
classLoader
in interface ApplicationContextBuilder
classLoader
- The classloaderpublic ApplicationContext build()
ApplicationContextBuilder
ApplicationContext
, but does not start it.build
in interface ApplicationContextBuilder
ApplicationContext
public ApplicationContextBuilder include(@Nullable String... configurations)
include
in interface ApplicationContextBuilder
configurations
- The configurations to includepublic ApplicationContextBuilder exclude(@Nullable String... configurations)
exclude
in interface ApplicationContextBuilder
configurations
- The configurations to exclude