View Javadoc

1   /*
2    * $Id: ServiceDefinitionParser.java 13129 2008-10-24 15:31:16Z aperepel $
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;
12  
13  import org.mule.config.spring.factories.FlowRefFactoryBean;
14  import org.mule.config.spring.parsers.generic.AutoIdUtils;
15  import org.mule.config.spring.parsers.generic.ChildDefinitionParser;
16  
17  import org.springframework.beans.factory.support.BeanDefinitionBuilder;
18  import org.springframework.beans.factory.xml.ParserContext;
19  import org.w3c.dom.Element;
20  
21  public class FlowRefDefinitionParser extends ChildDefinitionParser
22  {
23  
24      public FlowRefDefinitionParser()
25      {
26          super("messageProcessors", FlowRefFactoryBean.class);
27          addCollection("messageProcessors");
28      }
29  
30      @Override
31      protected void parseChild(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
32      {
33          super.parseChild(element, parserContext, builder);
34      }
35  
36      public String getBeanName(Element element)
37      {
38          return AutoIdUtils.uniqueValue("flow-ref." + element.getAttribute(ATTRIBUTE_NAME));
39      }
40  
41      @Override
42      protected void checkElementNameUnique(Element element)
43      {
44          // We want to check element name exists
45      }
46  
47  }