类 PropertySourceUtils


  • public abstract class PropertySourceUtils
    extends Object
    Convenience class for manipulating PropertySources.
    另请参阅:
    PropertySource, PropertySources
    • 方法详细资料

      • getSubProperties

        public static Map<String,​ObjectgetSubProperties​(org.springframework.core.env.PropertySources propertySources,
                                                                String keyPrefix)
        Return a Map of all values from the specified PropertySources that start with a particular key.
        参数:
        propertySources - the property sources to scan
        keyPrefix - the key prefixes to test
        返回:
        a map of all sub properties starting with the specified key prefixes.
        另请参阅:
        getSubProperties(PropertySources, String, String)
      • getSubProperties

        public static Map<String,​ObjectgetSubProperties​(org.springframework.core.env.PropertySources propertySources,
                                                                String rootPrefix,
                                                                String keyPrefix)
        Return a Map of all values from the specified PropertySources that start with a particular key.
        参数:
        propertySources - the property sources to scan
        rootPrefix - a root prefix to be prepended to the keyPrefix (can be null)
        keyPrefix - the key prefixes to test
        返回:
        a map of all sub properties starting with the specified key prefixes.
        另请参阅:
        getSubProperties(PropertySources, String, String)