Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.core.env
Class CompositePropertySource

    java.lang.Object
      org.springframework.core.env.PropertySource<java.lang.Object>
          org.springframework.core.env.CompositePropertySource

    public class CompositePropertySource

extends PropertySource<java.lang.Object>

Composite `PropertySource` implementation that iterates over a set of `PropertySource` instances. Necessary in cases where multiple property sources share the same name, e.g. when multiple values are supplied to `@PropertySource`.

Since:
  3.1.1
Author:
  Chris Beams

Nested Class Summary

Nested classes/interfaces inherited from class org.springframework.core.env.PropertySource
`PropertySource.StubPropertySource`

Field Summary

Fields inherited from class org.springframework.core.env.PropertySource
`logger, name, source`

Constructor Summary
`CompositePropertySource(java.lang.String name)` Create a new `CompositePropertySource`.

Method Summary
`void` | `addPropertySource(PropertySource<?> propertySource)`
`java.lang.Object` | `getProperty(java.lang.String name)` Return the value associated with the given name, `null` if not found.
`java.lang.String` | `toString()` Produce concise output (type and name) if the current log level does not include debug.

Methods inherited from class org.springframework.core.env.PropertySource
`containsProperty, equals, getName, getSource, hashCode, named`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### CompositePropertySource

    public CompositePropertySource(java.lang.String name)

  Create a new `CompositePropertySource`.

  Parameters:
    `name` - the name of the property source

Method Detail

### getProperty

    public java.lang.Object getProperty(java.lang.String name)

  Description copied from class: `PropertySource`
  Return the value associated with the given name, `null` if not found.

  Specified by:
    `getProperty` in class `PropertySource<java.lang.Object>`
  Parameters:
    `name` - the property to find
  See Also:
    `PropertyResolver.getRequiredProperty(String)`

### addPropertySource

    public void addPropertySource(PropertySource<?> propertySource)

### toString

    public java.lang.String toString()

  Description copied from class: `PropertySource`
  Produce concise output (type and name) if the current log level does not include debug. If debug is enabled, produce verbose output including hashcode of the PropertySource instance and every name/value property pair. This variable verbosity is useful as a property source such as system properties or environment variables may contain an arbitrary number of property pairs, potentially leading to difficult to read exception and log messages.

  Overrides:
    `toString` in class `PropertySource<java.lang.Object>`
  See Also:
    `Log.isDebugEnabled()`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD