Top Description Fields Constructors Methods
org.springframework.core.io.support

public Class PropertySourceProcessor

extends Object
Class Inheritance
Imports
java.io.FileNotFoundException, .IOException, java.lang.reflect.Constructor, java.net.SocketException, .UnknownHostException, java.util.ArrayList, .List, org.apache.commons.logging.Log, .LogFactory, org.springframework.core.env.CompositePropertySource, .ConfigurableEnvironment, .Environment, .MutablePropertySources, .PropertySource, org.springframework.core.io.Resource, .ResourceLoader, org.springframework.lang.Nullable, org.springframework.util.Assert, .ReflectionUtils

Contribute property sources to the Environment.

This class is stateful and merges descriptors with the same name in a single PropertySource rather than creating dedicated ones.

Authors
Stephane Nicoll, Sam Brannen, Juergen Hoeller
Since
6.0
See Also
PropertySourceDescriptor

Field Summary

Modifier and TypeField and Description
private static final PropertySourceFactory
private final ConfigurableEnvironment
private static final Log
private final List<String>
private final ResourcePatternResolver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addPropertySource(PropertySource<?> propertySource)

private static PropertySourceFactory
private static boolean
isIgnorableException(Throwable ex)

Determine if the supplied exception can be ignored according to ignoreResourceNotFound semantics.

public void
processPropertySource(PropertySourceDescriptor
the descriptor to process
descriptor
)

Process the specified PropertySourceDescriptor against the environment managed by this instance.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

defaultPropertySourceFactoryback to summary
private static final PropertySourceFactory defaultPropertySourceFactory
environmentback to summary
private final ConfigurableEnvironment environment
loggerback to summary
private static final Log logger
propertySourceNamesback to summary
private final List<String> propertySourceNames
resourcePatternResolverback to summary
private final ResourcePatternResolver resourcePatternResolver

Constructor Detail

PropertySourceProcessorback to summary
public PropertySourceProcessor(ConfigurableEnvironment environment, ResourceLoader resourceLoader)

Method Detail

addPropertySourceback to summary
private void addPropertySource(PropertySource<?> propertySource)
instantiateClassback to summary
private static PropertySourceFactory instantiateClass(Class<? extends PropertySourceFactory> type)
isIgnorableExceptionback to summary
private static boolean isIgnorableException(Throwable ex)

Determine if the supplied exception can be ignored according to ignoreResourceNotFound semantics.

processPropertySourceback to summary
public void processPropertySource(PropertySourceDescriptor descriptor) throws IOException

Process the specified PropertySourceDescriptor against the environment managed by this instance.

Parameters
descriptor:PropertySourceDescriptor

the descriptor to process

Exceptions
IOException:
if loading the properties failed