Package org.red5.spring
Class ExtendedPropertyPlaceholderConfigurer
java.lang.Object
org.springframework.core.io.support.PropertiesLoaderSupport
org.springframework.beans.factory.config.PropertyResourceConfigurer
org.springframework.beans.factory.config.PlaceholderConfigurerSupport
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
org.red5.spring.ExtendedPropertyPlaceholderConfigurer
- All Implemented Interfaces:
Aware,BeanFactoryAware,BeanNameAware,BeanFactoryPostProcessor,Ordered,PriorityOrdered
An extension of
PropertyPlaceholderConfigurer. Provides runtime additions of properties and wildcard location lookups.
Properties can be added at runtime by using the static addGlobalProperty(java.lang.String, java.lang.String) before* the bean definition is instantiated in the ApplicationContext. A property added by addGlobalProperty(java.lang.String, java.lang.String) will get merged into properties specified by the bean definition, overriding keys that overlap.
wildcard locations can be used instead of locations, if both are declared the last will override. Wildcard locations are handled by setWildcardLocations(String[]), using PathMatchingResourcePatternResolver for matching locations. For wildcard locations that matches multiple Properties files, they are merged in by alphabetical filename order.- Author:
- Michael Guymon ([email protected])
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Propertiesprivate static org.slf4j.Loggerprivate PropertiesFields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDEFields inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport
DEFAULT_ESCAPE_CHARACTER, DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, escapeCharacter, ignoreUnresolvablePlaceholders, nullValue, placeholderPrefix, placeholderSuffix, trimValues, valueSeparatorFields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
localOverride, localPropertiesFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddGlobalProperty(String key, String val) Add a global property to be mergedprivate static PropertiesCopy of the manual propertiesprotected voidprocessProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) voidsetWildcardLocations(String[] locations) String[] of wildcard locations of properties that are converted to Resource[] using usingPathMatchingResourcePatternResolverMethods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
resolvePlaceholder, resolvePlaceholder, resolveSystemProperty, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeNameMethods inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport
doProcessProperties, setBeanFactory, setBeanName, setEscapeCharacter, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setTrimValues, setValueSeparatorMethods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertProperty, convertPropertyValue, getOrder, postProcessBeanFactory, setOrderMethods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
-
Field Details
-
logger
private static org.slf4j.Logger logger -
globalPlaceholderProperties
-
mergedProperties
-
-
Constructor Details
-
ExtendedPropertyPlaceholderConfigurer
public ExtendedPropertyPlaceholderConfigurer()
-
-
Method Details
-
processProperties
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws BeansException - Overrides:
processPropertiesin classPropertyPlaceholderConfigurer- Throws:
BeansException
-
getMergedProperties
MergedPropertiescreated byprocessProperties(org.springframework.beans.factory.config.ConfigurableListableBeanFactory, java.util.Properties)- Returns:
Properties
-
setWildcardLocations
String[] of wildcard locations of properties that are converted to Resource[] using usingPathMatchingResourcePatternResolver- Parameters:
locations- String[]- Throws:
IOException- on IO exception
-
addGlobalProperty
Add a global property to be merged- Parameters:
key- Stringval- String
-
copyOfGlobalProperties
Copy of the manual properties- Returns:
Properties
-