public class MapMergeDirectiveBeanPostProcessor
extends java.lang.Object
It creates a cache of MapMergeDirective bean definitions found in the system during its initialization. Then
each bean is checked if it should be modified by any of cached directives. If yes, we use
BeanDefinitionValueResolver (custom implementation of spring class) to create a object out of beanDefiniton
without creating a proper MapMergeDirective bean (this is impossible at this point as it would create
circular dependency). The representation of MapMergeDirective is then applied to target bean.
Forcing this BeanPostProcessor to load all MapMergeDirective 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.
| Constructor and Description |
|---|
MapMergeDirectiveBeanPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Creates cache of mapMergeDirective beanDefinitions.
|
protected boolean |
isSupportedClass(java.lang.String name) |
java.lang.Object |
postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName) |
java.lang.Object |
postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName) |
void |
setBeanFactory(BeanFactory beanFactory) |
protected boolean |
shouldApplyMergeDirectiveBean(java.lang.String beanName) |
public void setBeanFactory(BeanFactory beanFactory)
throws BeansException
BeansExceptionpublic void afterPropertiesSet()
throws java.lang.Exception
java.lang.Exceptionprotected boolean isSupportedClass(java.lang.String name)
public java.lang.Object postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName)
throws BeansException
BeansExceptionpublic java.lang.Object postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName)
throws BeansException
BeansExceptionprotected boolean shouldApplyMergeDirectiveBean(java.lang.String beanName)
Copyright © 2018 SAP SE. All Rights Reserved.