org.riotfamily.common.beans.config
Class PlaceholderWithDefaultConfigurer
java.lang.Object
org.springframework.core.io.support.PropertiesLoaderSupport
org.springframework.beans.factory.config.PropertyResourceConfigurer
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer
org.riotfamily.common.beans.config.PropertiesPlaceholderConfigurer
org.riotfamily.common.beans.config.PlaceholderWithDefaultConfigurer
- All Implemented Interfaces:
- BeanFactoryAware, BeanNameAware, BeanFactoryPostProcessor, Ordered, PriorityOrdered, ServletContextAware
public class PlaceholderWithDefaultConfigurer
- extends PropertiesPlaceholderConfigurer
PropertyPlaceholderConfigurer that allows to define inline default values.
Example:
<bean class="org.riotfamily.example.HelloWorld">
<property name="message" value="${hello.message=Hello World}" />
</bean>
Since Riot 7.0 you can specify null
as default value:
<bean class="org.riotfamily.example.HelloWorld">
<property name="message" value="${hello.message=}" />
</bean>
Please note the the trailing equals sign. If omitted, the behavior will
depend on the setting of the ignoreUnresolvablePlaceholders
flag.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_VALUE_SEPARATOR
public static final String DEFAULT_VALUE_SEPARATOR
- See Also:
- Constant Field Values
PlaceholderWithDefaultConfigurer
public PlaceholderWithDefaultConfigurer()
setValueSeparator
public void setValueSeparator(String valueSeparator)
setBeanName
public void setBeanName(String beanName)
- Specified by:
setBeanName
in interface BeanNameAware
- Overrides:
setBeanName
in class PropertyPlaceholderConfigurer
setBeanFactory
public void setBeanFactory(BeanFactory beanFactory)
- Specified by:
setBeanFactory
in interface BeanFactoryAware
- Overrides:
setBeanFactory
in class PropertyPlaceholderConfigurer
processProperties
protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
Properties props)
throws BeansException
- Overrides:
processProperties
in class PropertyPlaceholderConfigurer
- Throws:
BeansException
resolvePlaceholder
protected String resolvePlaceholder(String placeholder,
Properties props,
int systemPropertiesMode)
- Overrides:
resolvePlaceholder
in class PropertyPlaceholderConfigurer