Source Code Cross Referenced for DeferredEntityImpl.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:        /**
021:         * Entity nodes hold the reference data for an XML Entity -- either
022:         * parsed or unparsed. The nodeName (inherited from Node) will contain
023:         * the name (if any) of the Entity. Its data will be contained in the
024:         * Entity's children, in exactly the structure which an
025:         * EntityReference to this name will present within the document's
026:         * body.
027:         * <P>
028:         * Note that this object models the actual entity, _not_ the entity
029:         * declaration or the entity reference.
030:         * <P>
031:         * An XML processor may choose to completely expand entities before
032:         * the structure model is passed to the DOM; in this case, there will
033:         * be no EntityReferences in the DOM tree.
034:         * <P>
035:         * Quoting the 10/01 DOM Proposal,
036:         * <BLOCKQUOTE>
037:         * "The DOM Level 1 does not support editing Entity nodes; if a user
038:         * wants to make changes to the contents of an Entity, every related
039:         * EntityReference node has to be replaced in the structure model by
040:         * a clone of the Entity's contents, and then the desired changes
041:         * must be made to each of those clones instead. All the
042:         * descendants of an Entity node are readonly."
043:         * </BLOCKQUOTE>
044:         * I'm interpreting this as: It is the parser's responsibilty to call
045:         * the non-DOM operation setReadOnly(true,true) after it constructs
046:         * the Entity. Since the DOM explicitly decided not to deal with this,
047:         * _any_ answer will involve a non-DOM operation, and this is the
048:         * simplest solution.
049:         *
050:         * @xerces.internal
051:         *
052:         * @version $Id: DeferredEntityImpl.java 447266 2006-09-18 05:57:49Z mrglavas $
053:         * @since  PR-DOM-Level-1-19980818.
054:         */
055:        public class DeferredEntityImpl extends EntityImpl implements 
056:                DeferredNode {
057:
058:            //
059:            // Constants
060:            //
061:
062:            /** Serialization version. */
063:            static final long serialVersionUID = 4760180431078941638L;
064:
065:            //
066:            // Data
067:            //
068:
069:            /** Node index. */
070:            protected transient int fNodeIndex;
071:
072:            //
073:            // Constructors
074:            //
075:
076:            /**
077:             * This is the deferred constructor. Only the fNodeIndex is given here.
078:             * All other data, can be requested from the ownerDocument via the index.
079:             */
080:            DeferredEntityImpl(DeferredDocumentImpl ownerDocument, int nodeIndex) {
081:                super (ownerDocument, null);
082:
083:                fNodeIndex = nodeIndex;
084:                needsSyncData(true);
085:                needsSyncChildren(true);
086:
087:            } // <init>(DeferredDocumentImpl,int)
088:
089:            //
090:            // DeferredNode methods
091:            //
092:
093:            /** Returns the node index. */
094:            public int getNodeIndex() {
095:                return fNodeIndex;
096:            }
097:
098:            //
099:            // Protected methods
100:            //
101:
102:            /**
103:             * Synchronize the entity data. This is special because of the way
104:             * that the "fast" version stores the information.
105:             */
106:            protected void synchronizeData() {
107:
108:                // no need to sychronize again
109:                needsSyncData(false);
110:
111:                // get the node data
112:                DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) this .ownerDocument;
113:                name = ownerDocument.getNodeName(fNodeIndex);
114:
115:                // get the entity data
116:                publicId = ownerDocument.getNodeValue(fNodeIndex);
117:                systemId = ownerDocument.getNodeURI(fNodeIndex);
118:                int extraDataIndex = ownerDocument.getNodeExtra(fNodeIndex);
119:                ownerDocument.getNodeType(extraDataIndex);
120:
121:                notationName = ownerDocument.getNodeName(extraDataIndex);
122:
123:                // encoding and version DOM L3
124:                version = ownerDocument.getNodeValue(extraDataIndex);
125:                encoding = ownerDocument.getNodeURI(extraDataIndex);
126:
127:                // baseURI, actualEncoding DOM L3
128:                int extraIndex2 = ownerDocument.getNodeExtra(extraDataIndex);
129:                baseURI = ownerDocument.getNodeName(extraIndex2);
130:                inputEncoding = ownerDocument.getNodeValue(extraIndex2);
131:
132:            } // synchronizeData()
133:
134:            /** Synchronize the children. */
135:            protected void synchronizeChildren() {
136:
137:                // no need to synchronize again
138:                needsSyncChildren(false);
139:
140:                isReadOnly(false);
141:                DeferredDocumentImpl ownerDocument = (DeferredDocumentImpl) ownerDocument();
142:                ownerDocument.synchronizeChildren(this , fNodeIndex);
143:                setReadOnly(true, true);
144:
145:            } // synchronizeChildren()
146:
147:        } // class DeferredEntityImpl
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.