Coverage Report - org.mule.config.spring.parsers.specific.properties.NestedMapWithAttributesDefinitionParser
 
Classes in this File Line Coverage Branch Coverage Complexity
NestedMapWithAttributesDefinitionParser
0%
0/4
N/A
1
 
 1  
 /*
 2  
  * $Id: NestedMapWithAttributesDefinitionParser.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.specific.properties;
 12  
 
 13  
 import org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser;
 14  
 import org.mule.config.spring.parsers.assembly.MapEntryCombiner;
 15  
 import org.mule.config.spring.parsers.collection.ChildSingletonMapDefinitionParser;
 16  
 import org.mule.config.spring.parsers.delegate.AbstractSingleParentFamilyDefinitionParser;
 17  
 import org.mule.config.spring.parsers.generic.AttributePropertiesDefinitionParser;
 18  
 import org.mule.config.spring.parsers.processors.AddAttribute;
 19  
 
 20  
 /**
 21  
  * This generates a nested map (an element of the parent map, with the key "mapKey", which is a map itself)
 22  
  * and then adds any attributes as name/value pairs.  Embedded elements can then insert further entries using
 23  
  * {@link org.mule.config.spring.parsers.collection.ChildSingletonMapDefinitionParser} or, if the entry is
 24  
  * just a simple value, {@link org.mule.config.spring.parsers.specific.properties.SimplePropertyDefinitionParser}.
 25  
  * The target setter is {@link org.mule.config.spring.parsers.assembly.MapEntryCombiner#VALUE}.
 26  
  */
 27  
 public class NestedMapWithAttributesDefinitionParser extends AbstractSingleParentFamilyDefinitionParser
 28  
 {
 29  
 
 30  
     public NestedMapWithAttributesDefinitionParser(String mapSetter, String mapKey)
 31  0
     {
 32  0
         addDelegate(new ChildSingletonMapDefinitionParser(mapSetter))
 33  
                 .addCollection(mapSetter)
 34  
                 .setIgnoredDefault(true)
 35  
                 .removeIgnored(MapEntryCombiner.KEY)
 36  
                 .registerPreProcessor(new AddAttribute(MapEntryCombiner.KEY, mapKey));
 37  0
         addChildDelegate(new AttributePropertiesDefinitionParser(MapEntryCombiner.VALUE))
 38  
                 .addIgnored(AbstractMuleBeanDefinitionParser.ATTRIBUTE_NAME)
 39  
                 .addIgnored(MapEntryCombiner.KEY);
 40  0
     }
 41  
 
 42  
 }
 43