Class EncryptableSystemEnvironmentPropertySourceWrapperGetSourceWrapperEnvironmentListener
java.lang.Object
com.ulisesbocchio.jasyptspringboot.configuration.EncryptableSystemEnvironmentPropertySourceWrapperGetSourceWrapperEnvironmentListener
- All Implemented Interfaces:
org.springframework.boot.env.EnvironmentPostProcessor,org.springframework.core.Ordered
public class EncryptableSystemEnvironmentPropertySourceWrapperGetSourceWrapperEnvironmentListener
extends Object
implements org.springframework.boot.env.EnvironmentPostProcessor, org.springframework.core.Ordered
This class initializes
EncryptableSystemEnvironmentPropertySourceWrapper after
SystemEnvironmentPropertySourceEnvironmentPostProcessor to enable the wrapping of `getSource`
to a EncryptableMapWrapper. This can't be done before because Spring, of course.
Spring for some unknown reason converts immediately after environment initialization the system environment property source to a
OriginAwareSystemEnvironmentPropertySource (a private inner class).- See Also:
-
SystemEnvironmentPropertySourceEnvironmentPostProcessor
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableGetSourceWrapping(org.springframework.core.env.ConfigurableEnvironment environment) Static method to enable getSource wrapping on EncryptableSystemEnvironmentPropertySourceWrapper.intgetOrder()voidpostProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application)
-
Constructor Details
-
EncryptableSystemEnvironmentPropertySourceWrapperGetSourceWrapperEnvironmentListener
public EncryptableSystemEnvironmentPropertySourceWrapperGetSourceWrapperEnvironmentListener()
-
-
Method Details
-
enableGetSourceWrapping
public static void enableGetSourceWrapping(org.springframework.core.env.ConfigurableEnvironment environment) Static method to enable getSource wrapping on EncryptableSystemEnvironmentPropertySourceWrapper. Can be called from both EnvironmentPostProcessor and BeanFactoryPostProcessor contexts.- Parameters:
environment- the ConfigurableEnvironment to process
-
postProcessEnvironment
public void postProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application) - Specified by:
postProcessEnvironmentin interfaceorg.springframework.boot.env.EnvironmentPostProcessor
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-