public class DefaultApplicationContextBuilder extends Object implements ApplicationContextBuilder, ApplicationContextConfiguration
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 |
deduceEnvironment(Boolean deduceEnvironments)
Whether to deduce environments.
|
ApplicationContextBuilder |
environmentPropertySource(boolean environmentPropertySource)
Set whether environment variables should contribute to configuration.
|
ApplicationContextBuilder |
environments(String... environments)
The environments to use.
|
ApplicationContextBuilder |
environmentVariableExcludes(String... environmentVariables)
Which environment variables should not contribute to configuration.
|
ApplicationContextBuilder |
environmentVariableIncludes(String... environmentVariables)
Which environment variables should contribute to configuration.
|
ApplicationContextBuilder |
exclude(String... configurations)
Allow customizing the configurations that will be loaded.
|
ClassLoader |
getClassLoader()
The class loader to use.
|
Optional<Boolean> |
getDeduceEnvironments() |
List<String> |
getEnvironments() |
List<String> |
getEnvironmentVariableExcludes() |
List<String> |
getEnvironmentVariableIncludes() |
ClassPathResourceLoader |
getResourceLoader()
The class path resource loader to use.
|
ApplicationContextBuilder |
include(String... configurations)
Allow customizing the configurations that will be loaded.
|
boolean |
isEnvironmentPropertySource() |
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
getConversionService
protected DefaultApplicationContextBuilder()
@Nonnull public ApplicationContextBuilder singletons(Object... beans)
ApplicationContextBuilder
singletons
in interface ApplicationContextBuilder
beans
- The beans@Nonnull public ClassPathResourceLoader getResourceLoader()
ApplicationContextConfiguration
getResourceLoader
in interface ApplicationContextConfiguration
@Nonnull public ClassLoader getClassLoader()
BeanContextConfiguration
getClassLoader
in interface BeanContextConfiguration
@Nonnull public ApplicationContextBuilder deduceEnvironment(@Nullable Boolean deduceEnvironments)
ApplicationContextBuilder
deduceEnvironment
in interface ApplicationContextBuilder
deduceEnvironments
- The boolean@Nonnull public ApplicationContextBuilder environments(@Nullable String... environments)
ApplicationContextBuilder
environments
in interface ApplicationContextBuilder
environments
- The environments@Nonnull public ApplicationContextBuilder packages(@Nullable String... packages)
ApplicationContextBuilder
packages
in interface ApplicationContextBuilder
packages
- The packages@Nonnull public ApplicationContextBuilder properties(@Nullable Map<String,Object> properties)
ApplicationContextBuilder
properties
in interface ApplicationContextBuilder
properties
- The properties@Nonnull public ApplicationContextBuilder propertySources(@Nullable PropertySource... propertySources)
ApplicationContextBuilder
propertySources
in interface ApplicationContextBuilder
propertySources
- The property sources to include@Nonnull public ApplicationContextBuilder environmentPropertySource(boolean environmentPropertySource)
ApplicationContextBuilder
environmentPropertySource
in interface ApplicationContextBuilder
environmentPropertySource
- The boolean@Nonnull public ApplicationContextBuilder environmentVariableIncludes(@Nullable String... environmentVariables)
ApplicationContextBuilder
environmentVariableIncludes
in interface ApplicationContextBuilder
environmentVariables
- The environment variables@Nonnull public ApplicationContextBuilder environmentVariableExcludes(@Nullable String... environmentVariables)
ApplicationContextBuilder
environmentVariableExcludes
in interface ApplicationContextBuilder
environmentVariables
- The environment variablespublic Optional<Boolean> getDeduceEnvironments()
getDeduceEnvironments
in interface ApplicationContextConfiguration
@Nonnull public List<String> getEnvironments()
getEnvironments
in interface ApplicationContextConfiguration
public boolean isEnvironmentPropertySource()
isEnvironmentPropertySource
in interface ApplicationContextConfiguration
@Nullable public List<String> getEnvironmentVariableIncludes()
getEnvironmentVariableIncludes
in interface ApplicationContextConfiguration
@Nullable public List<String> getEnvironmentVariableExcludes()
getEnvironmentVariableExcludes
in interface ApplicationContextConfiguration
@Nonnull public ApplicationContextBuilder mainClass(Class mainClass)
ApplicationContextBuilder
mainClass
in interface ApplicationContextBuilder
mainClass
- The main class@Nonnull public ApplicationContextBuilder classLoader(ClassLoader classLoader)
ApplicationContextBuilder
classLoader
in interface ApplicationContextBuilder
classLoader
- The classloader@Nonnull public ApplicationContext build()
ApplicationContextBuilder
ApplicationContext
, but does not start it.build
in interface ApplicationContextBuilder
ApplicationContext
@Nonnull public ApplicationContextBuilder include(@Nullable String... configurations)
include
in interface ApplicationContextBuilder
configurations
- The configurations to include@Nonnull public ApplicationContextBuilder exclude(@Nullable String... configurations)
exclude
in interface ApplicationContextBuilder
configurations
- The configurations to exclude