RenamedPropertiesEnvironmentPostProcessor class final
Stops the start when a property still has the name Spring Boot gives it and this project has renamed.
Some of Spring Boot's property names carry Java history that means
nothing in Dart (servlet, Jackson, Spring Cloud, Logback, Flyway), so
the properties are named after what they configure instead. An old name
that is silently ignored does harm: a forgotten
server.servlet.session.* would leave the sessions on their defaults.
SpringApplication always runs this post-processor, after the config
files are read, so applications and starters never create or register
it. Every key under an old prefix, in any property source (a config
file, the command line, --dart-define, an environment variable in its
relaxed form such as SPRING_JACKSON_TIME_ZONE), makes the start fail
with a RenamedPropertiesException, which the failure report explains:
Description:
These properties have been renamed:
- SPRING_JACKSON_TIMEZONE is now SPRING_JSON_TIMEZONE
- spring.jackson.default-property-inclusion is now
spring.json.default-property-inclusion
The table of the renames is renamed, the only place that lists them;
it also holds the prefixes of starters this package does not depend on.
A new name that merely looks like an old one (spring.json.*,
server.session.*) is not reported.
Spring (Java): spring-boot-properties-migrator
(PropertiesMigrationListener), which only logs a warning and keeps
reading the old name; here the start fails.
- Implemented types
Constructors
- RenamedPropertiesEnvironmentPostProcessor()
-
The post-processor; it has no settings.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- order → int
-
Where this object goes: lower values come first. Values are usually
small numbers, or offsets from highestPrecedence and
lowestPrecedence.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
postProcessEnvironment(
ConfigurableEnvironment environment, SpringApplication application) → void -
Changes
environment, the environment being prepared forapplication.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
findRenamedProperties(
Iterable< AbstractPropertySource< sources) → Map<Object> >String, String> -
The keys of
sourcesthat are under an old prefix of renamed, each as written in its source, with the key it is now (in the same style: an environment variable stays an environment variable). Sorted by the old key.