Class PropertySourcesUtils
java.lang.Object
com.alibaba.cloud.commons.context.support.PropertySourcesUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]getPropertyNames(org.springframework.core.env.PropertySource propertySource) Get the property names as the array from the specifiedPropertySourceinstance.getSubProperties(Iterable<org.springframework.core.env.PropertySource<?>> propertySources, String prefix) Get SubProperties.getSubProperties(org.springframework.core.env.ConfigurableEnvironment environment, String prefix) Get SubProperties.getSubProperties(org.springframework.core.env.PropertySources propertySources, String prefix) Get prefixedProperties.getSubProperties(org.springframework.core.env.PropertySources propertySources, org.springframework.core.env.PropertyResolver propertyResolver, String prefix) Get prefixedProperties.static StringnormalizePrefix(String prefix) Normalize the prefix.
-
Field Details
-
EMPTY_STRING_ARRAY
Empty String array.
-
-
Method Details
-
getSubProperties
public static Map<String,Object> getSubProperties(Iterable<org.springframework.core.env.PropertySource<?>> propertySources, String prefix) Get SubProperties.- Parameters:
propertySources-PropertySourceIterable.prefix- the prefix of property name.- Returns:
- Map
- See Also:
-
getSubProperties
public static Map<String,Object> getSubProperties(org.springframework.core.env.ConfigurableEnvironment environment, String prefix) Get SubProperties.- Parameters:
environment-ConfigurableEnvironment.prefix- the prefix of property name.- Returns:
- Map
- See Also:
-
normalizePrefix
Normalize the prefix.- Parameters:
prefix- the prefix.- Returns:
- the prefix.
-
getSubProperties
public static Map<String,Object> getSubProperties(org.springframework.core.env.PropertySources propertySources, String prefix) Get prefixedProperties.- Parameters:
propertySources-PropertySources.prefix- the prefix of property name.- Returns:
- Map
- See Also:
-
getSubProperties
public static Map<String,Object> getSubProperties(org.springframework.core.env.PropertySources propertySources, org.springframework.core.env.PropertyResolver propertyResolver, String prefix) Get prefixedProperties.- Parameters:
propertySources-PropertySources.propertyResolver-PropertyResolverto resolve the placeholder if present.prefix- the prefix of property name.- Returns:
- Map
- See Also:
-
getPropertyNames
Get the property names as the array from the specifiedPropertySourceinstance.- Parameters:
propertySource-PropertySourceinstance.- Returns:
- non-null
-