类 PropertySourcesLoader

    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      Set<String>getAllFileExtensions()
      Returns all file extensions that could be loaded.
      org.springframework.core.env.MutablePropertySourcesgetPropertySources()
      Return the MutablePropertySources being loaded.
      org.springframework.core.env.PropertySource<?>load​(org.springframework.core.io.Resource resource)
      Load the specified resource (if possible) and add it as the first source.
      org.springframework.core.env.PropertySource<?>load​(org.springframework.core.io.Resource resource, String profile)
      Load the profile-specific properties from the specified resource (if any) and add it as the first source.
      org.springframework.core.env.PropertySource<?>load​(org.springframework.core.io.Resource resource, String name, String profile)
      Load the profile-specific properties from the specified resource (if any), give the name provided and add it as the first source.
      org.springframework.core.env.PropertySource<?>load​(org.springframework.core.io.Resource resource, String group, String name, String profile)
      Load the profile-specific properties from the specified resource (if any), give the name provided and add it to a group of property sources identified by the group name.
    • 构造器详细资料

      • PropertySourcesLoader

        public PropertySourcesLoader​(org.springframework.core.env.MutablePropertySources propertySources)
        Create a new PropertySourceLoader instance backed by the specified MutablePropertySources.
        参数:
        propertySources - the destination property sources
    • 方法详细资料

      • load

        public org.springframework.core.env.PropertySource<?> load​(org.springframework.core.io.Resource resource)
                                                            throws IOException
        Load the specified resource (if possible) and add it as the first source.
        参数:
        resource - the source resource (may be null).
        返回:
        the loaded property source or null
        抛出:
        IOException - if the source cannot be loaded
      • load

        public org.springframework.core.env.PropertySource<?> load​(org.springframework.core.io.Resource resource,
                                                                   String profile)
                                                            throws IOException
        Load the profile-specific properties from the specified resource (if any) and add it as the first source.
        参数:
        resource - the source resource (may be null).
        profile - a specific profile to load or null to load the default.
        返回:
        the loaded property source or null
        抛出:
        IOException - if the source cannot be loaded
      • load

        public org.springframework.core.env.PropertySource<?> load​(org.springframework.core.io.Resource resource,
                                                                   String name,
                                                                   String profile)
                                                            throws IOException
        Load the profile-specific properties from the specified resource (if any), give the name provided and add it as the first source.
        参数:
        resource - the source resource (may be null).
        name - the root property name (may be null).
        profile - a specific profile to load or null to load the default.
        返回:
        the loaded property source or null
        抛出:
        IOException - if the source cannot be loaded
      • load

        public org.springframework.core.env.PropertySource<?> load​(org.springframework.core.io.Resource resource,
                                                                   String group,
                                                                   String name,
                                                                   String profile)
                                                            throws IOException
        Load the profile-specific properties from the specified resource (if any), give the name provided and add it to a group of property sources identified by the group name. Property sources are added to the end of a group, but new groups are added as the first in the chain being assembled. This means the normal sequence of calls is to first create the group for the default (null) profile, and then add specific groups afterwards (with the highest priority last). Property resolution from the resulting sources will consider all keys for a given group first and then move to the next group.
        参数:
        resource - the source resource (may be null).
        group - an identifier for the group that this source belongs to
        name - the root property name (may be null).
        profile - a specific profile to load or null to load the default.
        返回:
        the loaded property source or null
        抛出:
        IOException - if the source cannot be loaded
      • getPropertySources

        public org.springframework.core.env.MutablePropertySources getPropertySources()
        Return the MutablePropertySources being loaded.
        返回:
        the property sources