Source Code Cross Referenced for DeferredDocumentTypeImpl.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:        package org.apache.xerces.dom;
019:
020:        import org.w3c.dom.Node;
021:
022:        /**
023:         * This class represents a Document Type <em>declaraction</em> in
024:         * the document itself, <em>not</em> a Document Type Definition (DTD).
025:         * An XML document may (or may not) have such a reference.
026:         * <P>
027:         * DocumentType is an Extended DOM feature, used in XML documents but
028:         * not in HTML.
029:         * <P>
030:         * Note that Entities and Notations are no longer children of the
031:         * DocumentType, but are parentless nodes hung only in their
032:         * appropriate NamedNodeMaps.
033:         * <P>
034:         * This area is UNDERSPECIFIED IN REC-DOM-Level-1-19981001
035:         * Most notably, absolutely no provision was made for storing
036:         * and using Element and Attribute information. Nor was the linkage
037:         * between Entities and Entity References nailed down solidly.
038:         * 
039:         * @xerces.internal 
040:         *
041:         * @version $Id: DeferredDocumentTypeImpl.java 447266 2006-09-18 05:57:49Z mrglavas $
042:         * @since  PR-DOM-Level-1-19980818.
043:         */
044:        public class DeferredDocumentTypeImpl extends DocumentTypeImpl
045:                implements  DeferredNode {
046:
047:            //
048:            // Constants
049:            //
050:
051:            /** Serialization version. */
052:            static final long serialVersionUID = -2172579663227313509L;
053:
054:            //
055:            // Data
056:            //
057:
058:            /** Node index. */
059:            protected transient int fNodeIndex;
060:
061:            //
062:            // Constructors
063:            //
064:
065:            /**
066:             * This is the deferred constructor. Only the fNodeIndex is given here.
067:             * All other data, can be requested from the ownerDocument via the index.
068:             */
069:            DeferredDocumentTypeImpl(DeferredDocumentImpl ownerDocument,
070:                    int nodeIndex) {
071:                super (ownerDocument, null);
072:
073:                fNodeIndex = nodeIndex;
074:                needsSyncData(true);
075:                needsSyncChildren(true);
076:
077:            } // <init>(DeferredDocumentImpl,int)
078:
079:            //
080:            // DeferredNode methods
081:            //
082:
083:            /** Returns the node index. */
084:            public int getNodeIndex() {
085:                return fNodeIndex;
086:            }
087:
088:            //
089:            // Protected methods
090:            //
091:
092:            /** Synchronizes the data (name and value) for fast nodes. */
093:            protected void synchronizeData() {
094:
095:                // no need to sync in the future
096:                needsSyncData(false);
097:
098:                // fluff data
099:                DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) this .ownerDocument;
100:                name = ownerDocument.getNodeName(fNodeIndex);
101:
102:                // public and system ids
103:                publicID = ownerDocument.getNodeValue(fNodeIndex);
104:                systemID = ownerDocument.getNodeURI(fNodeIndex);
105:                int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex);
106:                internalSubset = ownerDocument.getNodeValue(extraDataIndex);
107:            } // synchronizeData()
108:
109:            /** Synchronizes the entities, notations, and elements. */
110:            protected void synchronizeChildren() {
111:
112:                // we don't want to generate any event for this so turn them off
113:                boolean orig = ownerDocument().getMutationEvents();
114:                ownerDocument().setMutationEvents(false);
115:
116:                // no need to synchronize again
117:                needsSyncChildren(false);
118:
119:                // create new node maps
120:                DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) this .ownerDocument;
121:
122:                entities = new NamedNodeMapImpl(this );
123:                notations = new NamedNodeMapImpl(this );
124:                elements = new NamedNodeMapImpl(this );
125:
126:                // fill node maps
127:                DeferredNode last = null;
128:                for (int index = ownerDocument.getLastChild(fNodeIndex); index != -1; index = ownerDocument
129:                        .getPrevSibling(index)) {
130:
131:                    DeferredNode node = ownerDocument.getNodeObject(index);
132:                    int type = node.getNodeType();
133:                    switch (type) {
134:
135:                    // internal, external, and unparsed entities
136:                    case Node.ENTITY_NODE: {
137:                        entities.setNamedItem(node);
138:                        break;
139:                    }
140:
141:                        // notations
142:                    case Node.NOTATION_NODE: {
143:                        notations.setNamedItem(node);
144:                        break;
145:                    }
146:
147:                        // element definitions
148:                    case NodeImpl.ELEMENT_DEFINITION_NODE: {
149:                        elements.setNamedItem(node);
150:                        break;
151:                    }
152:
153:                        // elements
154:                    case Node.ELEMENT_NODE: {
155:                        if (((DocumentImpl) getOwnerDocument()).allowGrammarAccess) {
156:                            insertBefore(node, last);
157:                            last = node;
158:                            break;
159:                        }
160:                    }
161:
162:                        // NOTE: Should never get here! -Ac
163:                    default: {
164:                        System.out.println("DeferredDocumentTypeImpl"
165:                                + "#synchronizeInfo: "
166:                                + "node.getNodeType() = " + node.getNodeType()
167:                                + ", class = " + node.getClass().getName());
168:                    }
169:                    }
170:                }
171:
172:                // set mutation events flag back to its original value
173:                ownerDocument().setMutationEvents(orig);
174:
175:                // set entities and notations read_only per DOM spec
176:                setReadOnly(true, false);
177:
178:            } // synchronizeChildren()
179:
180:        } // class DeferredDocumentTypeImpl
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.