org.springframework.boot.bind

Class PropertySourcesBinder



  • public class PropertySourcesBinder
    extends Object
    Helper extracting info from PropertySources.
    Since:
    1.4.0
    Author:
    Stephane Nicoll
    • Constructor Detail

      • PropertySourcesBinder

        public PropertySourcesBinder(org.springframework.core.env.PropertySources propertySources)
        Create a new instance.
        Parameters:
        propertySources - the PropertySources to use
      • PropertySourcesBinder

        public PropertySourcesBinder(org.springframework.core.env.PropertySource<?> propertySource)
        Create a new instance from a single PropertySource.
        Parameters:
        propertySource - the PropertySource to use
      • PropertySourcesBinder

        public PropertySourcesBinder(org.springframework.core.env.ConfigurableEnvironment environment)
        Create a new instance using the Environment as the property sources.
        Parameters:
        environment - the environment
    • Method Detail

      • setPropertySources

        public void setPropertySources(org.springframework.core.env.PropertySources propertySources)
      • getPropertySources

        public org.springframework.core.env.PropertySources getPropertySources()
      • setConversionService

        public void setConversionService(org.springframework.core.convert.ConversionService conversionService)
      • getConversionService

        public org.springframework.core.convert.ConversionService getConversionService()
      • extractAll

        public Map<String,Object> extractAll(String prefix)
        Extract the keys using the specified prefix. The prefix won't be included.

        Any key that starts with the prefix will be included.

        Parameters:
        prefix - the prefix to use
        Returns:
        the keys matching the prefix
      • bindTo

        public void bindTo(String prefix,
                           Object target)
        Bind the specified target from the environment using the prefix.

        Any key that starts with the prefix will be bound to the target.

        Parameters:
        prefix - the prefix to use
        target - the object to bind to

Copyright © 2019 Pivotal Software, Inc.. All rights reserved.