1 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 ; 21 import java.io.Writer ; 22 import java.io.IOException ; 23 import java.util.List ; 24 import java.util.Map ; 25 import java.util.Iterator ; 26 27 32 public class Dom4jProxy implements HibernateProxy, Element, Serializable { 33 34 private Dom4jLazyInitializer li; 35 36 public Dom4jProxy(Dom4jLazyInitializer li) { 37 this.li = li; 38 } 39 40 public Object 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 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 s) { 65 return target().getNamespaceForPrefix( s ); 66 } 67 68 public Namespace getNamespaceForURI(String s) { 69 return target().getNamespaceForURI( s ); 70 } 71 72 public List getNamespacesForURI(String s) { 73 return target().getNamespacesForURI( s ); 74 } 75 76 public String getNamespacePrefix() { 77 return target().getNamespacePrefix(); 78 } 79 80 public String getNamespaceURI() { 81 return target().getNamespaceURI(); 82 } 83 84 public String getQualifiedName() { 85 return target().getQualifiedName(); 86 } 87 88 public List additionalNamespaces() { 89 return target().additionalNamespaces(); 90 } 91 92 public List declaredNamespaces() { 93 return target().declaredNamespaces(); 94 } 95 96 public Element addAttribute(String attrName, String text) { 97 return target().addAttribute( attrName, text ); 98 } 99 100 public Element addAttribute(QName attrName, String text) { 101 return target().addAttribute( attrName, text ); 102 } 103 104 public Element addComment(String text) { 105 return target().addComment( text ); 106 } 107 108 public Element addCDATA(String text) { 109 return target().addCDATA( text ); 110 } 111 112 public Element addEntity(String name, String text) { 113 return target().addEntity( name, text ); 114 } 115 116 public Element addNamespace(String prefix, String uri) { 117 return target().addNamespace( prefix, uri ); 118 } 119 120 public Element addProcessingInstruction(String target, String text) { 121 return target().addProcessingInstruction( target, text ); 122 } 123 124 public Element addProcessingInstruction(String target, Map data) { 125 return target().addProcessingInstruction( target, data ); 126 } 127 128 public Element addText(String 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 getName() { 201 return target().getName(); 202 } 203 204 public void setName(String name) { 205 target().setName( name ); 206 } 207 208 public String getText() { 209 return target().getText(); 210 } 211 212 public void setText(String text) { 213 target().setText( text ); 214 } 215 216 public String getTextTrim() { 217 return target().getTextTrim(); 218 } 219 220 public String getStringValue() { 221 return target().getStringValue(); 222 } 223 224 public String getPath() { 225 return target().getPath(); 226 } 227 228 public String getPath(Element element) { 229 return target().getPath( element ); 230 } 231 232 public String getUniquePath() { 233 return target().getUniquePath(); 234 } 235 236 public String getUniquePath(Element element) { 237 return target().getUniquePath( element ); 238 } 239 240 public String asXML() { 241 return target().asXML(); 242 } 243 244 public void write(Writer writer) throws IOException { 245 target().write( writer ); 246 } 247 248 public short getNodeType() { 249 return target().getNodeType(); 250 } 251 252 public String 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 selectNodes(String xpath) { 263 return target().selectNodes( xpath ); 264 } 265 266 public Object selectObject(String xpath) { 267 return target().selectObject( xpath ); 268 } 269 270 public List selectNodes(String xpath, String comparison) { 271 return target().selectNodes( xpath, comparison ); 272 } 273 274 public List selectNodes(String xpath, String comparison, boolean removeDups) { 275 return target().selectNodes( xpath, comparison, removeDups ); 276 } 277 278 public Node selectSingleNode(String xpath) { 279 return target().selectSingleNode( xpath ); 280 } 281 282 public String valueOf(String xpath) { 283 return target().valueOf( xpath ); 284 } 285 286 public Number numberValueOf(String xpath) { 287 return target().numberValueOf( xpath ); 288 } 289 290 public boolean matches(String xpath) { 291 return target().matches( xpath ); 292 } 293 294 public XPath createXPath(String 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 clone() { 307 return target().clone(); 308 } 309 310 public Object getData() { 311 return target().getData(); 312 } 313 314 public void setData(Object data) { 315 target().setData( data ); 316 } 317 318 public List attributes() { 319 return target().attributes(); 320 } 321 322 public void setAttributes(List list) { 323 target().setAttributes( list ); 324 } 325 326 public int attributeCount() { 327 return target().attributeCount(); 328 } 329 330 public Iterator 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 name) { 339 return target().attribute( name ); 340 } 341 342 public Attribute attribute(QName qName) { 343 return target().attribute( qName ); 344 } 345 346 public String attributeValue(String name) { 347 return target().attributeValue( name ); 348 } 349 350 public String attributeValue(String name, String defaultValue) { 351 return target().attributeValue( name, defaultValue ); 352 } 353 354 public String attributeValue(QName qName) { 355 return target().attributeValue( qName ); 356 } 357 358 public String attributeValue(QName qName, String defaultValue) { 359 return target().attributeValue( qName, defaultValue ); 360 } 361 362 365 public void setAttributeValue(String name, String value) { 366 target().setAttributeValue( name, value ); 367 } 368 369 372 public void setAttributeValue(QName qName, String value) { 373 target().setAttributeValue( qName, value ); 374 } 375 376 public Element element(String name) { 377 return target().element( name ); 378 } 379 380 public Element element(QName qName) { 381 return target().element( qName ); 382 } 383 384 public List elements() { 385 return target().elements(); 386 } 387 388 public List elements(String name) { 389 return target().elements( name ); 390 } 391 392 public List elements(QName qName) { 393 return target().elements( qName ); 394 } 395 396 public Iterator elementIterator() { 397 return target().elementIterator(); 398 } 399 400 public Iterator elementIterator(String name) { 401 return target().elementIterator( name ); 402 403 } 404 405 public Iterator 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 name) { 430 return target().createCopy( name ); 431 } 432 433 public Element createCopy(QName qName) { 434 return target().createCopy( qName ); 435 } 436 437 public String elementText(String name) { 438 return target().elementText( name ); 439 } 440 441 public String elementText(QName qName) { 442 return target().elementText( qName ); 443 } 444 445 public String elementTextTrim(String name) { 446 return target().elementTextTrim( name ); 447 } 448 449 public String 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 id) { 470 return target().elementByID( id ); 471 } 472 473 public List content() { 474 return target().content(); 475 } 476 477 public Iterator nodeIterator() { 478 return target().nodeIterator(); 479 } 480 481 public void setContent(List 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 processingInstructions() { 494 return target().processingInstructions(); 495 } 496 497 public List processingInstructions(String name) { 498 return target().processingInstructions( name ); 499 } 500 501 public ProcessingInstruction processingInstruction(String name) { 502 return target().processingInstruction( name ); 503 } 504 505 public void setProcessingInstructions(List list) { 506 target().setProcessingInstructions( list ); 507 } 508 509 public Element addElement(String 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 name, String text) { 518 return target().addElement( name, text ); 519 520 } 521 522 public boolean removeProcessingInstruction(String 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 |