Package io.microsphere.spring.boot.env
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe resource pattern to load the properties resources.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinitializeResources(Set<String> defaultPropertiesResources) Initializes the default properties resources by adding theDEFAULT_PROPERTIES_RESOURCES_PATTERNwildcard pattern for loading all property source resources from/META-INF/config/default/.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.microsphere.spring.boot.env.DefaultPropertiesPostProcessor
getOrder, postProcess
-
Field Details
-
DEFAULT_PROPERTIES_RESOURCES_PATTERN
The resource pattern to load the properties resources.- See Also:
-
-
Constructor Details
-
SpringApplicationDefaultPropertiesPostProcessor
public SpringApplicationDefaultPropertiesPostProcessor()
-
-
Method Details
-
initializeResources
Initializes the default properties resources by adding theDEFAULT_PROPERTIES_RESOURCES_PATTERNwildcard 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:
initializeResourcesin interfaceDefaultPropertiesPostProcessor- Parameters:
defaultPropertiesResources- the mutable set to add resource patterns to
-