View Javadoc

1   /*
2    * $Id: ValidatorDefinitionParser.java 20320 2010-11-24 15:03:31Z dfeist $
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.ValidatorFactoryBean;
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 ValidatorDefinitionParser extends AbstractFlowConstructDefinitionParser
19  {
20      public ValidatorDefinitionParser()
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}, new String[]{OUTBOUND_ENDPOINT_CHILD}));
33      }
34      @Override
35      protected Class<?> getBeanClass(Element element)
36      {
37          return ValidatorFactoryBean.class;
38      }
39  
40  }