Source Code Cross Referenced for ChildNode.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:         * ChildNode inherits from NodeImpl and adds the capability of being a child by
024:         * having references to its previous and next siblings.
025:         * 
026:         * @xerces.internal 
027:         *
028:         * @version $Id: ChildNode.java 447266 2006-09-18 05:57:49Z mrglavas $
029:         */
030:        public abstract class ChildNode extends NodeImpl {
031:
032:            //
033:            // Constants
034:            //
035:
036:            /** Serialization version. */
037:            static final long serialVersionUID = -6112455738802414002L;
038:
039:            //
040:            // Data
041:            //
042:
043:            /** Previous sibling. */
044:            protected ChildNode previousSibling;
045:
046:            /** Next sibling. */
047:            protected ChildNode nextSibling;
048:
049:            //
050:            // Constructors
051:            //
052:
053:            /**
054:             * No public constructor; only subclasses of Node should be
055:             * instantiated, and those normally via a Document's factory methods
056:             * <p>
057:             * Every Node knows what Document it belongs to.
058:             */
059:            protected ChildNode(CoreDocumentImpl ownerDocument) {
060:                super (ownerDocument);
061:            } // <init>(CoreDocumentImpl)
062:
063:            /** Constructor for serialization. */
064:            public ChildNode() {
065:            }
066:
067:            //
068:            // Node methods
069:            //
070:
071:            /**
072:             * Returns a duplicate of a given node. You can consider this a
073:             * generic "copy constructor" for nodes. The newly returned object should
074:             * be completely independent of the source object's subtree, so changes
075:             * in one after the clone has been made will not affect the other.
076:             * <P>
077:             * Note: since we never have any children deep is meaningless here,
078:             * ParentNode overrides this behavior.
079:             * @see ParentNode
080:             *
081:             * <p>
082:             * Example: Cloning a Text node will copy both the node and the text it
083:             * contains.
084:             * <p>
085:             * Example: Cloning something that has children -- Element or Attr, for
086:             * example -- will _not_ clone those children unless a "deep clone"
087:             * has been requested. A shallow clone of an Attr node will yield an
088:             * empty Attr of the same name.
089:             * <p>
090:             * NOTE: Clones will always be read/write, even if the node being cloned
091:             * is read-only, to permit applications using only the DOM API to obtain
092:             * editable copies of locked portions of the tree.
093:             */
094:            public Node cloneNode(boolean deep) {
095:
096:                ChildNode newnode = (ChildNode) super .cloneNode(deep);
097:
098:                // Need to break the association w/ original kids
099:                newnode.previousSibling = null;
100:                newnode.nextSibling = null;
101:                newnode.isFirstChild(false);
102:
103:                return newnode;
104:
105:            } // cloneNode(boolean):Node
106:
107:            /**
108:             * Returns the parent node of this node
109:             */
110:            public Node getParentNode() {
111:                // if we have an owner, ownerNode is our parent, otherwise it's
112:                // our ownerDocument and we don't have a parent
113:                return isOwned() ? ownerNode : null;
114:            }
115:
116:            /*
117:             * same as above but returns internal type
118:             */
119:            final NodeImpl parentNode() {
120:                // if we have an owner, ownerNode is our parent, otherwise it's
121:                // our ownerDocument and we don't have a parent
122:                return isOwned() ? ownerNode : null;
123:            }
124:
125:            /** The next child of this node's parent, or null if none */
126:            public Node getNextSibling() {
127:                return nextSibling;
128:            }
129:
130:            /** The previous child of this node's parent, or null if none */
131:            public Node getPreviousSibling() {
132:                // if we are the firstChild, previousSibling actually refers to our
133:                // parent's lastChild, but we hide that
134:                return isFirstChild() ? null : previousSibling;
135:            }
136:
137:            /*
138:             * same as above but returns internal type
139:             */
140:            final ChildNode previousSibling() {
141:                // if we are the firstChild, previousSibling actually refers to our
142:                // parent's lastChild, but we hide that
143:                return isFirstChild() ? null : previousSibling;
144:            }
145:
146:        } // class ChildNode
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.