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.delegate;
8   
9   import org.mule.config.spring.parsers.MuleDefinitionParser;
10  import org.mule.config.spring.parsers.MuleDefinitionParserConfiguration;
11  import org.mule.config.spring.parsers.PostProcessor;
12  import org.mule.config.spring.parsers.PreProcessor;
13  import org.mule.config.spring.parsers.assembly.configuration.ValueMap;
14  
15  import java.util.Map;
16  
17  import org.springframework.beans.factory.support.AbstractBeanDefinition;
18  import org.springframework.beans.factory.xml.ParserContext;
19  import org.w3c.dom.Element;
20  
21  /**
22   * Support for extending a
23   * {@link org.mule.config.spring.parsers.MuleDefinitionParser} without
24   * needing to subclass.
25   */
26  public abstract class AbstractPluggableDelegate implements MuleDefinitionParser
27  {
28  
29      private MuleDefinitionParser delegate;
30  
31      public AbstractPluggableDelegate(MuleDefinitionParser delegate)
32      {
33          this.delegate = delegate;
34      }
35  
36      public AbstractBeanDefinition muleParse(Element element, ParserContext parserContext)
37      {
38          return delegate.muleParse(element, parserContext);
39      }
40  
41      public MuleDefinitionParserConfiguration registerPreProcessor(PreProcessor preProcessor)
42      {
43          delegate.registerPreProcessor(preProcessor);
44          return this;
45      }
46  
47      public MuleDefinitionParserConfiguration registerPostProcessor(PostProcessor postProcessor)
48      {
49          delegate.registerPostProcessor(postProcessor);
50          return this;
51      }
52  
53      public MuleDefinitionParserConfiguration addReference(String propertyName)
54      {
55          delegate.addReference(propertyName);
56          return this;
57      }
58  
59      public MuleDefinitionParserConfiguration addMapping(String propertyName, Map mappings)
60      {
61          delegate.addMapping(propertyName, mappings);
62          return this;
63      }
64  
65      public MuleDefinitionParserConfiguration addMapping(String propertyName, String mappings)
66      {
67          delegate.addMapping(propertyName, mappings);
68          return this;
69      }
70  
71      public MuleDefinitionParserConfiguration addMapping(String propertyName, ValueMap mappings)
72      {
73          delegate.addMapping(propertyName, mappings);
74          return this;
75      }
76  
77      public MuleDefinitionParserConfiguration addAlias(String alias, String propertyName)
78      {
79          delegate.addAlias(alias, propertyName);
80          return this;
81      }
82  
83      public MuleDefinitionParserConfiguration addCollection(String propertyName)
84      {
85          delegate.addCollection(propertyName);
86          return this;
87      }
88  
89      public MuleDefinitionParserConfiguration addIgnored(String propertyName)
90      {
91          delegate.addIgnored(propertyName);
92          return this;
93      }
94  
95      public MuleDefinitionParserConfiguration removeIgnored(String propertyName)
96      {
97          delegate.removeIgnored(propertyName);
98          return this;
99      }
100 
101     public MuleDefinitionParserConfiguration setIgnoredDefault(boolean ignoreAll)
102     {
103         delegate.setIgnoredDefault(ignoreAll);
104         return this;
105     }
106 
107     public void setDeprecationWarning(String deprecationWarning)
108     {
109         delegate.setDeprecationWarning(deprecationWarning);
110     }
111 }