类 PropertySourcesBinder

    • 构造器详细资料

      • PropertySourcesBinder

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

        public PropertySourcesBinder​(org.springframework.core.env.PropertySource<?> propertySource)
        Create a new instance from a single PropertySource.
        参数:
        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.
        参数:
        environment - the environment
    • 方法详细资料

      • 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,​ObjectextractAll​(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.

        参数:
        prefix - the prefix to use
        返回:
        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.

        参数:
        prefix - the prefix to use
        target - the object to bind to