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.module.ws.config.spring.parsers.specific;
8   
9   import org.mule.config.spring.parsers.processors.CheckExclusiveAttributes;
10  import org.mule.config.spring.parsers.processors.CheckExclusiveAttributesAndChildren;
11  import org.mule.config.spring.parsers.specific.AbstractFlowConstructDefinitionParser;
12  import org.mule.module.ws.config.spring.factories.WSProxyFactoryBean;
13  import org.w3c.dom.Element;
14  
15  public class WSProxyDefinitionParser extends AbstractFlowConstructDefinitionParser
16  {
17      private static final String WSDL_FILE_ATTRIBUTE = "wsdlFile";
18      private static final String WSDL_LOCATION_ATTRIBUTE = "wsdlLocation";
19  
20      public WSProxyDefinitionParser()
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 CheckExclusiveAttributes(new String[][]{
29              new String[]{WSDL_LOCATION_ATTRIBUTE}, new String[]{WSDL_FILE_ATTRIBUTE}}));
30  
31          super.registerPreProcessor(new CheckExclusiveAttributesAndChildren(new String[]{
32              INBOUND_ENDPOINT_REF_ATTRIBUTE, INBOUND_ADDRESS_ATTRIBUTE}, new String[]{INBOUND_ENDPOINT_CHILD}));
33  
34          super.registerPreProcessor(new CheckExclusiveAttributesAndChildren(new String[]{
35              OUTBOUND_ENDPOINT_REF_ATTRIBUTE, OUTBOUND_ADDRESS_ATTRIBUTE, TRANSFORMER_REFS_ATTRIBUTE,
36              RESPONSE_TRANSFORMER_REFS_ATTRIBUTE}, new String[]{OUTBOUND_ENDPOINT_CHILD}));
37      }
38  
39      @Override
40      protected Class<?> getBeanClass(Element element)
41      {
42          return WSProxyFactoryBean.class;
43      }
44  }