org.springframework.boot.env

Class PropertiesPropertySourceLoader

  • java.lang.Object
    • org.springframework.boot.env.PropertiesPropertySourceLoader
  • All Implemented Interfaces:
    PropertySourceLoader


    public class PropertiesPropertySourceLoader
    extends java.lang.Object
    implements PropertySourceLoader
    Strategy to load '.properties' files into a PropertySource.
    Since:
    1.0.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String[] getFileExtensions()
      Returns the file extensions that the loader supports (excluding the '.').
      java.util.List<org.springframework.core.env.PropertySource<?>> load(java.lang.String name, org.springframework.core.io.Resource resource)
      Load the resource into one or more property sources.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertiesPropertySourceLoader

        public PropertiesPropertySourceLoader()
    • Method Detail

      • getFileExtensions

        public java.lang.String[] getFileExtensions()
        Description copied from interface: PropertySourceLoader
        Returns the file extensions that the loader supports (excluding the '.').
        Specified by:
        getFileExtensions in interface PropertySourceLoader
        Returns:
        the file extensions
      • load

        public java.util.List<org.springframework.core.env.PropertySource<?>> load(java.lang.String name,
                                                                                   org.springframework.core.io.Resource resource)
                                                                            throws java.io.IOException
        Description copied from interface: PropertySourceLoader
        Load the resource into one or more property sources. Implementations may either return a list containing a single source, or in the case of a multi-document format such as yaml a source for each document in the resource.
        Specified by:
        load in interface PropertySourceLoader
        Parameters:
        name - the root name of the property source. If multiple documents are loaded an additional suffix should be added to the name for each source loaded.
        resource - the resource to load
        Returns:
        a list property sources
        Throws:
        java.io.IOException - if the source cannot be loaded