Source Code Cross Referenced for ElementDeclImpl.java in  » Database-DBMS » Ozone-1.1 » org » ozoneDB » xml » 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 » Database DBMS » Ozone 1.1 » org.ozoneDB.xml.dom 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * org/ozone-db/xml/dom/ElementDeclImpl.java
003:         *
004:         * The contents of this file are subject to the OpenXML Public
005:         * License Version 1.0; you may not use this file except in compliance
006:         * with the License. You may obtain a copy of the License at
007:         * http://www.openxml.org/license.html
008:         *
009:         * THIS SOFTWARE IS DISTRIBUTED ON AN "AS IS" BASIS WITHOUT WARRANTY
010:         * OF ANY KIND, EITHER EXPRESSED OR IMPLIED. THE INITIAL DEVELOPER
011:         * AND ALL CONTRIBUTORS SHALL NOT BE LIABLE FOR ANY DAMAGES AS A
012:         * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
013:         * DERIVATIVES. SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING
014:         * RIGHTS AND LIMITATIONS UNDER THE LICENSE.
015:         *
016:         * The Initial Developer of this code under the License is Assaf Arkin.
017:         * Portions created by Assaf Arkin are Copyright (C) 1998, 1999.
018:         * All Rights Reserved.
019:         */
020:
021:        /**
022:         * Changes for Persistent DOM running with ozone are
023:         * Copyright 1999 by SMB GmbH. All rights reserved.
024:         */package org.ozoneDB.xml.dom;
025:
026:        import org.w3c.dom.*;
027:
028:        /**
029:         * @version $Revision: 1.1 $ $Date: 2001/12/18 11:03:24 $
030:         * @author <a href="mailto:arkin@trendline.co.il">Assaf Arkin</a>
031:         * @see org.w3c.dom.Node
032:         * @see NodeImpl
033:         */
034:        public class ElementDeclImpl extends NodeImpl implements 
035:                ElementDeclProxy {
036:
037:            final static long serialVersionUID = 1;
038:
039:            public short getNodeType() {
040:                return ELEMENT_DECL_NODE;
041:            }
042:
043:            public String getName() {
044:                return getNodeName();
045:            }
046:
047:            public synchronized boolean equals(Object other) {
048:                /*
049:                EntityProxy otherX;
050:
051:                // Test for node equality (this covers entity name and all its children)
052:                // and then test for specific entity qualities.
053:                if (super.equals (other)) {
054:                    otherX = (EntityProxy) other;
055:                    return (getPublicId ().equals (otherX.getPublicId ()) &&
056:                            getSystemId ().equals (otherX.getSystemId ()) &&
057:                            getNotation ().equals (otherX.getNotation ()));
058:                    }
059:                 */
060:                return false;
061:            }
062:
063:            /**
064:             * Returns true if element is empty. An empty element cannot contain any
065:             * children and must be specified with an empty tag, or an opening tag
066:             * immediately followed by a closing tag.
067:             *
068:             * @return True if element is empty
069:             */
070:            public boolean isEmpty() {
071:                return _empty;
072:            }
073:
074:            /**
075:             * Returns true if element may contain any child elements and character data
076:             * in any order.
077:             *
078:             * @return True if element supports any contents
079:             */
080:            public boolean isAny() {
081:                return _any;
082:            }
083:
084:            /**
085:             * Returns true if element contains mixed contents. Mixed contents includes
086:             * both elements and character data in any particular order. This option
087:             * implies that both {@link #isEmpty} and {@link #isAny} return false.
088:             * If all three are false, then contents is subject to exact order.
089:             *
090:             * @return True if element contains mixed contents
091:             */
092:            public boolean isMixed() {
093:                return _mixed;
094:            }
095:
096:            /**
097:             * Returns true if the opening tag is optional. Even if the opening tag is
098:             * missing from the document for this element, the document is still valid.
099:             * This option only relates to HTML document, and implies that {@link
100:             * #requiresClosingTag} is also true.
101:             *
102:             * @return True if opening tag is optional
103:             */
104:            public boolean requiresOpeningTag() {
105:                return _optionalOpen;
106:            }
107:
108:            /**
109:             * Returns true if the closing tag is optional. Even if the closing tag is
110:             * missing from the document for this element, the document is still valid.
111:             * This option only relates to HTML document.
112:             *
113:             * @return True if closing tag is optional
114:             */
115:            public boolean requiresClosingTag() {
116:                return _optionalClose;
117:            }
118:
119:            public final Object clone() {
120:                ElementDeclProxy clone = null;
121:                try {
122:                    clone = (ElementDeclProxy) database().createObject(
123:                            ElementDeclImpl.class.getName());
124:                    ((NodeProxy) clone).init(_ownerDocument, getNodeName(),
125:                            null, true);
126:                    cloneInto((NodeProxy) clone, true);
127:                } catch (Exception except) {
128:                    throw new DOMExceptionImpl(DOMExceptionImpl.PDOM_ERR,
129:                            except.getMessage());
130:                }
131:                return clone;
132:            }
133:
134:            public final Node cloneNode(boolean deep) {
135:                ElementDeclProxy clone = null;
136:                try {
137:                    clone = (ElementDeclProxy) database().createObject(
138:                            ElementDeclImpl.class.getName());
139:                    ((NodeProxy) clone).init(_ownerDocument, getNodeName(),
140:                            null, true);
141:                    cloneInto((NodeProxy) clone, deep);
142:                } catch (Exception except) {
143:                    throw new DOMExceptionImpl(DOMExceptionImpl.PDOM_ERR,
144:                            except.getMessage());
145:                }
146:                return clone;
147:            }
148:
149:            /**
150:             * Constructor requires owner document, element name and its definition.
151:             *
152:             * @param owner The owner document
153:             * @param name The element name
154:             * @param definition The element definition
155:             */
156:            ElementDeclImpl(DocumentImpl owner, String name, String definition) {
157:                this (owner, name, definition, false, false);
158:            }
159:
160:            /**
161:             * Constructor requires owner document, element name and its definition.
162:             * The flags for optional opening and closing tag are supported only for
163:             * HTML documents.
164:             *
165:             * @param owner The owner document
166:             * @param name The element name
167:             * @param definition The element definition
168:             * @param optionalOpen The opening tag is optional
169:             * @param optionalClose The closing tag is optional
170:             */
171:            ElementDeclImpl(DocumentImpl owner, String name, String definition,
172:                    boolean optionalOpen, boolean optionalClose) {
173:                super (owner, name, null, true);
174:                _optionalOpen = optionalOpen;
175:                if (_optionalOpen) {
176:                    _optionalClose = true;
177:                } else {
178:                    _optionalClose = optionalClose;
179:                }
180:                if (definition.equals("EMPTY")) {
181:                    _empty = true;
182:                } else if (definition.equals("ANY")) {
183:                    _any = true;
184:                } else {
185:                }
186:            }
187:
188:            private ElementDeclImpl(DocumentImpl owner, String name) {
189:                super (owner, name, null, true);
190:            }
191:
192:            /**
193:             * Indicates that the opening tag is optional: even if missing from the
194:             * document, the document is still valid. Applies only to HTML documents.
195:             * Also implies that {@link #_optionalClose} is true.
196:             */
197:            private boolean _optionalOpen;
198:
199:            /**
200:             * Indicates that the closing tag is optional: even if missing from the
201:             * document, the document is still valid. Applies only to HTML documents.
202:             */
203:            private boolean _optionalClose;
204:
205:            /**
206:             * Indicates that the element is empty.
207:             */
208:            private boolean _empty;
209:
210:            /**
211:             * Indicates that the element can contain any child elements of any type
212:             * and any order.
213:             */
214:            private boolean _any;
215:
216:            /**
217:             * Indicates that the element contains mixed contents. Mixed contents
218:             * includes both elements and character data in any particular order.
219:             */
220:            private boolean _mixed;
221:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.