KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > proxy > Dom4jProxy


1 // $Id: Dom4jProxy.java,v 1.3 2005/04/29 03:06:37 oneovthafew Exp $
2
package org.hibernate.proxy;
3
4 import org.dom4j.Element;
5 import org.dom4j.QName;
6 import org.dom4j.Namespace;
7 import org.dom4j.Attribute;
8 import org.dom4j.CDATA;
9 import org.dom4j.Entity;
10 import org.dom4j.Text;
11 import org.dom4j.Node;
12 import org.dom4j.Branch;
13 import org.dom4j.ProcessingInstruction;
14 import org.dom4j.Comment;
15 import org.dom4j.Document;
16 import org.dom4j.XPath;
17 import org.dom4j.InvalidXPathException;
18 import org.dom4j.Visitor;
19
20 import java.io.Serializable JavaDoc;
21 import java.io.Writer JavaDoc;
22 import java.io.IOException JavaDoc;
23 import java.util.List JavaDoc;
24 import java.util.Map JavaDoc;
25 import java.util.Iterator JavaDoc;
26
27 /**
28  * Proxy for "dom4j" entity representations.
29  *
30  * @author Steve Ebersole
31  */

32 public class Dom4jProxy implements HibernateProxy, Element, Serializable JavaDoc {
33
34     private Dom4jLazyInitializer li;
35
36     public Dom4jProxy(Dom4jLazyInitializer li) {
37         this.li = li;
38     }
39
40     public Object JavaDoc writeReplace() {
41         return this;
42     }
43
44     public LazyInitializer getHibernateLazyInitializer() {
45         return li;
46     }
47
48     public QName getQName() {
49         return target().getQName();
50     }
51
52     public QName getQName(String JavaDoc s) {
53         return target().getQName( s );
54     }
55
56     public void setQName(QName qName) {
57         target().setQName( qName );
58     }
59
60     public Namespace getNamespace() {
61         return target().getNamespace();
62     }
63
64     public Namespace getNamespaceForPrefix(String JavaDoc s) {
65         return target().getNamespaceForPrefix( s );
66     }
67
68     public Namespace getNamespaceForURI(String JavaDoc s) {
69         return target().getNamespaceForURI( s );
70     }
71
72     public List JavaDoc getNamespacesForURI(String JavaDoc s) {
73         return target().getNamespacesForURI( s );
74     }
75
76     public String JavaDoc getNamespacePrefix() {
77         return target().getNamespacePrefix();
78     }
79
80     public String JavaDoc getNamespaceURI() {
81         return target().getNamespaceURI();
82     }
83
84     public String JavaDoc getQualifiedName() {
85         return target().getQualifiedName();
86     }
87
88     public List JavaDoc additionalNamespaces() {
89         return target().additionalNamespaces();
90     }
91
92     public List JavaDoc declaredNamespaces() {
93         return target().declaredNamespaces();
94     }
95
96     public Element addAttribute(String JavaDoc attrName, String JavaDoc text) {
97         return target().addAttribute( attrName, text );
98     }
99
100     public Element addAttribute(QName attrName, String JavaDoc text) {
101         return target().addAttribute( attrName, text );
102     }
103
104     public Element addComment(String JavaDoc text) {
105         return target().addComment( text );
106     }
107
108     public Element addCDATA(String JavaDoc text) {
109         return target().addCDATA( text );
110     }
111
112     public Element addEntity(String JavaDoc name, String JavaDoc text) {
113         return target().addEntity( name, text );
114     }
115
116     public Element addNamespace(String JavaDoc prefix, String JavaDoc uri) {
117         return target().addNamespace( prefix, uri );
118     }
119
120     public Element addProcessingInstruction(String JavaDoc target, String JavaDoc text) {
121         return target().addProcessingInstruction( target, text );
122     }
123
124     public Element addProcessingInstruction(String JavaDoc target, Map JavaDoc data) {
125         return target().addProcessingInstruction( target, data );
126     }
127
128     public Element addText(String JavaDoc text) {
129         return target().addText( text );
130     }
131
132     public void add(Attribute attribute) {
133         target().add( attribute );
134     }
135
136     public void add(CDATA cdata) {
137         target().add( cdata );
138     }
139
140     public void add(Entity entity) {
141         target().add( entity );
142     }
143
144     public void add(Text text) {
145         target().add( text );
146     }
147
148     public void add(Namespace namespace) {
149         target().add( namespace );
150     }
151
152     public boolean remove(Attribute attribute) {
153         return target().remove( attribute );
154     }
155
156     public boolean remove(CDATA cdata) {
157         return target().remove( cdata );
158     }
159
160     public boolean remove(Entity entity) {
161         return target().remove( entity );
162     }
163
164     public boolean remove(Namespace namespace) {
165         return target().remove( namespace );
166     }
167
168     public boolean remove(Text text) {
169         return target().remove( text );
170     }
171
172     public boolean supportsParent() {
173         return target().supportsParent();
174     }
175
176     public Element getParent() {
177         return target().getParent();
178     }
179
180     public void setParent(Element element) {
181         target().setParent( element );
182     }
183
184     public Document getDocument() {
185         return target().getDocument();
186     }
187
188     public void setDocument(Document document) {
189         target().setDocument( document );
190     }
191
192     public boolean isReadOnly() {
193         return target().isReadOnly();
194     }
195
196     public boolean hasContent() {
197         return target().hasContent();
198     }
199
200     public String JavaDoc getName() {
201         return target().getName();
202     }
203
204     public void setName(String JavaDoc name) {
205         target().setName( name );
206     }
207
208     public String JavaDoc getText() {
209         return target().getText();
210     }
211
212     public void setText(String JavaDoc text) {
213         target().setText( text );
214     }
215
216     public String JavaDoc getTextTrim() {
217         return target().getTextTrim();
218     }
219
220     public String JavaDoc getStringValue() {
221         return target().getStringValue();
222     }
223
224     public String JavaDoc getPath() {
225         return target().getPath();
226     }
227
228     public String JavaDoc getPath(Element element) {
229         return target().getPath( element );
230     }
231
232     public String JavaDoc getUniquePath() {
233         return target().getUniquePath();
234     }
235
236     public String JavaDoc getUniquePath(Element element) {
237         return target().getUniquePath( element );
238     }
239
240     public String JavaDoc asXML() {
241         return target().asXML();
242     }
243
244     public void write(Writer JavaDoc writer) throws IOException JavaDoc {
245         target().write( writer );
246     }
247
248     public short getNodeType() {
249         return target().getNodeType();
250     }
251
252     public String JavaDoc getNodeTypeName() {
253         return target().getNodeTypeName();
254     }
255
256     public Node detach() {
257         Element parent = target().getParent();
258         if (parent!=null) parent.remove(this);
259         return target().detach();
260     }
261
262     public List JavaDoc selectNodes(String JavaDoc xpath) {
263         return target().selectNodes( xpath );
264     }
265
266     public Object JavaDoc selectObject(String JavaDoc xpath) {
267         return target().selectObject( xpath );
268     }
269
270     public List JavaDoc selectNodes(String JavaDoc xpath, String JavaDoc comparison) {
271         return target().selectNodes( xpath, comparison );
272     }
273
274     public List JavaDoc selectNodes(String JavaDoc xpath, String JavaDoc comparison, boolean removeDups) {
275         return target().selectNodes( xpath, comparison, removeDups );
276     }
277
278     public Node selectSingleNode(String JavaDoc xpath) {
279         return target().selectSingleNode( xpath );
280     }
281
282     public String JavaDoc valueOf(String JavaDoc xpath) {
283         return target().valueOf( xpath );
284     }
285
286     public Number JavaDoc numberValueOf(String JavaDoc xpath) {
287         return target().numberValueOf( xpath );
288     }
289
290     public boolean matches(String JavaDoc xpath) {
291         return target().matches( xpath );
292     }
293
294     public XPath createXPath(String JavaDoc xpath) throws InvalidXPathException {
295         return target().createXPath( xpath );
296     }
297
298     public Node asXPathResult(Element element) {
299         return target().asXPathResult( element );
300     }
301
302     public void accept(Visitor visitor) {
303         target().accept( visitor );
304     }
305
306     public Object JavaDoc clone() {
307         return target().clone();
308     }
309
310     public Object JavaDoc getData() {
311         return target().getData();
312     }
313
314     public void setData(Object JavaDoc data) {
315         target().setData( data );
316     }
317
318     public List JavaDoc attributes() {
319         return target().attributes();
320     }
321
322     public void setAttributes(List JavaDoc list) {
323         target().setAttributes( list );
324     }
325
326     public int attributeCount() {
327         return target().attributeCount();
328     }
329
330     public Iterator JavaDoc attributeIterator() {
331         return target().attributeIterator();
332     }
333
334     public Attribute attribute(int i) {
335         return target().attribute( i );
336     }
337
338     public Attribute attribute(String JavaDoc name) {
339         return target().attribute( name );
340     }
341
342     public Attribute attribute(QName qName) {
343         return target().attribute( qName );
344     }
345
346     public String JavaDoc attributeValue(String JavaDoc name) {
347         return target().attributeValue( name );
348     }
349
350     public String JavaDoc attributeValue(String JavaDoc name, String JavaDoc defaultValue) {
351         return target().attributeValue( name, defaultValue );
352     }
353
354     public String JavaDoc attributeValue(QName qName) {
355         return target().attributeValue( qName );
356     }
357
358     public String JavaDoc attributeValue(QName qName, String JavaDoc defaultValue) {
359         return target().attributeValue( qName, defaultValue );
360     }
361
362     /**
363      * @deprecated
364      */

365     public void setAttributeValue(String JavaDoc name, String JavaDoc value) {
366         target().setAttributeValue( name, value );
367     }
368
369     /**
370      * @deprecated
371      */

372     public void setAttributeValue(QName qName, String JavaDoc value) {
373         target().setAttributeValue( qName, value );
374     }
375
376     public Element element(String JavaDoc name) {
377         return target().element( name );
378     }
379
380     public Element element(QName qName) {
381         return target().element( qName );
382     }
383
384     public List JavaDoc elements() {
385         return target().elements();
386     }
387
388     public List JavaDoc elements(String JavaDoc name) {
389         return target().elements( name );
390     }
391
392     public List JavaDoc elements(QName qName) {
393         return target().elements( qName );
394     }
395
396     public Iterator JavaDoc elementIterator() {
397         return target().elementIterator();
398     }
399
400     public Iterator JavaDoc elementIterator(String JavaDoc name) {
401         return target().elementIterator( name );
402
403     }
404
405     public Iterator JavaDoc elementIterator(QName qName) {
406         return target().elementIterator( qName );
407     }
408
409     public boolean isRootElement() {
410         return target().isRootElement();
411     }
412
413     public boolean hasMixedContent() {
414         return target().hasMixedContent();
415     }
416
417     public boolean isTextOnly() {
418         return target().isTextOnly();
419     }
420
421     public void appendAttributes(Element element) {
422         target().appendAttributes( element );
423     }
424
425     public Element createCopy() {
426         return target().createCopy();
427     }
428
429     public Element createCopy(String JavaDoc name) {
430         return target().createCopy( name );
431     }
432
433     public Element createCopy(QName qName) {
434         return target().createCopy( qName );
435     }
436
437     public String JavaDoc elementText(String JavaDoc name) {
438         return target().elementText( name );
439     }
440
441     public String JavaDoc elementText(QName qName) {
442         return target().elementText( qName );
443     }
444
445     public String JavaDoc elementTextTrim(String JavaDoc name) {
446         return target().elementTextTrim( name );
447     }
448
449     public String JavaDoc elementTextTrim(QName qName) {
450         return target().elementTextTrim( qName );
451     }
452
453     public Node getXPathResult(int i) {
454         return target().getXPathResult( i );
455     }
456
457     public Node node(int i) {
458         return target().node( i );
459     }
460
461     public int indexOf(Node node) {
462         return target().indexOf( node );
463     }
464
465     public int nodeCount() {
466         return target().nodeCount();
467     }
468
469     public Element elementByID(String JavaDoc id) {
470         return target().elementByID( id );
471     }
472
473     public List JavaDoc content() {
474         return target().content();
475     }
476
477     public Iterator JavaDoc nodeIterator() {
478         return target().nodeIterator();
479     }
480
481     public void setContent(List JavaDoc list) {
482         target().setContent( list );
483     }
484
485     public void appendContent(Branch branch) {
486         target().appendContent( branch );
487     }
488
489     public void clearContent() {
490         target().clearContent();
491     }
492
493     public List JavaDoc processingInstructions() {
494         return target().processingInstructions();
495     }
496
497     public List JavaDoc processingInstructions(String JavaDoc name) {
498         return target().processingInstructions( name );
499     }
500
501     public ProcessingInstruction processingInstruction(String JavaDoc name) {
502         return target().processingInstruction( name );
503     }
504
505     public void setProcessingInstructions(List JavaDoc list) {
506         target().setProcessingInstructions( list );
507     }
508
509     public Element addElement(String JavaDoc name) {
510         return target().addElement( name );
511     }
512
513     public Element addElement(QName qName) {
514         return target().addElement( qName );
515     }
516
517     public Element addElement(String JavaDoc name, String JavaDoc text) {
518         return target().addElement( name, text );
519
520     }
521
522     public boolean removeProcessingInstruction(String JavaDoc name) {
523         return target().removeProcessingInstruction( name );
524     }
525
526     public void add(Node node) {
527         target().add( node );
528     }
529
530     public void add(Comment comment) {
531         target().add( comment );
532     }
533
534     public void add(Element element) {
535         target().add( element );
536     }
537
538     public void add(ProcessingInstruction processingInstruction) {
539         target().add( processingInstruction );
540     }
541
542     public boolean remove(Node node) {
543         return target().remove( node );
544     }
545
546     public boolean remove(Comment comment) {
547         return target().remove( comment );
548     }
549
550     public boolean remove(Element element) {
551         return target().remove( element );
552     }
553
554     public boolean remove(ProcessingInstruction processingInstruction) {
555         return target().remove( processingInstruction );
556     }
557
558     public void normalize() {
559         target().normalize();
560     }
561
562     private Element target() {
563         return li.getElement();
564     }
565 }
566
Popular Tags