public class I18nEnvironmentPostProcessor extends java.lang.Object implements EnvironmentPostProcessor, Ordered
Composes spring.messages.basename from the build-time i18n descriptors, so that Spring
Boot's own MessageSourceAutoConfiguration can own the messageSource bean outright.
Spring replaces list properties rather than accumulating them, so plugins cannot each contribute a fragment of the base-name list through their own configuration files. Something has to compute one combined value, and doing it here rather than in the application's build is what keeps the result correct when the runtime classpath differs from what the build resolved — an integration test that pulls in an extra plugin, for instance.
This runs after ConfigDataEnvironmentPostProcessor, so the application's own
spring.messages.basename is visible and can be merged rather than replaced; and after
GrailsEnvironmentPostProcessor, whose plugin configuration can influence the environment
this reads. It does not, however, depend on that processor having initialised plugin discovery:
PluginDiscovery#init#init is idempotent, so this calls it too rather than leaving an invisible
precondition that would break quietly if the other call ever moved.
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
BASENAME_PROPERTY |
Property holding the composed, ordered base-name list. |
static java.lang.String |
INCLUDE_PLUGIN_BUNDLES_PROPERTY |
Set to false to leave plugin bundles out of both resolution and native-image hints. |
static int |
ORDER |
Later than ConfigDataEnvironmentPostProcessor.ORDER so application.yml is
loaded, and later than GrailsEnvironmentPostProcessor so plugin configuration is in
place. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public int |
getOrder() |
|
public void |
postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Property holding the composed, ordered base-name list.
Set to false to leave plugin bundles out of both resolution and native-image hints.
Later than ConfigDataEnvironmentPostProcessor.ORDER so application.yml is
loaded, and later than GrailsEnvironmentPostProcessor so plugin configuration is in
place.