KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > views > xslt > DefaultAdapterNode


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.views.xslt;
6
7 import org.apache.commons.logging.LogFactory;
8 import org.w3c.dom.*;
9
10
11 /**
12  * @author <a HREF="mailto:meier@meisterbohne.de">Philipp Meier</a>
13  * Date: 10.10.2003
14  * Time: 19:46:43
15  */

16 public abstract class DefaultAdapterNode implements Node, AdapterNode {
17     //~ Static fields/initializers /////////////////////////////////////////////
18

19     private static final NodeList EMPTY_NODELIST = new NodeList() {
20         public Node item(int i) {
21             return null;
22         }
23
24         public int getLength() {
25             return 0;
26         }
27     };
28
29
30     //~ Instance fields ////////////////////////////////////////////////////////
31

32     private AdapterNode parent;
33     private DOMAdapter rootAdapter;
34     private Object JavaDoc value;
35     private String JavaDoc propertyName;
36
37     //~ Constructors ///////////////////////////////////////////////////////////
38

39     public DefaultAdapterNode(DOMAdapter rootAdapter, AdapterNode parent, String JavaDoc propertyName, Object JavaDoc value) {
40         //assert rootAdapter != null : "rootAdapter == null";
41
this.rootAdapter = rootAdapter;
42
43         //assert parent != null : "parent == null";
44
this.parent = parent;
45
46         //assert propertyName != null : "propertyName == null";
47
this.propertyName = propertyName;
48         this.value = value;
49
50         if (LogFactory.getLog(getClass()).isDebugEnabled()) {
51             LogFactory.getLog(getClass()).debug("Creating " + this);
52         }
53     }
54
55     //~ Methods ////////////////////////////////////////////////////////////////
56

57     public NamedNodeMap getAttributes() {
58         return null;
59     }
60
61     public NodeList getChildNodes() {
62         return EMPTY_NODELIST;
63     }
64
65     public Node getFirstChild() {
66         return null;
67     }
68
69     public Node getLastChild() {
70         return null;
71     }
72
73     public String JavaDoc getLocalName() {
74         return null;
75     }
76
77     public String JavaDoc getNamespaceURI() {
78         return null;
79     }
80
81     public Node getNextSibling() {
82         return (getParentAdapterNode() != null) ? getParentAdapterNode().getNextSibling(this) : null;
83     }
84
85     public Node getNextSibling(AdapterNode child) {
86         return null;
87     }
88
89     public void setNodeValue(String JavaDoc string) throws DOMException {
90         operationNotSupported();
91     }
92
93     public String JavaDoc getNodeValue() throws DOMException {
94         operationNotSupported();
95
96         return null;
97     }
98
99     public Document getOwnerDocument() {
100         return null;
101     }
102
103     public AdapterNode getParentAdapterNode() {
104         return parent;
105     }
106
107     public Node getParentNode() {
108         return parent;
109     }
110
111     public void setPrefix(String JavaDoc string) throws DOMException {
112         operationNotSupported();
113     }
114
115     public String JavaDoc getPrefix() {
116         return null;
117     }
118
119     public Node getPreviousSibling() {
120         return null;
121     }
122
123     public String JavaDoc getPropertyName() {
124         return propertyName;
125     }
126
127     public DOMAdapter getRootAdapter() {
128         return rootAdapter;
129     }
130
131     public boolean isSupported(String JavaDoc string, String JavaDoc string1) {
132         operationNotSupported();
133
134         return false;
135     }
136
137     public Object JavaDoc getValue() {
138         return value;
139     }
140
141     public Node appendChild(Node node) throws DOMException {
142         operationNotSupported();
143
144         return null;
145     }
146
147     public Node cloneNode(boolean b) {
148         operationNotSupported();
149
150         return null;
151     }
152
153     public boolean equals(Object JavaDoc other) {
154         try {
155             AdapterNode otherNode = (AdapterNode) other;
156             boolean result = true;
157             result &= getRootAdapter().equals(otherNode.getRootAdapter());
158             result &= getPropertyName().equals(otherNode.getPropertyName());
159             result &= ((getValue() != null) ? getValue().equals(otherNode.getValue()) : (otherNode.getValue() == null));
160             result &= ((getParentAdapterNode() != null) ? getParentAdapterNode().equals(otherNode.getParentAdapterNode()) : (otherNode.getParentAdapterNode() == null));
161
162             return result;
163         } catch (ClassCastException JavaDoc e) {
164             return false;
165         }
166     }
167
168     public boolean hasAttributes() {
169         return false;
170     }
171
172     public boolean hasChildNodes() {
173         return false;
174     }
175
176     public int hashCode() {
177         return (getRootAdapter().hashCode() * 37) + ((getParentAdapterNode() != null) ? (getParentAdapterNode().hashCode() * 41) : 0) + (getPropertyName().hashCode() * 43) + ((getValue() != null) ? (getValue().hashCode() * 47) : 0);
178     }
179
180     public Node insertBefore(Node node, Node node1) throws DOMException {
181         operationNotSupported();
182
183         return null;
184     }
185
186     public void normalize() {
187         operationNotSupported();
188     }
189
190     public Node removeChild(Node node) throws DOMException {
191         operationNotSupported();
192
193         return null;
194     }
195
196     public Node replaceChild(Node node, Node node1) throws DOMException {
197         operationNotSupported();
198
199         return null;
200     }
201
202     protected void operationNotSupported() {
203         throw new RuntimeException JavaDoc("Operation not supported.");
204     }
205     
206
207     /* (non-Javadoc)
208      * @see org.w3c.dom.Text#isElementContentWhitespace()
209      */

210     public boolean isElementContentWhitespace() {
211         // TODO Auto-generated method stub
212
return false;
213     }
214
215     /* (non-Javadoc)
216      * @see org.w3c.dom.Text#getWholeText()
217      */

218     public String JavaDoc getWholeText() {
219         // TODO Auto-generated method stub
220
return null;
221     }
222
223     /* (non-Javadoc)
224      * @see org.w3c.dom.Text#replaceWholeText(java.lang.String)
225      */

226     public Text replaceWholeText(String JavaDoc content) throws DOMException {
227         // TODO Auto-generated method stub
228
return null;
229     }
230
231     /* (non-Javadoc)
232      * @see org.w3c.dom.Node#getBaseURI()
233      */

234     public String JavaDoc getBaseURI() {
235         // TODO Auto-generated method stub
236
return null;
237     }
238
239     /* (non-Javadoc)
240      * @see org.w3c.dom.Node#compareDocumentPosition(org.w3c.dom.Node)
241      */

242     public short compareDocumentPosition(Node other) throws DOMException {
243         // TODO Auto-generated method stub
244
return 0;
245     }
246
247     /* (non-Javadoc)
248      * @see org.w3c.dom.Node#getTextContent()
249      */

250     public String JavaDoc getTextContent() throws DOMException {
251         // TODO Auto-generated method stub
252
return null;
253     }
254
255     /* (non-Javadoc)
256      * @see org.w3c.dom.Node#setTextContent(java.lang.String)
257      */

258     public void setTextContent(String JavaDoc textContent) throws DOMException {
259         // TODO Auto-generated method stub
260

261     }
262
263     /* (non-Javadoc)
264      * @see org.w3c.dom.Node#isSameNode(org.w3c.dom.Node)
265      */

266     public boolean isSameNode(Node other) {
267         // TODO Auto-generated method stub
268
return false;
269     }
270
271     /* (non-Javadoc)
272      * @see org.w3c.dom.Node#lookupPrefix(java.lang.String)
273      */

274     public String JavaDoc lookupPrefix(String JavaDoc namespaceURI) {
275         // TODO Auto-generated method stub
276
return null;
277     }
278
279     /* (non-Javadoc)
280      * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String)
281      */

282     public boolean isDefaultNamespace(String JavaDoc namespaceURI) {
283         // TODO Auto-generated method stub
284
return false;
285     }
286
287     /* (non-Javadoc)
288      * @see org.w3c.dom.Node#lookupNamespaceURI(java.lang.String)
289      */

290     public String JavaDoc lookupNamespaceURI(String JavaDoc prefix) {
291         // TODO Auto-generated method stub
292
return null;
293     }
294
295     /* (non-Javadoc)
296      * @see org.w3c.dom.Node#isEqualNode(org.w3c.dom.Node)
297      */

298     public boolean isEqualNode(Node arg) {
299         // TODO Auto-generated method stub
300
return false;
301     }
302
303     /* (non-Javadoc)
304      * @see org.w3c.dom.Node#getFeature(java.lang.String, java.lang.String)
305      */

306     public Object JavaDoc getFeature(String JavaDoc feature, String JavaDoc version) {
307         // TODO Auto-generated method stub
308
return null;
309     }
310
311     /* (non-Javadoc)
312      * @see org.w3c.dom.Node#setUserData(java.lang.String, java.lang.Object, org.w3c.dom.UserDataHandler)
313      */

314     public Object JavaDoc setUserData(String JavaDoc key, Object JavaDoc data, UserDataHandler handler) {
315         // TODO Auto-generated method stub
316
return null;
317     }
318
319     /* (non-Javadoc)
320      * @see org.w3c.dom.Node#getUserData(java.lang.String)
321      */

322     public Object JavaDoc getUserData(String JavaDoc key) {
323         // TODO Auto-generated method stub
324
return null;
325     }
326     /* (non-Javadoc)
327      * @see org.w3c.dom.Document#getInputEncoding()
328      */

329     public String JavaDoc getInputEncoding() {
330         // TODO Auto-generated method stub
331
return null;
332     }
333
334     /* (non-Javadoc)
335      * @see org.w3c.dom.Document#getXmlEncoding()
336      */

337     public String JavaDoc getXmlEncoding() {
338         // TODO Auto-generated method stub
339
return null;
340     }
341
342     /* (non-Javadoc)
343      * @see org.w3c.dom.Document#getXmlStandalone()
344      */

345     public boolean getXmlStandalone() {
346         // TODO Auto-generated method stub
347
return false;
348     }
349
350     /* (non-Javadoc)
351      * @see org.w3c.dom.Document#setXmlStandalone(boolean)
352      */

353     public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
354         // TODO Auto-generated method stub
355

356     }
357
358     /* (non-Javadoc)
359      * @see org.w3c.dom.Document#getXmlVersion()
360      */

