Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AttributeMapBeanAssembler |
|
| 1.0;1 |
1 | /* | |
2 | * $Id: AttributeMapBeanAssembler.java 19191 2010-08-25 21:05:23Z tcarlson $ | |
3 | * -------------------------------------------------------------------------------------- | |
4 | * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com | |
5 | * | |
6 | * The software in this package is published under the terms of the CPAL v1.0 | |
7 | * license, a copy of which has been included with this distribution in the | |
8 | * LICENSE.txt file. | |
9 | */ | |
10 | ||
11 | package org.mule.config.spring.parsers.assembly; | |
12 | ||
13 | import org.mule.config.spring.parsers.assembly.configuration.PropertyConfiguration; | |
14 | ||
15 | import org.springframework.beans.factory.config.BeanDefinition; | |
16 | import org.springframework.beans.factory.support.BeanDefinitionBuilder; | |
17 | ||
18 | /** | |
19 | * This can be used inside a {@link org.mule.config.spring.parsers.generic.ChildDefinitionParser} - it | |
20 | * takes named properties and, instead of inserting them individually on the target, it packages them as | |
21 | * a Map and inserts that. | |
22 | */ | |
23 | public class AttributeMapBeanAssembler extends AbstractMapBeanAssembler | |
24 | { | |
25 | ||
26 | public AttributeMapBeanAssembler(PropertyConfiguration beanConfig, BeanDefinitionBuilder bean, | |
27 | PropertyConfiguration targetConfig, BeanDefinition target) | |
28 | { | |
29 | 0 | super(beanConfig, bean, targetConfig, target); |
30 | 0 | } |
31 | ||
32 | /** | |
33 | * We override this method to insert a map instead of the definition. | |
34 | */ | |
35 | public void insertBeanInTarget(String oldName) | |
36 | { | |
37 | 0 | assertTargetPresent(); |
38 | 0 | insertDefinitionAsMap(oldName); |
39 | 0 | } |
40 | ||
41 | } |