public class DefaultApplicationContextBuilder extends java.lang.Object implements ApplicationContextBuilder, ApplicationContextConfiguration
ApplicationContextBuilder
.Modifier | Constructor and Description |
---|---|
protected |
DefaultApplicationContextBuilder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ApplicationContextBuilder |
args(java.lang.String... args)
Set the command line arguments.
|
ApplicationContext |
build()
Builds the
ApplicationContext , but does not start it. |
ApplicationContextBuilder |
classLoader(java.lang.ClassLoader classLoader)
The class loader to be used.
|
ApplicationContextBuilder |
deduceEnvironment(java.lang.Boolean deduceEnvironments)
Whether to deduce environments.
|
ApplicationContextBuilder |
eagerInitAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation>... annotations)
Specifies to eager init the given annotated types.
|
ApplicationContextBuilder |
environmentPropertySource(boolean environmentPropertySource)
Set whether environment variables should contribute to configuration.
|
ApplicationContextBuilder |
environments(java.lang.String... environments)
The environments to use.
|
ApplicationContextBuilder |
environmentVariableExcludes(java.lang.String... environmentVariables)
Which environment variables should not contribute to configuration.
|
ApplicationContextBuilder |
environmentVariableIncludes(java.lang.String... environmentVariables)
Which environment variables should contribute to configuration.
|
ApplicationContextBuilder |
exclude(java.lang.String... configurations)
Allow customizing the configurations that will be loaded.
|
java.lang.ClassLoader |
getClassLoader()
The class loader to use.
|
java.util.Optional<java.lang.Boolean> |
getDeduceEnvironments() |
java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> |
getEagerInitAnnotated() |
java.util.List<java.lang.String> |
getEnvironments() |
java.util.List<java.lang.String> |
getEnvironmentVariableExcludes() |
java.util.List<java.lang.String> |
getEnvironmentVariableIncludes() |
java.util.List<java.lang.String> |
getOverrideConfigLocations()
The config locations.
|
ClassPathResourceLoader |
getResourceLoader()
The class path resource loader to use.
|
ApplicationContextBuilder |
include(java.lang.String... configurations)
Allow customizing the configurations that will be loaded.
|
boolean |
isEnvironmentPropertySource() |
ApplicationContextBuilder |
mainClass(java.lang.Class mainClass)
The main class used by this application.
|
protected ApplicationContext |
newApplicationContext()
Creates the
ApplicationContext instance. |
ApplicationContextBuilder |
overrideConfigLocations(java.lang.String... configLocations)
Override default config locations.
|
ApplicationContextBuilder |
packages(java.lang.String... packages)
The packages to include for package scanning.
|
ApplicationContextBuilder |
properties(java.util.Map<java.lang.String,java.lang.Object> properties)
Properties to override from the environment.
|
ApplicationContextBuilder |
propertySources(PropertySource... propertySources)
Additional property sources.
|
ApplicationContextBuilder |
singletons(java.lang.Object... beans)
Additional singletons to register prior to startup.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
eagerInitConfiguration, eagerInitSingletons, run, start
getConversionService
isEagerInitConfiguration, isEagerInitSingletons
protected DefaultApplicationContextBuilder()
@NonNull public ApplicationContextBuilder eagerInitAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation>... annotations)
ApplicationContextBuilder
eagerInitAnnotated
in interface ApplicationContextBuilder
annotations
- The annotation stereotypes@NonNull public ApplicationContextBuilder overrideConfigLocations(java.lang.String... configLocations)
ApplicationContextBuilder
overrideConfigLocations
in interface ApplicationContextBuilder
configLocations
- The config locations@Nullable public java.util.List<java.lang.String> getOverrideConfigLocations()
ApplicationContextConfiguration
getOverrideConfigLocations
in interface ApplicationContextConfiguration
public java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> getEagerInitAnnotated()
getEagerInitAnnotated
in interface BeanContextConfiguration
@NonNull public ApplicationContextBuilder singletons(java.lang.Object... beans)
ApplicationContextBuilder
singletons
in interface ApplicationContextBuilder
beans
- The beans@NonNull public ClassPathResourceLoader getResourceLoader()
ApplicationContextConfiguration
getResourceLoader
in interface ApplicationContextConfiguration
@NonNull public java.lang.ClassLoader getClassLoader()
BeanContextConfiguration
getClassLoader
in interface BeanContextConfiguration
@NonNull public ApplicationContextBuilder deduceEnvironment(@Nullable java.lang.Boolean deduceEnvironments)
ApplicationContextBuilder
deduceEnvironment
in interface ApplicationContextBuilder
deduceEnvironments
- The boolean@NonNull public ApplicationContextBuilder environments(@Nullable java.lang.String... environments)
ApplicationContextBuilder
environments
in interface ApplicationContextBuilder
environments
- The environments@NonNull public ApplicationContextBuilder packages(@Nullable java.lang.String... packages)
ApplicationContextBuilder
packages
in interface ApplicationContextBuilder
packages
- The packages@NonNull public ApplicationContextBuilder properties(@Nullable java.util.Map<java.lang.String,java.lang.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 java.lang.String... environmentVariables)
ApplicationContextBuilder
environmentVariableIncludes
in interface ApplicationContextBuilder
environmentVariables
- The environment variables@NonNull public ApplicationContextBuilder environmentVariableExcludes(@Nullable java.lang.String... environmentVariables)
ApplicationContextBuilder
environmentVariableExcludes
in interface ApplicationContextBuilder
environmentVariables
- The environment variablespublic java.util.Optional<java.lang.Boolean> getDeduceEnvironments()
getDeduceEnvironments
in interface ApplicationContextConfiguration
@NonNull public java.util.List<java.lang.String> getEnvironments()
getEnvironments
in interface ApplicationContextConfiguration
public boolean isEnvironmentPropertySource()
isEnvironmentPropertySource
in interface ApplicationContextConfiguration
@Nullable public java.util.List<java.lang.String> getEnvironmentVariableIncludes()
getEnvironmentVariableIncludes
in interface ApplicationContextConfiguration
@Nullable public java.util.List<java.lang.String> getEnvironmentVariableExcludes()
getEnvironmentVariableExcludes
in interface ApplicationContextConfiguration
@NonNull public ApplicationContextBuilder mainClass(java.lang.Class mainClass)
ApplicationContextBuilder
mainClass
in interface ApplicationContextBuilder
mainClass
- The main class@NonNull public ApplicationContextBuilder classLoader(java.lang.ClassLoader classLoader)
ApplicationContextBuilder
classLoader
in interface ApplicationContextBuilder
classLoader
- The classloader@NonNull public ApplicationContextBuilder args(@Nullable java.lang.String... args)
ApplicationContextBuilder
args
in interface ApplicationContextBuilder
args
- The arguments@NonNull public ApplicationContext build()
ApplicationContextBuilder
ApplicationContext
, but does not start it.build
in interface ApplicationContextBuilder
ApplicationContext
@NonNull protected ApplicationContext newApplicationContext()
ApplicationContext
instance.@NonNull public ApplicationContextBuilder include(@Nullable java.lang.String... configurations)
include
in interface ApplicationContextBuilder
configurations
- The configurations to include@NonNull public ApplicationContextBuilder exclude(@Nullable java.lang.String... configurations)
exclude
in interface ApplicationContextBuilder
configurations
- The configurations to exclude