View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.config.spring.parsers.specific;
8   
9   import org.mule.config.spring.factories.FlowRefFactoryBean;
10  import org.mule.config.spring.parsers.generic.AutoIdUtils;
11  import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
12  
13  import org.springframework.beans.factory.support.BeanDefinitionBuilder;
14  import org.springframework.beans.factory.xml.ParserContext;
15  import org.w3c.dom.Element;
16  
17  public class FlowRefDefinitionParser extends ChildDefinitionParser
18  {
19  
20      public FlowRefDefinitionParser()
21      {
22          super("messageProcessor", FlowRefFactoryBean.class);
23      }
24  
25      @Override
26      protected void parseChild(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
27      {
28          super.parseChild(element, parserContext, builder);
29      }
30  
31      public String getBeanName(Element element)
32      {
33          return AutoIdUtils.uniqueValue("flow-ref." + element.getAttribute(ATTRIBUTE_NAME));
34      }
35  
36      @Override
37      protected void checkElementNameUnique(Element element)
38      {
39          // We want to check element name exists
40      }
41  
42  }