Source Code Cross Referenced for ItsNatNodeImpl.java in  » Ajax » ItsNat » org » itsnat » impl » core » 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 » Ajax » ItsNat » org.itsnat.impl.core.dom 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:          ItsNat Java Web Application Framework
003:          Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
004:          Author: Jose Maria Arranz Santamaria
005:
006:          This program is free software: you can redistribute it and/or modify
007:          it under the terms of the GNU Affero General Public License as published by
008:          the Free Software Foundation, either version 3 of the License, or
009:          (at your option) any later version. See the GNU Affero General Public 
010:          License for more details. See the copy of the GNU Affero General Public License
011:          included in this program. If not, see <http://www.gnu.org/licenses/>.
012:         */
013:
014:        package org.itsnat.impl.core.dom;
015:
016:        import java.lang.ref.WeakReference;
017:        import org.itsnat.core.ItsNatException;
018:        import org.itsnat.core.ItsNatNode;
019:        import org.itsnat.impl.core.ItsNatDocumentImpl;
020:        import org.w3c.dom.DOMException;
021:        import org.w3c.dom.Document;
022:        import org.w3c.dom.Element;
023:        import org.w3c.dom.NamedNodeMap;
024:        import org.w3c.dom.Node;
025:        import org.w3c.dom.NodeList;
026:        import org.w3c.dom.UserDataHandler;
027:        import org.w3c.dom.events.Event;
028:        import org.w3c.dom.events.EventException;
029:        import org.w3c.dom.events.EventListener;
030:        import org.w3c.dom.events.EventTarget;
031:
032:        /**
033:         *
034:         * @author jmarranz
035:         */
036:        public abstract class ItsNatNodeImpl implements  ItsNatNode, Node,
037:                EventTarget {
038:            protected WeakReference weakNode;
039:            protected ItsNatDocumentImpl itsNatDoc;
040:
041:            /**
042:             * Creates a new instance of ItsNatNodeImpl
043:             */
044:            public ItsNatNodeImpl(Node node, ItsNatDocumentImpl itsNatDoc) {
045:                if (node == null)
046:                    throw new ItsNatException("INTERNAL ERROR");
047:                this .weakNode = new WeakReference(node);
048:                this .itsNatDoc = itsNatDoc;
049:            }
050:
051:            public static ItsNatNodeImpl newItsNatNode(Node node,
052:                    ItsNatDocumentImpl itsNatDoc) {
053:                if (node.getNodeType() == Node.ELEMENT_NODE)
054:                    return ItsNatElementImpl.newItsNatElement((Element) node,
055:                            itsNatDoc);
056:                else
057:                    return ItsNatNodeDefaultImpl.newItsNatNodeDefault(node,
058:                            itsNatDoc);
059:            }
060:
061:            public Node getNode() {
062:                Node node = (Node) weakNode.get();
063:                if (node == null)
064:                    throw new ItsNatException("NODE LOST"); // Esto significa que "alguien" sujeta este objeto cuando lo normal es que se pierda cuando se pierda el nodo asociado, gracias a usar un registro/colección Weak
065:                return node;
066:            }
067:
068:            public int hashCode() {
069:                return getNode().hashCode();
070:            }
071:
072:            public boolean equals(Object other) {
073:                boolean res = super .equals(other);
074:                if (res)
075:                    return true;
076:                if (other instanceof  ItsNatNode)
077:                    return getNode().equals(((ItsNatNode) other).getNode());
078:                return false;
079:            }
080:
081:            public String getNodeName() {
082:                return getNode().getNodeName();
083:            }
084:
085:            public String getNodeValue() throws DOMException {
086:                return getNode().getNodeValue();
087:            }
088:
089:            public void setNodeValue(String nodeValue) throws DOMException {
090:                getNode().setNodeValue(nodeValue);
091:            }
092:
093:            public short getNodeType() {
094:                return getNode().getNodeType();
095:            }
096:
097:            public Node getParentNode() {
098:                return getNode().getParentNode();
099:            }
100:
101:            public NodeList getChildNodes() {
102:                return getNode().getChildNodes();
103:            }
104:
105:            public Node getFirstChild() {
106:                return getNode().getFirstChild();
107:            }
108:
109:            public Node getLastChild() {
110:                return getNode().getLastChild();
111:            }
112:
113:            public Node getPreviousSibling() {
114:                return getNode().getPreviousSibling();
115:            }
116:
117:            public Node getNextSibling() {
118:                return getNode().getNextSibling();
119:            }
120:
121:            public NamedNodeMap getAttributes() {
122:                return getNode().getAttributes();
123:            }
124:
125:            public Document getOwnerDocument() {
126:                return getNode().getOwnerDocument();
127:            }
128:
129:            public Node insertBefore(Node newChild, Node refChild)
130:                    throws DOMException {
131:                return getNode().insertBefore(newChild, refChild);
132:            }
133:
134:            public Node replaceChild(Node newChild, Node oldChild)
135:                    throws DOMException {
136:                return getNode().replaceChild(newChild, oldChild);
137:            }
138:
139:            public Node removeChild(Node oldChild) throws DOMException {
140:                return getNode().removeChild(oldChild);
141:            }
142:
143:            public Node appendChild(Node newChild) throws DOMException {
144:                return getNode().appendChild(newChild);
145:            }
146:
147:            public boolean hasChildNodes() {
148:                return getNode().hasChildNodes();
149:            }
150:
151:            public Node cloneNode(boolean deep) {
152:                return getNode().cloneNode(deep);
153:            }
154:
155:            public void normalize() {
156:                getNode().normalize();
157:            }
158:
159:            public boolean isSupported(String feature, String version) {
160:                return getNode().isSupported(feature, version);
161:            }
162:
163:            public String getNamespaceURI() {
164:                return getNode().getNamespaceURI();
165:            }
166:
167:            public String getPrefix() {
168:                return getNode().getPrefix();
169:            }
170:
171:            public void setPrefix(String prefix) throws DOMException {
172:                getNode().setPrefix(prefix);
173:            }
174:
175:            public String getLocalName() {
176:                return getNode().getLocalName();
177:            }
178:
179:            public boolean hasAttributes() {
180:                return getNode().hasAttributes();
181:            }
182:
183:            public String getBaseURI() {
184:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
185:                throw new ItsNatException("DOM 3 is not supported");
186:            }
187:
188:            public short compareDocumentPosition(Node other)
189:                    throws DOMException {
190:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
191:                throw new ItsNatException("DOM 3 is not supported");
192:            }
193:
194:            public String getTextContent() throws DOMException {
195:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
196:                throw new ItsNatException("DOM 3 is not supported");
197:            }
198:
199:            public void setTextContent(String textContent) throws DOMException {
200:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
201:                throw new ItsNatException("DOM 3 is not supported");
202:            }
203:
204:            public boolean isSameNode(Node other) {
205:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
206:                throw new ItsNatException("DOM 3 is not supported");
207:            }
208:
209:            public String lookupPrefix(String namespaceURI) {
210:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
211:                throw new ItsNatException("DOM 3 is not supported");
212:            }
213:
214:            public boolean isDefaultNamespace(String namespaceURI) {
215:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
216:                throw new ItsNatException("DOM 3 is not supported");
217:            }
218:
219:            public String lookupNamespaceURI(String prefix) {
220:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
221:                throw new ItsNatException("DOM 3 is not supported");
222:            }
223:
224:            public boolean isEqualNode(Node arg) {
225:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
226:                throw new ItsNatException("DOM 3 is not supported");
227:            }
228:
229:            public Object getFeature(String feature, String version) {
230:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
231:                throw new ItsNatException("DOM 3 is not supported");
232:            }
233:
234:            public Object setUserData(String key, Object data,
235:                    UserDataHandler handler) {
236:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
237:                throw new ItsNatException("DOM 3 is not supported");
238:            }
239:
240:            public Object getUserData(String key) {
241:                // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
242:                throw new ItsNatException("DOM 3 is not supported");
243:            }
244:
245:            public void removeEventListener(String type,
246:                    EventListener listener, boolean useCapture) {
247:                itsNatDoc.removeEventListener((EventTarget) getNode(), type,
248:                        listener, useCapture);
249:            }
250:
251:            public void addEventListener(String type, EventListener listener,
252:                    boolean useCapture) {
253:                itsNatDoc.addEventListener((EventTarget) getNode(), type,
254:                        listener, useCapture);
255:            }
256:
257:            public boolean dispatchEvent(Event evt) throws EventException {
258:                return itsNatDoc.dispatchEvent((EventTarget) getNode(), evt);
259:            }
260:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.