public class DefaultApplicationContextBuilder extends Object implements ApplicationContextBuilder, ApplicationContextConfiguration
ApplicationContextBuilder.| Modifier | Constructor and Description |
|---|---|
protected |
DefaultApplicationContextBuilder()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ApplicationContextBuilder |
allowEmptyProviders(boolean shouldAllow)
Whether to error on an empty bean provider.
|
ApplicationContextBuilder |
args(String... args)
Set the command line arguments.
|
ApplicationContextBuilder |
banner(boolean isEnabled)
Whether the banner is enabled or not.
|
ApplicationContextBuilder |
bootstrapEnvironment(boolean bootstrapEnv)
Sets whether the bootstrap environment should be initialized.
|
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 |
defaultEnvironments(String... environments)
The environments to use if no other environments are specified.
|
ApplicationContextBuilder |
eagerInitAnnotated(Class<? extends Annotation>... annotations)
Specifies to eager init the given annotated types.
|
ApplicationContextBuilder |
enableDefaultPropertySources(boolean areEnabled)
Specify whether the default set of property sources should be enabled (default is
true). |
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> |
getDefaultEnvironments() |
Set<Class<? extends Annotation>> |
getEagerInitAnnotated() |
List<String> |
getEnvironments() |
List<String> |
getEnvironmentVariableExcludes() |
List<String> |
getEnvironmentVariableIncludes() |
List<String> |
getOverrideConfigLocations()
The config locations.
|
ClassPathResourceLoader |
getResourceLoader()
The class path resource loader to use.
|
ApplicationContextBuilder |
include(String... configurations)
Allow customizing the configurations that will be loaded.
|
boolean |
isAllowEmptyProviders() |
boolean |
isBannerEnabled()
The banner is enabled by default.
|
Boolean |
isBootstrapEnvironmentEnabled() |
boolean |
isEnableDefaultPropertySources()
Whether to load the default set of property sources.
|
boolean |
isEnvironmentPropertySource() |
ApplicationContextBuilder |
mainClass(Class mainClass)
The main class used by this application.
|
protected ApplicationContext |
newApplicationContext()
Creates the
ApplicationContext instance. |
ApplicationContextBuilder |
overrideConfigLocations(String... configLocations)
Override default config locations.
|
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, waiteagerInitConfiguration, eagerInitSingletons, run, startgetConversionServiceisEagerInitConfiguration, isEagerInitSingletonsprotected DefaultApplicationContextBuilder()
public boolean isAllowEmptyProviders()
isAllowEmptyProviders in interface BeanContextConfigurationNoSuchBeanException should be thrown on a missing BeanProvider or Provider@NonNull public ApplicationContextBuilder enableDefaultPropertySources(boolean areEnabled)
ApplicationContextBuildertrue).enableDefaultPropertySources in interface ApplicationContextBuilderareEnabled - Whether the default property sources are enabledpublic boolean isEnableDefaultPropertySources()
ApplicationContextConfigurationisEnableDefaultPropertySources in interface ApplicationContextConfigurationtrue if the default set of property sources should be loaded.@NonNull public ApplicationContextBuilder eagerInitAnnotated(Class<? extends Annotation>... annotations)
ApplicationContextBuildereagerInitAnnotated in interface ApplicationContextBuilderannotations - The annotation stereotypes@NonNull public ApplicationContextBuilder overrideConfigLocations(String... configLocations)
ApplicationContextBuilderoverrideConfigLocations in interface ApplicationContextBuilderconfigLocations - The config locations@Nullable public List<String> getOverrideConfigLocations()
ApplicationContextConfigurationgetOverrideConfigLocations in interface ApplicationContextConfigurationpublic boolean isBannerEnabled()
ApplicationContextConfigurationisBannerEnabled in interface ApplicationContextConfiguration@Nullable public Boolean isBootstrapEnvironmentEnabled()
isBootstrapEnvironmentEnabled in interface ApplicationContextConfigurationpublic Set<Class<? extends Annotation>> getEagerInitAnnotated()
getEagerInitAnnotated in interface BeanContextConfiguration@NonNull public ApplicationContextBuilder singletons(Object... beans)
ApplicationContextBuildersingletons in interface ApplicationContextBuilderbeans - The beans@NonNull public ClassPathResourceLoader getResourceLoader()
ApplicationContextConfigurationgetResourceLoader in interface ApplicationContextConfiguration@NonNull public ClassLoader getClassLoader()
BeanContextConfigurationgetClassLoader in interface BeanContextConfiguration@NonNull public ApplicationContextBuilder deduceEnvironment(@Nullable Boolean deduceEnvironments)
ApplicationContextBuilderdeduceEnvironment in interface ApplicationContextBuilderdeduceEnvironments - The boolean@NonNull public ApplicationContextBuilder environments(@Nullable String... environments)
ApplicationContextBuilderenvironments in interface ApplicationContextBuilderenvironments - The environments@NonNull public ApplicationContextBuilder defaultEnvironments(@Nullable String... environments)
ApplicationContextBuilderdefaultEnvironments in interface ApplicationContextBuilderenvironments - The environments@NonNull public ApplicationContextBuilder packages(@Nullable String... packages)
ApplicationContextBuilderpackages in interface ApplicationContextBuilderpackages - The packages@NonNull public ApplicationContextBuilder properties(@Nullable Map<String,Object> properties)
ApplicationContextBuilderproperties in interface ApplicationContextBuilderproperties - The properties@NonNull public ApplicationContextBuilder propertySources(@Nullable PropertySource... propertySources)
ApplicationContextBuilderpropertySources in interface ApplicationContextBuilderpropertySources - The property sources to include@NonNull public ApplicationContextBuilder environmentPropertySource(boolean environmentPropertySource)
ApplicationContextBuilderenvironmentPropertySource in interface ApplicationContextBuilderenvironmentPropertySource - The boolean@NonNull public ApplicationContextBuilder environmentVariableIncludes(@Nullable String... environmentVariables)
ApplicationContextBuilderenvironmentVariableIncludes in interface ApplicationContextBuilderenvironmentVariables - The environment variables@NonNull public ApplicationContextBuilder environmentVariableExcludes(@Nullable String... environmentVariables)
ApplicationContextBuilderenvironmentVariableExcludes in interface ApplicationContextBuilderenvironmentVariables - The environment variablespublic Optional<Boolean> getDeduceEnvironments()
getDeduceEnvironments in interface ApplicationContextConfiguration@NonNull public List<String> getEnvironments()
getEnvironments in interface ApplicationContextConfiguration@NonNull public List<String> getDefaultEnvironments()
getDefaultEnvironments in interface ApplicationContextConfigurationpublic 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)
ApplicationContextBuildermainClass in interface ApplicationContextBuildermainClass - The main class@NonNull public ApplicationContextBuilder classLoader(ClassLoader classLoader)
ApplicationContextBuilderclassLoader in interface ApplicationContextBuilderclassLoader - The classloader@NonNull public ApplicationContextBuilder args(@Nullable String... args)
ApplicationContextBuilderargs in interface ApplicationContextBuilderargs - The arguments@NonNull public ApplicationContextBuilder bootstrapEnvironment(boolean bootstrapEnv)
ApplicationContextBuilderbootstrapEnvironment in interface ApplicationContextBuilderbootstrapEnv - True if it should be initialized. Default true@NonNull public ApplicationContext build()
ApplicationContextBuilderApplicationContext, but does not start it.build in interface ApplicationContextBuilderApplicationContext@NonNull protected ApplicationContext newApplicationContext()
ApplicationContext instance.@NonNull public ApplicationContextBuilder include(@Nullable String... configurations)
include in interface ApplicationContextBuilderconfigurations - The configurations to include@NonNull public ApplicationContextBuilder exclude(@Nullable String... configurations)
exclude in interface ApplicationContextBuilderconfigurations - The configurations to exclude@NonNull public ApplicationContextBuilder banner(boolean isEnabled)
ApplicationContextBuilderbanner in interface ApplicationContextBuilderisEnabled - Whether the banner is enabled or not@NonNull public ApplicationContextBuilder allowEmptyProviders(boolean shouldAllow)
ApplicationContextBuilderfalse.allowEmptyProviders in interface ApplicationContextBuildershouldAllow - True if empty Provider instances are allowed