Interface DefaultPropertiesPostProcessor

All Superinterfaces:
org.springframework.core.Ordered
All Known Implementing Classes:
SpringApplicationDefaultPropertiesPostProcessor

public interface DefaultPropertiesPostProcessor extends org.springframework.core.Ordered
"defaultProperties" Post Processor.

Example Usage

Example usage in a custom DefaultPropertiesPostProcessor:


 public class CustomDefaultPropertiesPostProcessor implements DefaultPropertiesPostProcessor {

     @Override
     public void initializeResources(Set<String> defaultPropertiesResources) {
         defaultPropertiesResources.add("classpath*:META-INF/custom-default.properties");
     }

     @Override
     public void postProcess(Map<String> defaultProperties) {
         // Add or modify default properties
         defaultProperties.put("custom.property", "defaultValue");
     }
 }
 

Register the processor in META-INF/spring.factories:


 io.microsphere.spring.boot.env.DefaultPropertiesPostProcessor=\
 com.example.CustomDefaultPropertiesPostProcessor
 
Since:
1.0.0
Author:
Mercy
See Also:
  • Method Details

    • initializeResources

      void initializeResources(Set<String> defaultPropertiesResources)
      Initialize "defaultProperties" resources
      Parameters:
      defaultPropertiesResources - "defaultProperties" Resource path
    • postProcess

      default void postProcess(Map<String,Object> defaultProperties)
      Post handle (Properties) "defaultProperties", after initializeResources(Set)
      Parameters:
      defaultProperties - "defaultProperties"
    • getOrder

      default int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
      Returns:
      Ordered.LOWEST_PRECEDENCE as default