Source Code Cross Referenced for AbstractDelegatingDefinitionParser.java in  » ESB » mule » org » mule » config » spring » parsers » delegate » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ESB » mule » org.mule.config.spring.parsers.delegate 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: AbstractDelegatingDefinitionParser.java 10790 2008-02-12 20:53:32Z dfeist $
003:         * --------------------------------------------------------------------------------------
004:         * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
005:         *
006:         * The software in this package is published under the terms of the CPAL v1.0
007:         * license, a copy of which has been included with this distribution in the
008:         * LICENSE.txt file.
009:         */
010:
011:        package org.mule.config.spring.parsers.delegate;
012:
013:        import org.mule.config.spring.parsers.MuleDefinitionParser;
014:        import org.mule.config.spring.parsers.MuleDefinitionParserConfiguration;
015:        import org.mule.config.spring.parsers.PostProcessor;
016:        import org.mule.config.spring.parsers.PreProcessor;
017:        import org.mule.config.spring.parsers.assembly.configuration.ValueMap;
018:        import org.mule.config.spring.parsers.generic.AutoIdUtils;
019:        import org.mule.config.spring.MuleHierarchicalBeanDefinitionParserDelegate;
020:        import org.mule.util.ArrayUtils;
021:
022:        import java.util.Map;
023:
024:        import org.springframework.beans.factory.support.AbstractBeanDefinition;
025:        import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser;
026:        import org.springframework.beans.factory.xml.ParserContext;
027:        import org.w3c.dom.Element;
028:
029:        /**
030:         * This allows a definition parsers to be dynamically represented by different
031:         * definition parsers, depending on the context.  For example, a single model may
032:         * be defined across file - the first use defines the model and subsequent uses
033:         * extend it (for this particular case, see {@link InheritDefinitionParser}).
034:         *
035:         * <p>Note that the sub-parsers must be consistent.  That includes matching the
036:         * same schema, for example.</p>
037:         */
038:        public abstract class AbstractDelegatingDefinitionParser extends
039:                AbstractBeanDefinitionParser implements  MuleDefinitionParser {
040:
041:            private MuleDefinitionParser[] delegates;
042:
043:            protected AbstractDelegatingDefinitionParser() {
044:                this (new MuleDefinitionParser[0]);
045:            }
046:
047:            protected AbstractDelegatingDefinitionParser(
048:                    MuleDefinitionParser[] delegates) {
049:                this .delegates = delegates;
050:                addBeanFlag(MuleHierarchicalBeanDefinitionParserDelegate.MULE_FORCE_RECURSE);
051:            }
052:
053:            protected AbstractBeanDefinition parseInternal(Element element,
054:                    ParserContext parserContext) {
055:                return muleParse(element, parserContext);
056:            }
057:
058:            protected MuleDefinitionParserConfiguration addDelegate(
059:                    MuleDefinitionParser delegate) {
060:                delegates = (MuleDefinitionParser[]) ArrayUtils.add(delegates,
061:                        delegate);
062:                return delegate;
063:            }
064:
065:            protected int size() {
066:                return delegates.length;
067:            }
068:
069:            protected MuleDefinitionParser getDelegate(int index) {
070:                return delegates[index];
071:            }
072:
073:            public MuleDefinitionParserConfiguration registerPreProcessor(
074:                    PreProcessor preProcessor) {
075:                for (int i = 0; i < delegates.length; ++i) {
076:                    delegates[i].registerPreProcessor(preProcessor);
077:                }
078:                return this ;
079:            }
080:
081:            public MuleDefinitionParserConfiguration registerPostProcessor(
082:                    PostProcessor postProcessor) {
083:                for (int i = 0; i < delegates.length; ++i) {
084:                    delegates[i].registerPostProcessor(postProcessor);
085:                }
086:                return this ;
087:            }
088:
089:            public MuleDefinitionParserConfiguration addReference(
090:                    String propertyName) {
091:                for (int i = 0; i < delegates.length; ++i) {
092:                    delegates[i].addReference(propertyName);
093:                }
094:                return this ;
095:            }
096:
097:            public MuleDefinitionParserConfiguration addMapping(
098:                    String propertyName, Map mappings) {
099:                for (int i = 0; i < delegates.length; ++i) {
100:                    delegates[i].addMapping(propertyName, mappings);
101:                }
102:                return this ;
103:            }
104:
105:            public MuleDefinitionParserConfiguration addMapping(
106:                    String propertyName, String mappings) {
107:                for (int i = 0; i < delegates.length; ++i) {
108:                    delegates[i].addMapping(propertyName, mappings);
109:                }
110:                return this ;
111:            }
112:
113:            public MuleDefinitionParserConfiguration addMapping(
114:                    String propertyName, ValueMap mappings) {
115:                for (int i = 0; i < delegates.length; ++i) {
116:                    delegates[i].addMapping(propertyName, mappings);
117:                }
118:                return this ;
119:            }
120:
121:            public MuleDefinitionParserConfiguration addAlias(String alias,
122:                    String propertyName) {
123:                for (int i = 0; i < delegates.length; ++i) {
124:                    delegates[i].addAlias(alias, propertyName);
125:                }
126:                return this ;
127:            }
128:
129:            public MuleDefinitionParserConfiguration addCollection(
130:                    String propertyName) {
131:                for (int i = 0; i < delegates.length; ++i) {
132:                    delegates[i].addCollection(propertyName);
133:                }
134:                return this ;
135:            }
136:
137:            public MuleDefinitionParserConfiguration addIgnored(
138:                    String propertyName) {
139:                for (int i = 0; i < delegates.length; ++i) {
140:                    delegates[i].addIgnored(propertyName);
141:                }
142:                return this ;
143:            }
144:
145:            public MuleDefinitionParserConfiguration removeIgnored(
146:                    String propertyName) {
147:                for (int i = 0; i < delegates.length; ++i) {
148:                    delegates[i].removeIgnored(propertyName);
149:                }
150:                return this ;
151:            }
152:
153:            public MuleDefinitionParserConfiguration setIgnoredDefault(
154:                    boolean ignoreAll) {
155:                for (int i = 0; i < delegates.length; ++i) {
156:                    delegates[i].setIgnoredDefault(ignoreAll);
157:                }
158:                return this ;
159:            }
160:
161:            public String getBeanName(Element element) {
162:                return AutoIdUtils.getUniqueName(element, "delegate");
163:            }
164:
165:            public MuleDefinitionParserConfiguration addBeanFlag(String flag) {
166:                for (int i = 0; i < delegates.length; ++i) {
167:                    delegates[i].addBeanFlag(flag);
168:                }
169:                return this;
170:            }
171:
172:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.