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;
015:
016: import org.itsnat.core.ItsNatException;
017: import org.w3c.dom.DOMException;
018: import org.w3c.dom.Document;
019: import org.w3c.dom.NamedNodeMap;
020: import org.w3c.dom.Node;
021: import org.w3c.dom.NodeList;
022: import org.w3c.dom.UserDataHandler;
023: import org.w3c.dom.events.Event;
024: import org.w3c.dom.events.EventException;
025: import org.w3c.dom.events.EventListener;
026: import org.w3c.dom.events.EventTarget;
027: import org.w3c.dom.views.AbstractView;
028: import org.w3c.dom.views.DocumentView;
029:
030: /**
031: * Implementa lo necesario de Node e EventTarget
032: *
033: * @author jmarranz
034: */
035: public class AbstractViewImpl implements AbstractView, EventTarget,
036: Node {
037: public final static int ABSTRACT_VIEW = -1; // Un valor que no se confunde con los valores de Node.CONSTANTE, así cualquier comparación con Node.CONSTANTE será fallida
038: protected ItsNatDocumentImpl itsNatDoc;
039:
040: /**
041: * Creates a new instance of AbstractViewImpl
042: */
043: public AbstractViewImpl(ItsNatDocumentImpl itsNatDoc) {
044: this .itsNatDoc = itsNatDoc;
045: }
046:
047: public DocumentView getDocument() {
048: return itsNatDoc;
049: }
050:
051: public void addEventListener(String type, EventListener listener,
052: boolean useCapture) {
053: itsNatDoc.addEventListener(this , type, listener, useCapture);
054: }
055:
056: public void removeEventListener(String type,
057: EventListener listener, boolean useCapture) {
058: itsNatDoc.removeEventListener(this , type, listener, useCapture);
059: }
060:
061: public boolean dispatchEvent(Event evt) throws EventException {
062: return itsNatDoc.dispatchEvent(this , evt);
063: }
064:
065: public String getNodeName() {
066: throw new ItsNatException("Not implemented");
067: }
068:
069: public String getNodeValue() throws DOMException {
070: throw new ItsNatException("Not implemented");
071: }
072:
073: public void setNodeValue(String nodeValue) throws DOMException {
074: throw new ItsNatException("Not implemented");
075: }
076:
077: public short getNodeType() {
078: return ABSTRACT_VIEW;
079: }
080:
081: public Node getParentNode() {
082: return null;
083: }
084:
085: public NodeList getChildNodes() {
086: throw new ItsNatException("Not implemented");
087: }
088:
089: public Node getFirstChild() {
090: throw new ItsNatException("Not implemented");
091: }
092:
093: public Node getLastChild() {
094: throw new ItsNatException("Not implemented");
095: }
096:
097: public Node getPreviousSibling() {
098: throw new ItsNatException("Not implemented");
099: }
100:
101: public Node getNextSibling() {
102: throw new ItsNatException("Not implemented");
103: }
104:
105: public NamedNodeMap getAttributes() {
106: throw new ItsNatException("Not implemented");
107: }
108:
109: public Document getOwnerDocument() {
110: return itsNatDoc.getDocument();
111: }
112:
113: public Node insertBefore(Node newChild, Node refChild)
114: throws DOMException {
115: throw new ItsNatException("Not implemented");
116: }
117:
118: public Node replaceChild(Node newChild, Node oldChild)
119: throws DOMException {
120: throw new ItsNatException("Not implemented");
121: }
122:
123: public Node removeChild(Node oldChild) throws DOMException {
124: throw new ItsNatException("Not implemented");
125: }
126:
127: public Node appendChild(Node newChild) throws DOMException {
128: throw new ItsNatException("Not implemented");
129: }
130:
131: public boolean hasChildNodes() {
132: throw new ItsNatException("Not implemented");
133: }
134:
135: public Node cloneNode(boolean deep) {
136: throw new ItsNatException("Not implemented");
137: }
138:
139: public void normalize() {
140: throw new ItsNatException("Not implemented");
141: }
142:
143: public boolean isSupported(String feature, String version) {
144: throw new ItsNatException("Not implemented");
145: }
146:
147: public String getNamespaceURI() {
148: throw new ItsNatException("Not implemented");
149: }
150:
151: public String getPrefix() {
152: throw new ItsNatException("Not implemented");
153: }
154:
155: public void setPrefix(String prefix) throws DOMException {
156: throw new ItsNatException("Not implemented");
157: }
158:
159: public String getLocalName() {
160: throw new ItsNatException("Not implemented");
161: }
162:
163: public boolean hasAttributes() {
164: throw new ItsNatException("Not implemented");
165: }
166:
167: public String getBaseURI() {
168: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
169: throw new ItsNatException("Not supported");
170: }
171:
172: public short compareDocumentPosition(Node other)
173: throws DOMException {
174: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
175: throw new ItsNatException("Not supported");
176: }
177:
178: public String getTextContent() throws DOMException {
179: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
180: throw new ItsNatException("Not supported");
181: }
182:
183: public void setTextContent(String textContent) throws DOMException {
184: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
185: throw new ItsNatException("Not supported");
186: }
187:
188: public boolean isSameNode(Node other) {
189: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
190: throw new ItsNatException("Not supported");
191: }
192:
193: public String lookupPrefix(String namespaceURI) {
194: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
195: throw new ItsNatException("Not supported");
196: }
197:
198: public boolean isDefaultNamespace(String namespaceURI) {
199: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
200: throw new ItsNatException("Not supported");
201: }
202:
203: public String lookupNamespaceURI(String prefix) {
204: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
205: throw new ItsNatException("Not supported");
206: }
207:
208: public boolean isEqualNode(Node arg) {
209: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
210: throw new ItsNatException("Not supported");
211: }
212:
213: public Object getFeature(String feature, String version) {
214: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
215: throw new ItsNatException("Not supported");
216: }
217:
218: public Object setUserData(String key, Object data,
219: UserDataHandler handler) {
220: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
221: throw new ItsNatException("Not supported");
222: }
223:
224: public Object getUserData(String key) {
225: // Para que compile con el JDK 1.5 (Node tiene métodos del DOM 3)
226: throw new ItsNatException("Not supported");
227: }
228:
229: }
|