public class ListMergeDirectiveBeanPostProcessor extends Object
It process all instances of ListMergeDirective beans and applies modification stored in those beans to given
objects. If for some reasons (lazyInit) ListMergeDirective is not instanciated then this post processor will
not get triggered which may lead to some nasty bugs.
Forcing this BeanPostProcessor to load all ListMergeDirective instances during its initialization (via
dependency injection or by extracting them form ApplicationContext) will lead to change in order in which beans are
intialized. Especially some beans will be instanciated before other BeanPostProcessors which may highly affect
stability of the system, so its a bad idea.
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
ListMergeDirectiveBeanPostProcessor.ListMergeDirectiveProcessor |
| Constructor and Description |
|---|
ListMergeDirectiveBeanPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected ApplicationContext |
getApplicationContext() |
protected ConfigurableListableBeanFactory |
getBeanFactory() |
protected List<Object> |
getListByDependency(String directiveBeanName,
String dependency) |
protected List<Object> |
getListByPropertyDescriptor(Object bean,
String propertyDescriptor,
String directiveBeanName,
String dependency) |
protected List<Object> |
getListByReflection(Object bean,
String fieldName,
String directiveBeanName,
String dependency) |
void |
init() |
Object |
postProcessAfterInitialization(Object bean,
String beanName) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
protected List<Object> |
resolveListBean(ListMergeDirective lmd,
String directiveBeanName,
String dependency) |
void |
setApplicationContext(ApplicationContext applicationContext) |
void |
setBeanFactory(BeanFactory beanFactory) |
@PostConstruct public void init()
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException
BeansExceptionpublic Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException
BeansExceptionprotected List<Object> resolveListBean(ListMergeDirective lmd, String directiveBeanName, String dependency)
protected List<Object> getListByDependency(String directiveBeanName, String dependency)
protected List<Object> getListByPropertyDescriptor(Object bean, String propertyDescriptor, String directiveBeanName, String dependency)
protected List<Object> getListByReflection(Object bean, String fieldName, String directiveBeanName, String dependency)
protected ConfigurableListableBeanFactory getBeanFactory()
public void setBeanFactory(BeanFactory beanFactory)
throws BeansException
BeansExceptionprotected ApplicationContext getApplicationContext()
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException
BeansExceptionCopyright © 2017 SAP SE. All Rights Reserved.