Class SpringApplicationDefaultPropertiesPostProcessor

java.lang.Object
io.microsphere.spring.boot.env.SpringApplicationDefaultPropertiesPostProcessor
All Implemented Interfaces:
DefaultPropertiesPostProcessor, org.springframework.core.Ordered

public class SpringApplicationDefaultPropertiesPostProcessor extends Object implements DefaultPropertiesPostProcessor
Spring Application DefaultPropertiesPostProcessor to load the properties resources being located in the "classpath*:/META-INF/config/default/*.*"
Since:
1.0.0
Author:
Mercy
See Also:
  • SpringApplication.setDefaultProperties(Properties)
  • Field Details

    • DEFAULT_PROPERTIES_RESOURCES_PATTERN

      public static final String DEFAULT_PROPERTIES_RESOURCES_PATTERN
      The resource pattern to load the properties resources.
      See Also:
  • Constructor Details

    • SpringApplicationDefaultPropertiesPostProcessor

      public SpringApplicationDefaultPropertiesPostProcessor()
  • Method Details

    • initializeResources

      public void initializeResources(Set<String> defaultPropertiesResources)
      Initializes the default properties resources by adding the DEFAULT_PROPERTIES_RESOURCES_PATTERN wildcard pattern for loading all property source resources from /META-INF/config/default/.

      Example Usage

      
         SpringApplicationDefaultPropertiesPostProcessor processor =
             new SpringApplicationDefaultPropertiesPostProcessor();
         Set<String> resources = new LinkedHashSet<>();
         processor.initializeResources(resources);
         // resources now contains "classpath*:/META-INF/config/default/*.*"
       
      Specified by:
      initializeResources in interface DefaultPropertiesPostProcessor
      Parameters:
      defaultPropertiesResources - the mutable set to add resource patterns to