KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > quercus > lib > dom > DOMNode


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Sam
28  */

29
30 package com.caucho.quercus.lib.dom;
31
32 import org.w3c.dom.Node JavaDoc;
33
34 public class DOMNode<T extends Node JavaDoc>
35   extends DOMWrapper<T>
36 {
37   protected DOMNode(DOMImplementation impl, T delegate)
38   {
39     super(impl, delegate);
40   }
41
42   Node JavaDoc getDelegate()
43   {
44     return _delegate;
45   }
46
47   public DOMNode appendChild(DOMNode newChild)
48     throws DOMException
49   {
50     try {
51       return wrap(_delegate.appendChild(newChild.getDelegate()));
52     }
53     catch (org.w3c.dom.DOMException JavaDoc ex) {
54       throw wrap(ex);
55     }
56   }
57
58   public DOMNode cloneNode(boolean deep)
59   {
60     return wrap(_delegate.cloneNode(deep));
61   }
62
63   public short compareDocumentPosition(DOMNode other)
64     throws DOMException
65   {
66     try {
67       return _delegate.compareDocumentPosition(other.getDelegate());
68     }
69     catch (org.w3c.dom.DOMException JavaDoc ex) {
70       throw wrap(ex);
71     }
72   }
73
74   public DOMNamedNodeMap getAttributes()
75   {
76     return wrap(_delegate.getAttributes());
77   }
78
79   public String JavaDoc getBaseURI()
80   {
81     return _delegate.getBaseURI();
82   }
83
84   public DOMNodeList getChildNodes()
85   {
86     return wrap(_delegate.getChildNodes());
87   }
88
89   public Object JavaDoc getFeature(String JavaDoc feature, String JavaDoc version)
90   {
91     return _delegate.getFeature(feature, version);
92   }
93
94   public DOMNode getFirstChild()
95   {
96     return wrap(_delegate.getFirstChild());
97   }
98
99   public DOMNode getLastChild()
100   {
101     return wrap(_delegate.getLastChild());
102   }
103
104   public String JavaDoc getLocalName()
105   {
106     return _delegate.getLocalName();
107   }
108
109   public String JavaDoc getNamespaceURI()
110   {
111     return _delegate.getNamespaceURI();
112   }
113
114   public DOMNode getNextSibling()
115   {
116     return wrap(_delegate.getNextSibling());
117   }
118
119   public String JavaDoc getNodeName()
120   {
121     return _delegate.getNodeName();
122   }
123
124   public short getNodeType()
125   {
126     return _delegate.getNodeType();
127   }
128
129   public String JavaDoc getNodeValue()
130     throws DOMException
131   {
132     try {
133       return _delegate.getNodeValue();
134     }
135     catch (org.w3c.dom.DOMException JavaDoc ex) {
136       throw wrap(ex);
137     }
138   }
139
140   public DOMDocument getOwnerDocument()
141   {
142     return wrap(_delegate.getOwnerDocument());
143   }
144
145   public DOMNode getParentNode()
146   {
147     return wrap(_delegate.getParentNode());
148   }
149
150   public String JavaDoc getPrefix()
151   {
152     return _delegate.getPrefix();
153   }
154
155   public DOMNode getPreviousSibling()
156   {
157     return wrap(_delegate.getPreviousSibling());
158   }
159
160   public String JavaDoc getTextContent()
161     throws DOMException
162   {
163     try {
164       return _delegate.getTextContent();
165     }
166     catch (org.w3c.dom.DOMException JavaDoc ex) {
167       throw wrap(ex);
168     }
169   }
170
171   public Object JavaDoc getUserData(String JavaDoc key)
172   {
173     return _delegate.getUserData(key);
174   }
175
176   public boolean hasAttributes()
177   {
178     return _delegate.hasAttributes();
179   }
180
181   public boolean hasChildNodes()
182   {
183     return _delegate.hasChildNodes();
184   }
185
186   public DOMNode insertBefore(DOMNode newChild, DOMNode refChild)
187     throws DOMException
188   {
189     try {
190       return wrap(_delegate.insertBefore(newChild.getDelegate(), refChild.getDelegate()));
191     }
192     catch (org.w3c.dom.DOMException JavaDoc ex) {
193       throw wrap(ex);
194     }
195   }
196
197   public boolean isDefaultNamespace(String JavaDoc namespaceURI)
198   {
199     return _delegate.isDefaultNamespace(namespaceURI);
200   }
201
202   public boolean isEqualNode(DOMNode arg)
203   {
204     return _delegate.isEqualNode(arg.getDelegate());
205   }
206
207   public boolean isSameNode(DOMNode other)
208   {
209     return _delegate.isSameNode(other.getDelegate());
210   }
211
212   public boolean isSupported(String JavaDoc feature, String JavaDoc version)
213   {
214     return _delegate.isSupported(feature, version);
215   }
216
217   public String JavaDoc lookupNamespaceURI(String JavaDoc prefix)
218   {
219     return _delegate.lookupNamespaceURI(prefix);
220   }
221
222   public String JavaDoc lookupPrefix(String JavaDoc namespaceURI)
223   {
224     return _delegate.lookupPrefix(namespaceURI);
225   }
226
227   public void normalize()
228   {
229     _delegate.normalize();
230   }
231
232   public DOMNode removeChild(DOMNode oldChild)
233     throws DOMException
234   {
235     try {
236       return wrap(_delegate.removeChild(oldChild.getDelegate()));
237     }
238     catch (org.w3c.dom.DOMException JavaDoc ex) {
239       throw wrap(ex);
240     }
241   }
242
243   public DOMNode replaceChild(DOMNode newChild, DOMNode oldChild)
244     throws DOMException
245   {
246     try {
247       return wrap(_delegate.replaceChild(newChild.getDelegate(), oldChild.getDelegate()));
248     }
249     catch (org.w3c.dom.DOMException JavaDoc ex) {
250       throw wrap(ex);
251     }
252   }
253
254   public void setNodeValue(String JavaDoc nodeValue)
255     throws DOMException
256   {
257     try {
258       _delegate.setNodeValue(nodeValue);
259     }
260     catch (org.w3c.dom.DOMException JavaDoc ex) {
261       throw wrap(ex);
262     }
263   }
264
265   public void setPrefix(String JavaDoc prefix)
266     throws DOMException
267   {
268     try {
269       _delegate.setPrefix(prefix);
270     }
271     catch (org.w3c.dom.DOMException JavaDoc ex) {
272       throw wrap(ex);
273     }
274   }
275
276   public void setTextContent(String JavaDoc textContent)
277     throws DOMException
278   {
279     try {
280       _delegate.setTextContent(textContent);
281     }
282     catch (org.w3c.dom.DOMException JavaDoc ex) {
283       throw wrap(ex);
284     }
285   }
286
287   public Object JavaDoc setUserData(String JavaDoc key, Object JavaDoc data)
288   {
289     return _delegate.setUserData(key, data, null);
290   }
291
292   public String JavaDoc toString()
293   {
294     return getClass().getSimpleName();
295   }
296 }
297
Popular Tags