View Javadoc

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