Source Code Cross Referenced for DeferredElementNSImpl.java in  » XML » xerces-2_9_1 » org » apache » xerces » dom » 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 » XML » xerces 2_9_1 » org.apache.xerces.dom 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        /*
019:         * WARNING: because java doesn't support multi-inheritance some code is
020:         * duplicated. If you're changing this file you probably want to change
021:         * DeferredElementImpl.java at the same time.
022:         *
023:         * @version $Id: DeferredElementNSImpl.java 447266 2006-09-18 05:57:49Z mrglavas $
024:         */
025:
026:        package org.apache.xerces.dom;
027:
028:        import org.apache.xerces.xs.XSTypeDefinition;
029:        import org.w3c.dom.NamedNodeMap;
030:
031:        /**
032:         * DeferredElementNSImpl is to ElementNSImpl, what DeferredElementImpl is to
033:         * ElementImpl. 
034:         * 
035:         * @xerces.internal
036:         * 
037:         * @see DeferredElementImpl
038:         */
039:        public class DeferredElementNSImpl extends ElementNSImpl implements 
040:                DeferredNode {
041:
042:            //
043:            // Constants
044:            //
045:
046:            /** Serialization version. */
047:            static final long serialVersionUID = -5001885145370927385L;
048:
049:            //
050:            // Data
051:            //
052:
053:            /** Node index. */
054:            protected transient int fNodeIndex;
055:
056:            //
057:            // Constructors
058:            //
059:
060:            /**
061:             * This is the deferred constructor. Only the fNodeIndex is given here. All
062:             * other data, can be requested from the ownerDocument via the index.
063:             */
064:            DeferredElementNSImpl(DeferredDocumentImpl ownerDoc, int nodeIndex) {
065:                super (ownerDoc, null);
066:
067:                fNodeIndex = nodeIndex;
068:                needsSyncChildren(true);
069:
070:            } // <init>(DocumentImpl,int)
071:
072:            //
073:            // DeferredNode methods
074:            //
075:
076:            /** Returns the node index. */
077:            public final int getNodeIndex() {
078:                return fNodeIndex;
079:            }
080:
081:            //
082:            // Protected methods
083:            //
084:
085:            /** Synchronizes the data (name and value) for fast nodes. */
086:            protected final void synchronizeData() {
087:
088:                // no need to sync in the future
089:                needsSyncData(false);
090:
091:                // fluff data
092:                DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) this .ownerDocument;
093:
094:                // we don't want to generate any event for this so turn them off
095:                boolean orig = ownerDocument.mutationEvents;
096:                ownerDocument.mutationEvents = false;
097:
098:                name = ownerDocument.getNodeName(fNodeIndex);
099:
100:                // extract local part from QName
101:                int index = name.indexOf(':');
102:                if (index < 0) {
103:                    localName = name;
104:                } else {
105:                    localName = name.substring(index + 1);
106:                }
107:
108:                namespaceURI = ownerDocument.getNodeURI(fNodeIndex);
109:                type = (XSTypeDefinition) ownerDocument.getTypeInfo(fNodeIndex);
110:
111:                // attributes
112:                setupDefaultAttributes();
113:                int attrIndex = ownerDocument.getNodeExtra(fNodeIndex);
114:                if (attrIndex != -1) {
115:                    NamedNodeMap attrs = getAttributes();
116:                    boolean seenSchemaDefault = false;
117:                    do {
118:                        AttrImpl attr = (AttrImpl) ownerDocument
119:                                .getNodeObject(attrIndex);
120:                        // Take special care of schema defaulted attributes. Calling the 
121:                        // non-namespace aware setAttributeNode() method could overwrite
122:                        // another attribute with the same local name.
123:                        if (!attr.getSpecified()
124:                                && (seenSchemaDefault || (attr
125:                                        .getNamespaceURI() != null && attr
126:                                        .getName().indexOf(':') < 0))) {
127:                            seenSchemaDefault = true;
128:                            attrs.setNamedItemNS(attr);
129:                        } else {
130:                            attrs.setNamedItem(attr);
131:                        }
132:                        attrIndex = ownerDocument.getPrevSibling(attrIndex);
133:                    } while (attrIndex != -1);
134:                }
135:
136:                // set mutation events flag back to its original value
137:                ownerDocument.mutationEvents = orig;
138:
139:            } // synchronizeData()
140:
141:            /**
142:             * Synchronizes the node's children with the internal structure.
143:             * Fluffing the children at once solves a lot of work to keep
144:             * the two structures in sync. The problem gets worse when
145:             * editing the tree -- this makes it a lot easier.
146:             */
147:            protected final void synchronizeChildren() {
148:                DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) ownerDocument();
149:                ownerDocument.synchronizeChildren(this , fNodeIndex);
150:            } // synchronizeChildren()
151:
152:        } // class DeferredElementImpl
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.