org.onebusaway.container.spring
public class OverridePostProcessor extends Object implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.core.PriorityOrdered, org.springframework.beans.factory.BeanFactoryAware
BeanPostProcessor
that allows one to set and override bean
properties in a flexible ways before the bean is initialized. This is similar
to the functionality of PropertyOverrideConfigurer
, except that it is
a Spring bean post processor as opposed to a factory bean, which determines
execution order in the application context construction lifecycle and allows
one to use bean references for overriding bean properties as opposed to just
string values.
A simple example:
<bean class="org.onebusaway.container.spring.OverridePostProcessor"> <property name="map"> <map> <entry key="beanName.beanProperty" value ="someOtherBeanName" /> </map> </property> </bean>
Constructor and Description |
---|
OverridePostProcessor() |
Modifier and Type | Method and Description |
---|---|
int |
getOrder() |
Object |
postProcessAfterInitialization(Object bean,
String beanName) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setMap(Map<String,String> map) |
void |
setOrder(int order) |
public void setOrder(int order)
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessBeforeInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
Copyright © 2014 OneBusAway. All Rights Reserved.