public interface BeanAssembler
A bean assembly contains a bean (the thing we are constructing), a target (where we put the bean once it is ready) and appropriate configuration information (there is a configuration for both bean and target, but currently they are set to the same instance by the classes that use this).
Modifier and Type | Method and Description |
---|---|
void |
copyBeanToTarget()
Copy the properties from the bean we have been building into the target (typically
the parent bean).
|
void |
extendBean(Attr attribute)
Add a property defined by an attribute to the bean we are constructing.
|
void |
extendBean(String newName,
Object newValue,
boolean isReference)
Allow direct access to bean for more complex cases
|
void |
extendTarget(Attr attribute)
Add a property defined by an attribute to the parent of the bean we are constructing.
|
void |
extendTarget(String newName,
Object newValue,
boolean isReference)
Allow direct access to target for more complex cases
|
void |
extendTarget(String oldName,
String newName,
Object newValue) |
org.springframework.beans.factory.support.BeanDefinitionBuilder |
getBean() |
org.springframework.beans.factory.config.BeanDefinition |
getTarget() |
void |
insertBeanInTarget(String oldName)
Insert the bean we have built into the target (typically the parent bean).
|
void |
insertSingletonBeanInTarget(String propertyName,
String singletonName) |
void |
setBeanFlag(String flag)
Set a flag on the bean - this is used to communicate with
MuleHierarchicalBeanDefinitionParserDelegate |
org.springframework.beans.factory.support.BeanDefinitionBuilder getBean()
org.springframework.beans.factory.config.BeanDefinition getTarget()
void extendBean(Attr attribute)
Since an attribute value is always a string, we don't have to deal with complex types
here - the only issue is whether or not we have a reference. References are detected
by explicit annotation or by the "-ref" at the end of an attribute name. We do not
check the Spring repo to see if a name already exists since that could lead to
unpredictable behaviour.
(see PropertyConfiguration
)
attribute
- The attribute to addvoid extendBean(String newName, Object newValue, boolean isReference)
newName
- The property name to addnewValue
- The property value to addisReference
- If true, a bean reference is added (and newValue must be a String)void extendTarget(Attr attribute)
This is unusual. Normally you want extendBean(org.w3c.dom.Attr)
.
attribute
- The attribute to addvoid extendTarget(String newName, Object newValue, boolean isReference)
newName
- The property name to addnewValue
- The property value to addisReference
- If true, a bean reference is added (and newValue must be a String)void insertBeanInTarget(String oldName)
This is the most complex case because the bean can have an arbitrary type.
oldName
- The identifying the bean (typically element name).void insertSingletonBeanInTarget(String propertyName, String singletonName)
void copyBeanToTarget()
This assumes that the source bean has been constructed correctly (ie the decisions about what is ignored, a map, a list, etc) have already been made. All it does (apart from a direct copy) is merge collections with those on the target when necessary.
void setBeanFlag(String flag)
MuleHierarchicalBeanDefinitionParserDelegate
flag
- The flag to setCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.