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
  • 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:
      postProcessEnvironment in interface org.springframework.boot.env.EnvironmentPostProcessor
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered