Source Code Cross Referenced for AbstractHierarchicalDefinitionParser.java in  » ESB » mule » org » mule » config » spring » parsers » 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 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: AbstractHierarchicalDefinitionParser.java 10494 2008-01-23 21:09:56Z acooke $
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:        package org.mule.config.spring.parsers;
011:
012:        import org.mule.config.spring.parsers.assembly.BeanAssembler;
013:        import org.mule.config.spring.parsers.assembly.configuration.PropertyConfiguration;
014:        import org.mule.config.spring.parsers.assembly.configuration.ReusablePropertyConfiguration;
015:        import org.mule.config.spring.parsers.assembly.configuration.TempWrapperPropertyConfiguration;
016:        import org.mule.config.spring.util.SpringXMLUtils;
017:        import org.mule.util.StringUtils;
018:
019:        import org.springframework.beans.factory.config.BeanDefinition;
020:        import org.springframework.beans.factory.support.BeanDefinitionBuilder;
021:        import org.springframework.beans.factory.xml.ParserContext;
022:        import org.w3c.dom.Element;
023:
024:        /**
025:         * This definition parser introduces the notion of Hierarchical processing to nested XML elements. Definition
026:         * parsers that extend this can refer to parent beans.  It does not assume that the parser is restricted
027:         * to a single property.
028:         *
029:         * Calling classes must set the registry at the start of processing.
030:         *
031:         * @see org.mule.config.spring.parsers.generic.ChildDefinitionParser
032:         * @see org.mule.config.spring.parsers.collection.ChildMapEntryDefinitionParser.KeyValuePair
033:         * @see org.mule.config.spring.parsers.AbstractMuleBeanDefinitionParser
034:         */
035:        public abstract class AbstractHierarchicalDefinitionParser extends
036:                AbstractMuleBeanDefinitionParser {
037:
038:            private ReusablePropertyConfiguration targetPropertyConfiguration = new ReusablePropertyConfiguration(
039:                    new TempWrapperPropertyConfiguration(
040:                            beanPropertyConfiguration, false));
041:            private BeanDefinition forcedParent = null;
042:
043:            public PropertyConfiguration getTargetPropertyConfiguration() {
044:                return targetPropertyConfiguration;
045:            }
046:
047:            protected String getParentBeanName(Element element) {
048:                return ((Element) element.getParentNode())
049:                        .getAttribute(ATTRIBUTE_NAME);
050:            }
051:
052:            public BeanDefinition getParentBeanDefinition(Element element) {
053:                if (null != forcedParent) {
054:                    return forcedParent;
055:                } else {
056:                    String parentBean = getParentBeanName(element);
057:                    if (StringUtils.isBlank(parentBean)) {
058:                        throw new IllegalStateException("No parent for "
059:                                + SpringXMLUtils.elementToString(element));
060:                    }
061:                    return getRegistry().getBeanDefinition(parentBean);
062:                }
063:            }
064:
065:            /**
066:             * The bean assembler gives more reliable/automatic processing of collections, maps, etc.
067:             *
068:             * @param element The current element
069:             * @param bean The bean being constructed
070:             * @return An assembler that includes Mule-specific construction logic
071:             */
072:            protected BeanAssembler getBeanAssembler(Element element,
073:                    BeanDefinitionBuilder bean) {
074:                BeanDefinition target = getParentBeanDefinition(element);
075:                return getBeanAssemblerFactory().newBeanAssembler(
076:                        beanPropertyConfiguration, bean,
077:                        targetPropertyConfiguration, target);
078:            }
079:
080:            /**
081:             * Provide access to bean assembler from non-hierarchical case.  Legacy support for
082:             * "mixed" definition parsers.
083:             *
084:             * @deprecated
085:             * @param element
086:             * @param bean
087:             * @return
088:             */
089:            protected BeanAssembler getOrphanBeanAssembler(Element element,
090:                    BeanDefinitionBuilder bean) {
091:                return super .getBeanAssembler(element, bean);
092:            }
093:
094:            public void forceParent(BeanDefinition parent) {
095:                forcedParent = parent;
096:            }
097:
098:            protected void preProcess(Element element) {
099:                super .preProcess(element);
100:                targetPropertyConfiguration.reset();
101:            }
102:
103:            // reset the forced parent
104:            protected void postProcess(ParserContext context,
105:                    BeanAssembler assembler, Element element) {
106:                super.postProcess(context, assembler, element);
107:                forcedParent = null;
108:            }
109:
110:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.