Package io.microsphere.spring.boot.env
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:
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptiondefault intgetOrder()Get the order ofDefaultPropertiesPostProcessorvoidinitializeResources(Set<String> defaultPropertiesResources) Initialize"defaultProperties" resourcesdefault voidpostProcess(Map<String, Object> defaultProperties) Post handle(Properties) "defaultProperties", afterinitializeResources(Set)
-
Method Details
-
initializeResources
Initialize"defaultProperties" resources- Parameters:
defaultPropertiesResources-"defaultProperties"Resource path
-
postProcess
Post handle(Properties) "defaultProperties", afterinitializeResources(Set)- Parameters:
defaultProperties-"defaultProperties"
-
getOrder
default int getOrder()Get the order ofDefaultPropertiesPostProcessor- Specified by:
getOrderin interfaceorg.springframework.core.Ordered- Returns:
Ordered.LOWEST_PRECEDENCEas default
-