361     public String JavaDoc getXmlVersion() {
362         // TODO Auto-generated method stub
363
return null;
364     }
365
366     /* (non-Javadoc)
367      * @see org.w3c.dom.Document#setXmlVersion(java.lang.String)
368      */

369     public void setXmlVersion(String JavaDoc xmlVersion) throws DOMException {
370         // TODO Auto-generated method stub
371

372     }
373
374     /* (non-Javadoc)
375      * @see org.w3c.dom.Document#getStrictErrorChecking()
376      */

377     public boolean getStrictErrorChecking() {
378         // TODO Auto-generated method stub
379
return false;
380     }
381
382     /* (non-Javadoc)
383      * @see org.w3c.dom.Document#setStrictErrorChecking(boolean)
384      */

385     public void setStrictErrorChecking(boolean strictErrorChecking) {
386         // TODO Auto-generated method stub
387

388     }
389
390     /* (non-Javadoc)
391      * @see org.w3c.dom.Document#getDocumentURI()
392      */

393     public String JavaDoc getDocumentURI() {
394         // TODO Auto-generated method stub
395
return null;
396     }
397
398     /* (non-Javadoc)
399      * @see org.w3c.dom.Document#setDocumentURI(java.lang.String)
400      */

401     public void setDocumentURI(String JavaDoc documentURI) {
402         // TODO Auto-generated method stub
403

404     }
405
406     /* (non-Javadoc)
407      * @see org.w3c.dom.Document#adoptNode(org.w3c.dom.Node)
408      */

409     public Node adoptNode(Node source) throws DOMException {
410         // TODO Auto-generated method stub
411
return null;
412     }
413
414     /* (non-Javadoc)
415      * @see org.w3c.dom.Document#getDomConfig()
416      */

417     public DOMConfiguration getDomConfig() {
418         // TODO Auto-generated method stub
419
return null;
420     }
421
422     /* (non-Javadoc)
423      * @see org.w3c.dom.Document#normalizeDocument()
424      */

425     public void normalizeDocument() {
426         // TODO Auto-generated method stub
427

428     }
429
430     /* (non-Javadoc)
431      * @see org.w3c.dom.Document#renameNode(org.w3c.dom.Node, java.lang.String, java.lang.String)
432      */

433     public Node renameNode(Node n, String JavaDoc namespaceURI, String JavaDoc qualifiedName) throws DOMException {
434         // TODO Auto-generated method stub
435
return null;
436     }
437
438     
439 }
440
Popular Tags