Class ConfigDataEnvironmentPostProcessor
java.lang.Object
org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor
- All Implemented Interfaces:
EnvironmentPostProcessor
,Ordered
public class ConfigDataEnvironmentPostProcessor
extends Object
implements EnvironmentPostProcessor, Ordered
- Since:
- 2.4.0
- Author:
- Phillip Webb, Madhura Bhave, Nguyen Bao Sach
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Property used to determine what action to take when aConfigDataLocationNotFoundException
is thrown.static final int
The default order for the processor.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionConfigDataEnvironmentPostProcessor
(DeferredLogFactory logFactory, ConfigurableBootstrapContext bootstrapContext) ConfigDataEnvironmentPostProcessor
(DeferredLogFactory logFactory, ConfigurableBootstrapContext bootstrapContext, ConfigDataEnvironmentUpdateListener environmentUpdateListener) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyTo
(ConfigurableEnvironment environment) ApplyConfigData
post-processing to an existingEnvironment
.static void
applyTo
(ConfigurableEnvironment environment, ResourceLoader resourceLoader, ConfigurableBootstrapContext bootstrapContext, String... additionalProfiles) ApplyConfigData
post-processing to an existingEnvironment
.static void
applyTo
(ConfigurableEnvironment environment, ResourceLoader resourceLoader, ConfigurableBootstrapContext bootstrapContext, Collection<String> additionalProfiles) ApplyConfigData
post-processing to an existingEnvironment
.static void
applyTo
(ConfigurableEnvironment environment, ResourceLoader resourceLoader, ConfigurableBootstrapContext bootstrapContext, Collection<String> additionalProfiles, ConfigDataEnvironmentUpdateListener environmentUpdateListener) ApplyConfigData
post-processing to an existingEnvironment
.int
getOrder()
void
postProcessEnvironment
(ConfigurableEnvironment environment, SpringApplication application) Post-process the givenenvironment
.
-
Field Details
-
ORDER
public static final int ORDERThe default order for the processor.- See Also:
-
ON_LOCATION_NOT_FOUND_PROPERTY
Property used to determine what action to take when aConfigDataLocationNotFoundException
is thrown.
-
-
Constructor Details
-
ConfigDataEnvironmentPostProcessor
public ConfigDataEnvironmentPostProcessor(DeferredLogFactory logFactory, ConfigurableBootstrapContext bootstrapContext) -
ConfigDataEnvironmentPostProcessor
public ConfigDataEnvironmentPostProcessor(DeferredLogFactory logFactory, ConfigurableBootstrapContext bootstrapContext, ConfigDataEnvironmentUpdateListener environmentUpdateListener)
-
-
Method Details
-
getOrder
public int getOrder() -
postProcessEnvironment
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) Description copied from interface:EnvironmentPostProcessor
Post-process the givenenvironment
.- Specified by:
postProcessEnvironment
in interfaceEnvironmentPostProcessor
- Parameters:
environment
- the environment to post-processapplication
- the application to which the environment belongs
-
applyTo
ApplyConfigData
post-processing to an existingEnvironment
. This method can be useful when working with anEnvironment
that has been created directly and not necessarily as part of aSpringApplication
.- Parameters:
environment
- the environment to applyConfigData
to
-
applyTo
public static void applyTo(ConfigurableEnvironment environment, ResourceLoader resourceLoader, ConfigurableBootstrapContext bootstrapContext, String... additionalProfiles) ApplyConfigData
post-processing to an existingEnvironment
. This method can be useful when working with anEnvironment
that has been created directly and not necessarily as part of aSpringApplication
.- Parameters:
environment
- the environment to applyConfigData
toresourceLoader
- the resource loader to usebootstrapContext
- the bootstrap context to use ornull
to use a throw-away contextadditionalProfiles
- any additional profiles that should be applied
-
applyTo
public static void applyTo(ConfigurableEnvironment environment, ResourceLoader resourceLoader, ConfigurableBootstrapContext bootstrapContext, Collection<String> additionalProfiles) ApplyConfigData
post-processing to an existingEnvironment
. This method can be useful when working with anEnvironment
that has been created directly and not necessarily as part of aSpringApplication
.- Parameters:
environment
- the environment to applyConfigData
toresourceLoader
- the resource loader to usebootstrapContext
- the bootstrap context to use ornull
to use a throw-away contextadditionalProfiles
- any additional profiles that should be applied
-
applyTo
public static void applyTo(ConfigurableEnvironment environment, ResourceLoader resourceLoader, ConfigurableBootstrapContext bootstrapContext, Collection<String> additionalProfiles, ConfigDataEnvironmentUpdateListener environmentUpdateListener) ApplyConfigData
post-processing to an existingEnvironment
. This method can be useful when working with anEnvironment
that has been created directly and not necessarily as part of aSpringApplication
.- Parameters:
environment
- the environment to applyConfigData
toresourceLoader
- the resource loader to usebootstrapContext
- the bootstrap context to use ornull
to use a throw-away contextadditionalProfiles
- any additional profiles that should be appliedenvironmentUpdateListener
- optionalConfigDataEnvironmentUpdateListener
that can be used to trackEnvironment
updates.
-