View Javadoc

1   /*
2    * $Id$
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.BridgeFactoryBean;
14  import org.mule.config.spring.parsers.processors.CheckExclusiveAttributes;
15  import org.mule.config.spring.parsers.processors.CheckExclusiveAttributesAndChildren;
16  import org.w3c.dom.Element;
17  
18  public class BridgeDefinitionParser extends AbstractFlowConstructDefinitionParser
19  {
20      public BridgeDefinitionParser()
21      {
22          super.registerPreProcessor(new CheckExclusiveAttributes(new String[][]{
23              new String[]{INBOUND_ADDRESS_ATTRIBUTE}, new String[]{INBOUND_ENDPOINT_REF_ATTRIBUTE}}));
24          
25          super.registerPreProcessor(new CheckExclusiveAttributes(new String[][]{
26              new String[]{OUTBOUND_ADDRESS_ATTRIBUTE}, new String[]{OUTBOUND_ENDPOINT_REF_ATTRIBUTE}}));
27          
28          super.registerPreProcessor(new CheckExclusiveAttributesAndChildren(new String[]{
29              INBOUND_ENDPOINT_REF_ATTRIBUTE, INBOUND_ADDRESS_ATTRIBUTE}, new String[]{INBOUND_ENDPOINT_CHILD}));
30          
31          super.registerPreProcessor(new CheckExclusiveAttributesAndChildren(new String[]{
32              OUTBOUND_ENDPOINT_REF_ATTRIBUTE, OUTBOUND_ADDRESS_ATTRIBUTE, TRANSFORMER_REFS_ATTRIBUTE,
33              RESPONSE_TRANSFORMER_REFS_ATTRIBUTE}, new String[]{OUTBOUND_ENDPOINT_CHILD}));
34      }
35  
36      @Override
37      protected Class<?> getBeanClass(Element element)
38      {
39          return BridgeFactoryBean.class;
40      }
41  }