org.springframework.boot.config
Class YamlPropertySourceLoader

java.lang.Object
  extended by org.springframework.boot.config.PropertiesPropertySourceLoader
      extended by org.springframework.boot.config.YamlPropertySourceLoader
All Implemented Interfaces:
PropertySourceLoader

public class YamlPropertySourceLoader
extends PropertiesPropertySourceLoader

Strategy to load '.yml' files into a PropertySource.

Author:
Dave Syer

Constructor Summary
YamlPropertySourceLoader(YamlProcessor.DocumentMatcher... matchers)
          Create a YamlPropertySourceLoader instance with the specified matchers.
 
Method Summary
protected  Properties loadProperties(org.springframework.core.io.Resource resource)
           
static YamlPropertySourceLoader matchAllLoader()
          A property source loader that loads all properties and matches all documents.
static YamlPropertySourceLoader springProfileAwareLoader(String[] activeProfiles)
          A property source loader that matches documents that have no explicit profile or which have an explicit "spring.profiles.active" value in the current active profiles.
 boolean supports(org.springframework.core.io.Resource resource)
          Returns true if the Resource is supported.
 
Methods inherited from class org.springframework.boot.config.PropertiesPropertySourceLoader
load
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YamlPropertySourceLoader

public YamlPropertySourceLoader(YamlProcessor.DocumentMatcher... matchers)
Create a YamlPropertySourceLoader instance with the specified matchers.

Parameters:
matchers - the document matchers
Method Detail

supports

public boolean supports(org.springframework.core.io.Resource resource)
Description copied from interface: PropertySourceLoader
Returns true if the Resource is supported.

Specified by:
supports in interface PropertySourceLoader
Overrides:
supports in class PropertiesPropertySourceLoader
Returns:
if the resource is supported

loadProperties

protected Properties loadProperties(org.springframework.core.io.Resource resource)
                             throws IOException
Overrides:
loadProperties in class PropertiesPropertySourceLoader
Throws:
IOException

matchAllLoader

public static YamlPropertySourceLoader matchAllLoader()
A property source loader that loads all properties and matches all documents.

Returns:
a property source loader

springProfileAwareLoader

public static YamlPropertySourceLoader springProfileAwareLoader(String[] activeProfiles)
A property source loader that matches documents that have no explicit profile or which have an explicit "spring.profiles.active" value in the current active profiles.

Parameters:
activeProfiles - the active profiles to match independent of file contents
Returns:
a property source loader


Copyright © 2013. All Rights Reserved.