public abstract class AbstractRemoveBeanPostProcessor extends Object implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.context.ApplicationContextAware
Contains useful processing code for merge bean post processors. The BeanPostProcessor instances can be used to remove collection members from collections declared elsewhere. In effect, this allows an implementer to remove a bean that was declared in a collection (list, set or map) or previously merged via LateStageMergeBeanPostProcessor or EarlyStageMergeBeanPostProcessor.
This code demonstrates using one of the concrete implementations, LateStageRemoveBeanPostProcessor. The
basic usage pattern is to specify the id of the member you want to remove (beanRef) and the id
of the pre-existing, target collection (targetRef) that should receive the removal. The collection
can be represented using ListFactoryBean, SetFactoryBean or MapFactoryBean. For MapFactoryBeans, use either the
mapKey or mapKeyRef property instead to reference the map item to remove.
<bean class="org.broadleafcommerce.common.extensibility.context.merge.LateStageRemoveBeanPostProcessor">
<property name="beanRef" value="myBean"/>
<property name="targetRef" value="targetCollection"/>
</bean>
LateStageRemoveBeanPostProcessor,
EarlyStageRemoveBeanPostProcessor| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationContext |
applicationContext |
protected String |
beanRef |
protected String |
mapKey |
protected String |
mapKeyRef |
protected String |
targetRef |
| Constructor and Description |
|---|
AbstractRemoveBeanPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
String |
getBeanRef() |
String |
getMapKey() |
String |
getMapKeyRef() |
String |
getTargetRef() |
Object |
postProcessAfterInitialization(Object bean,
String beanName) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setBeanRef(String beanRef) |
void |
setMapKey(String mapKey) |
void |
setMapKeyRef(String mapKeyRef) |
void |
setTargetRef(String targetRef) |
protected String beanRef
protected String targetRef
protected String mapKey
protected String mapKeyRef
protected org.springframework.context.ApplicationContext applicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionpublic Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansExceptionpublic String getBeanRef()
public void setBeanRef(String beanRef)
public String getTargetRef()
public void setTargetRef(String targetRef)
public String getMapKey()
public void setMapKey(String mapKey)
public String getMapKeyRef()
public void setMapKeyRef(String mapKeyRef)
Copyright © 2014. All Rights Reserved.