From 553930a9f027299b3e51824175b80da0f4a32c3f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 12 Sep 2014 16:51:49 +0200 Subject: [PATCH] CompositePropertySource allows for access to its nested property sources Issue: SPR-12182 --- .../core/env/CompositePropertySource.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring-core/src/main/java/org/springframework/core/env/CompositePropertySource.java b/spring-core/src/main/java/org/springframework/core/env/CompositePropertySource.java index 29cb735f997..6ce1d0d7794 100644 --- a/spring-core/src/main/java/org/springframework/core/env/CompositePropertySource.java +++ b/spring-core/src/main/java/org/springframework/core/env/CompositePropertySource.java @@ -17,6 +17,7 @@ package org.springframework.core.env; import java.util.ArrayList; +import java.util.Collection; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -75,6 +76,14 @@ public class CompositePropertySource extends PropertySource { this.propertySources.addAll(existing); } + /** + * Return all property sources that this composite source holds. + * @since 4.1.1 + */ + public Collection> getPropertySources() { + return this.propertySources; + } + @Override public String toString() { return String.format("%s [name='%s', propertySources=%s]",