Source Code Cross Referenced for ParserContext.java in  » J2EE » spring-framework-2.5 » org » springframework » beans » factory » xml » 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 » J2EE » spring framework 2.5 » org.springframework.beans.factory.xml 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002-2007 the original author or authors.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.springframework.beans.factory.xml;
018:
019:        import java.util.Stack;
020:
021:        import org.springframework.beans.factory.config.BeanDefinition;
022:        import org.springframework.beans.factory.parsing.BeanComponentDefinition;
023:        import org.springframework.beans.factory.parsing.ComponentDefinition;
024:        import org.springframework.beans.factory.parsing.CompositeComponentDefinition;
025:        import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
026:        import org.springframework.beans.factory.support.BeanDefinitionRegistry;
027:
028:        /**
029:         * Context that gets passed along a bean definition parsing process,
030:         * encapsulating all relevant configuration as well as state.
031:         * Nested inside an {@link XmlReaderContext}.
032:         *
033:         * @author Rob Harrop
034:         * @author Juergen Hoeller
035:         * @since 2.0
036:         * @see XmlReaderContext
037:         * @see BeanDefinitionParserDelegate
038:         */
039:        public final class ParserContext {
040:
041:            private final XmlReaderContext readerContext;
042:
043:            private final BeanDefinitionParserDelegate delegate;
044:
045:            private BeanDefinition containingBeanDefinition;
046:
047:            private final Stack containingComponents = new Stack();
048:
049:            public ParserContext(XmlReaderContext readerContext,
050:                    BeanDefinitionParserDelegate delegate) {
051:                this .readerContext = readerContext;
052:                this .delegate = delegate;
053:            }
054:
055:            public ParserContext(XmlReaderContext readerContext,
056:                    BeanDefinitionParserDelegate delegate,
057:                    BeanDefinition containingBeanDefinition) {
058:
059:                this .readerContext = readerContext;
060:                this .delegate = delegate;
061:                this .containingBeanDefinition = containingBeanDefinition;
062:            }
063:
064:            public final XmlReaderContext getReaderContext() {
065:                return this .readerContext;
066:            }
067:
068:            public final BeanDefinitionRegistry getRegistry() {
069:                return this .readerContext.getRegistry();
070:            }
071:
072:            public final BeanDefinitionParserDelegate getDelegate() {
073:                return this .delegate;
074:            }
075:
076:            public final BeanDefinition getContainingBeanDefinition() {
077:                return this .containingBeanDefinition;
078:            }
079:
080:            public final boolean isNested() {
081:                return (this .containingBeanDefinition != null);
082:            }
083:
084:            public boolean isDefaultLazyInit() {
085:                return BeanDefinitionParserDelegate.TRUE_VALUE
086:                        .equals(this .delegate.getDefaults().getLazyInit());
087:            }
088:
089:            public Object extractSource(Object sourceCandidate) {
090:                return this .readerContext.extractSource(sourceCandidate);
091:            }
092:
093:            public CompositeComponentDefinition getContainingComponent() {
094:                return (!this .containingComponents.isEmpty() ? (CompositeComponentDefinition) this .containingComponents
095:                        .lastElement()
096:                        : null);
097:            }
098:
099:            public void pushContainingComponent(
100:                    CompositeComponentDefinition containingComponent) {
101:                this .containingComponents.push(containingComponent);
102:            }
103:
104:            public CompositeComponentDefinition popContainingComponent() {
105:                return (CompositeComponentDefinition) this .containingComponents
106:                        .pop();
107:            }
108:
109:            public void popAndRegisterContainingComponent() {
110:                registerComponent(popContainingComponent());
111:            }
112:
113:            public void registerComponent(ComponentDefinition component) {
114:                CompositeComponentDefinition containingComponent = getContainingComponent();
115:                if (containingComponent != null) {
116:                    containingComponent.addNestedComponent(component);
117:                } else {
118:                    this .readerContext.fireComponentRegistered(component);
119:                }
120:            }
121:
122:            public void registerBeanComponent(BeanComponentDefinition component) {
123:                BeanDefinitionReaderUtils.registerBeanDefinition(component,
124:                        getRegistry());
125:                registerComponent(component);
126:            }
127:
128:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.