public interface ApplicationContextBuilder
| Modifier and Type | Method and Description |
|---|---|
default 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 deduceEnvironment)
Whether to deduce environments.
|
ApplicationContextBuilder |
defaultEnvironments(java.lang.String... environments)
The environments to use if no other environments are specified.
|
ApplicationContextBuilder |
eagerInitAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation>... annotations)
Specifies to eager init the given annotated types.
|
default ApplicationContextBuilder |
eagerInitConfiguration(boolean eagerInitConfiguration)
Whether to eager initialize
ConfigurationProperties beans. |
default ApplicationContextBuilder |
eagerInitSingletons(boolean eagerInitSingletons)
Whether to eager initialize singleton beans.
|
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.
|
ApplicationContextBuilder |
include(java.lang.String... configurations)
Allow customizing the configurations that will be loaded.
|
ApplicationContextBuilder |
mainClass(java.lang.Class mainClass)
The main class used by this application.
|
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.
|
default <T extends java.lang.AutoCloseable> |
run(java.lang.Class<T> type)
Run the
ApplicationContext with the given type. |
ApplicationContextBuilder |
singletons(java.lang.Object... beans)
Additional singletons to register prior to startup.
|
default ApplicationContext |
start()
Starts the
ApplicationContext. |
@NonNull default ApplicationContextBuilder eagerInitConfiguration(boolean eagerInitConfiguration)
ConfigurationProperties beans.eagerInitConfiguration - True if configuration properties should be eagerly initialized@NonNull default ApplicationContextBuilder eagerInitSingletons(boolean eagerInitSingletons)
eagerInitSingletons - True if singletons should be eagerly initialized@NonNull ApplicationContextBuilder eagerInitAnnotated(java.lang.Class<? extends java.lang.annotation.Annotation>... annotations)
annotations - The annotation stereotypes@NonNull ApplicationContextBuilder overrideConfigLocations(java.lang.String... configLocations)
configLocations - The config locations@NonNull ApplicationContextBuilder singletons(@Nullable java.lang.Object... beans)
beans - The beans@NonNull ApplicationContextBuilder deduceEnvironment(@Nullable java.lang.Boolean deduceEnvironment)
deduceEnvironment - The boolean@NonNull ApplicationContextBuilder environments(@Nullable java.lang.String... environments)
environments - The environments@NonNull ApplicationContextBuilder defaultEnvironments(@Nullable java.lang.String... environments)
environments - The environments@NonNull ApplicationContextBuilder packages(@Nullable java.lang.String... packages)
packages - The packages@NonNull ApplicationContextBuilder properties(@Nullable java.util.Map<java.lang.String,java.lang.Object> properties)
properties - The properties@NonNull ApplicationContextBuilder propertySources(@Nullable PropertySource... propertySources)
propertySources - The property sources to include@NonNull ApplicationContextBuilder environmentPropertySource(boolean environmentPropertySource)
environmentPropertySource - The boolean@NonNull ApplicationContextBuilder environmentVariableIncludes(@Nullable java.lang.String... environmentVariables)
environmentVariables - The environment variables@NonNull ApplicationContextBuilder environmentVariableExcludes(@Nullable java.lang.String... environmentVariables)
environmentVariables - The environment variables@NonNull ApplicationContextBuilder mainClass(@Nullable java.lang.Class mainClass)
mainClass - The main class@NonNull ApplicationContextBuilder classLoader(@Nullable java.lang.ClassLoader classLoader)
classLoader - The classloader@NonNull ApplicationContext build()
ApplicationContext, but does not start it.ApplicationContext@NonNull ApplicationContextBuilder include(@Nullable java.lang.String... configurations)
configurations - The configurations to include@NonNull ApplicationContextBuilder exclude(@Nullable java.lang.String... configurations)
configurations - The configurations to exclude@NonNull default ApplicationContextBuilder args(@Nullable java.lang.String... args)
args - The arguments@NonNull default ApplicationContext start()
ApplicationContext.ApplicationContext@NonNull
default <T extends java.lang.AutoCloseable> T run(@NonNull
java.lang.Class<T> type)
ApplicationContext with the given type. Returning an instance of the type.T - The type, a subclass of AutoCloseable. The close method of the implementation should shutdown the context.type - The type of the bean to run