1 package org.hibernate.tuple; 3 4 import java.io.IOException ; 5 import java.io.Serializable ; 6 import java.io.Writer ; 7 import java.util.Iterator ; 8 import java.util.List ; 9 import java.util.Map ; 10 11 import org.dom4j.Attribute; 12 import org.dom4j.Branch; 13 import org.dom4j.CDATA; 14 import org.dom4j.Comment; 15 import org.dom4j.Document; 16 import org.dom4j.Element; 17 import org.dom4j.Entity; 18 import org.dom4j.InvalidXPathException; 19 import org.dom4j.Namespace; 20 import org.dom4j.Node; 21 import org.dom4j.ProcessingInstruction; 22 import org.dom4j.QName; 23 import org.dom4j.Text; 24 import org.dom4j.Visitor; 25 import org.dom4j.XPath; 26 27 33 public class ElementWrapper implements Element, Serializable { 34 35 private Element element; 36 private Element parent; 37 38 public Element getElement() { 39 return element; 40 } 41 42 public ElementWrapper(Element element) { 43 this.element = element; 44 } 45 46 public QName getQName() { 47 return element.getQName(); 48 } 49 50 public QName getQName(String s) { 51 return element.getQName( s ); 52 } 53 54 public void setQName(QName qName) { 55 element.setQName( qName ); 56 } 57 58 public Namespace getNamespace() { 59 return element.getNamespace(); 60 } 61 62 public Namespace getNamespaceForPrefix(String s) { 63 return element.getNamespaceForPrefix( s ); 64 } 65 66 public Namespace getNamespaceForURI(String s) { 67 return element.getNamespaceForURI( s ); 68 } 69 70 public List getNamespacesForURI(String s) { 71 return element.getNamespacesForURI( s ); 72 } 73 74 public String getNamespacePrefix() { 75 return element.getNamespacePrefix(); 76 } 77 78 public String getNamespaceURI() { 79 return element.getNamespaceURI(); 80 } 81 82 public String getQualifiedName() { 83 return element.getQualifiedName(); 84 } 85 86 public List additionalNamespaces() { 87 return element.additionalNamespaces(); 88 } 89 90 public List declaredNamespaces() { 91 return element.declaredNamespaces(); 92 } 93 94 public Element addAttribute(String attrName, String text) { 95 return element.addAttribute( attrName, text ); 96 } 97 98 public Element addAttribute(QName attrName, String text) { 99 return element.addAttribute( attrName, text ); 100 } 101 102 public Element addComment(String text) { 103 return element.addComment( text ); 104 } 105 106 public Element addCDATA(String text) { 107 return element.addCDATA( text ); 108 } 109 110 public Element addEntity(String name, String text) { 111 return element.addEntity( name, text ); 112 } 113 114 public Element addNamespace(String prefix, String uri) { 115 return element.addNamespace( prefix, uri ); 116 } 117 118 public Element addProcessingInstruction(String target, String text) { 119 return element.addProcessingInstruction( target, text ); 120 } 121 122 public Element addProcessingInstruction(String target, Map data) { 123 return element.addProcessingInstruction( target, data ); 124 } 125 126 public Element addText(String text) { 127 return element.addText( text ); 128 } 129 130 public void add(Attribute attribute) { 131 element.add( attribute ); 132 } 133 134 public void add(CDATA cdata) { 135 element.add( cdata ); 136 } 137 138 public void add(Entity entity) { 139 element.add( entity ); 140 } 141 142 public void add(Text text) { 143 element.add( text ); 144 } 145 146 public void add(Namespace namespace) { 147 element.add( namespace ); 148 } 149 150 public boolean remove(Attribute attribute) { 151 return element.remove( attribute ); 152 } 153 154 public boolean remove(CDATA cdata) { 155 return element.remove( cdata ); 156 } 157 158 public boolean remove(Entity entity) { 159 return element.remove( entity ); 160 } 161 162 public boolean remove(Namespace namespace) { 163 return element.remove( namespace ); 164 } 165 166 public boolean remove(Text text) { 167 return element.remove( text ); 168 } 169 170 public boolean supportsParent() { 171 return element.supportsParent(); 172 } 173 174 public Element getParent() { 175 return parent==null ? element.getParent() : parent; 176 } 177 178 public void setParent(Element parent) { 179 element.setParent( parent ); 180 this.parent = parent; 181 } 182 183 public Document getDocument() { 184 return element.getDocument(); 185 } 186 187 public void setDocument(Document document) { 188 element.setDocument( document ); 189 } 190 191 public boolean isReadOnly() { 192 return element.isReadOnly(); 193 } 194 195 public boolean hasContent() { 196 return element.hasContent(); 197 } 198 199 public String getName() { 200 return element.getName(); 201 } 202 203 public void setName(String name) { 204 element.setName( name ); 205 } 206 207 public String getText() { 208 return element.getText(); 209 } 210 211 public void setText(String text) { 212 element.setText( text ); 213 } 214 215 public String getTextTrim() { 216 return element.getTextTrim(); 217 } 218 219 public String getStringValue() { 220 return element.getStringValue(); 221 } 222 223 public String getPath() { 224 return element.getPath(); 225 } 226 227 public String getPath(Element element) { 228 return element.getPath( element ); 229 } 230 231 public String getUniquePath() { 232 return element.getUniquePath(); 233 } 234 235 public String getUniquePath(Element element) { 236 return element.getUniquePath( element ); 237 } 238 239 public String asXML() { 240 return element.asXML(); 241 } 242 243 public void write(Writer writer) throws IOException { 244 element.write( writer ); 245 } 246 247 public short getNodeType() { 248 return element.getNodeType(); 249 } 250 251 public String getNodeTypeName() { 252 return element.getNodeTypeName(); 253 } 254 255 public Node detach() { 256 if (parent!=null) { 257 parent.remove(this); 258 parent = null; 259 } 260 return element.detach(); 261 } 262 263 public List selectNodes(String xpath) { 264 return element.selectNodes( xpath ); 265 } 266 267 public Object selectObject(String xpath) { 268 return element.selectObject( xpath ); 269 } 270 271 public List selectNodes(String xpath, String comparison) { 272 return element.selectNodes( xpath, comparison ); 273 } 274 275 public List selectNodes(String xpath, String comparison, boolean removeDups) { 276 return element.selectNodes( xpath, comparison, removeDups ); 277 } 278 279 public Node selectSingleNode(String xpath) { 280 return element.selectSingleNode( xpath ); 281 } 282 283 public String valueOf(String xpath) { 284 return element.valueOf( xpath ); 285 } 286 287 public Number numberValueOf(String xpath) { 288 return element.numberValueOf( xpath ); 289 } 290 291 public boolean matches(String xpath) { 292 return element.matches( xpath ); 293 } 294 295 public XPath createXPath(String xpath) throws InvalidXPathException { 296 return element.createXPath( xpath ); 297 } 298 299 public Node asXPathResult(Element element) { 300 return element.asXPathResult( element ); 301 } 302 303 public void accept(Visitor visitor) { 304 element.accept( visitor ); 305 } 306 307 public Object clone() { 308 return element.clone(); 309 } 310 311 public Object getData() { 312 return element.getData(); 313 } 314 315 public void setData(Object data) { 316 element.setData( data ); 317 } 318 319 public List attributes() { 320 return element.attributes(); 321 } 322 323 public void setAttributes(List list) { 324 element.setAttributes( list ); 325 } 326 327 public int attributeCount() { 328 return element.attributeCount(); 329 } 330 331 public Iterator attributeIterator() { 332 return element.attributeIterator(); 333 } 334 335 public Attribute attribute(int i) { 336 return element.attribute( i ); 337 } 338 339 public Attribute attribute(String name) { 340 return element.attribute( name ); 341 } 342 343 public Attribute attribute(QName qName) { 344 return element.attribute( qName ); 345 } 346 347 public String attributeValue(String name) { 348 return element.attributeValue( name ); 349 } 350 351 public String attributeValue(String name, String defaultValue) { 352 return element.attributeValue( name, defaultValue ); 353 } 354 355 public String attributeValue(QName qName) { 356 return element.attributeValue( qName ); 357 } 358 359 public String attributeValue(QName qName, String defaultValue) { 360 return element.attributeValue( qName, defaultValue ); 361 } 362 363 366 public void setAttributeValue(String name, String value) { 367 element.setAttributeValue( name, value ); 368 } 369 370 373 public void setAttributeValue(QName qName, String value) { 374 element.setAttributeValue( qName, value ); 375 } 376 377 public Element element(String name) { 378 return element.element( name ); 379 } 380 381 public Element element(QName qName) { 382 return element.element( qName ); 383 } 384 385 public List elements() { 386 return element.elements(); 387 } 388 389 public List elements(String name) { 390 return element.elements( name ); 391 } 392 393 public List elements(QName qName) { 394 return element.elements( qName ); 395 } 396 397 public Iterator elementIterator() { 398 return element.elementIterator(); 399 } 400 401 public Iterator elementIterator(String name) { 402 return element.elementIterator( name ); 403 404 } 405 406 public Iterator elementIterator(QName qName) { 407 return element.elementIterator( qName ); 408 } 409 410 public boolean isRootElement() { 411 return element.isRootElement(); 412 } 413 414 public boolean hasMixedContent() { 415 return element.hasMixedContent(); 416 } 417 418 public boolean isTextOnly() { 419 return element.isTextOnly(); 420 } 421 422 public void appendAttributes(Element element) { 423 element.appendAttributes( element ); 424 } 425 426 public Element createCopy() { 427 return element.createCopy(); 428 } 429 430 public Element createCopy(String name) { 431 return element.createCopy( name ); 432 } 433 434 public Element createCopy(QName qName) { 435 return element.createCopy( qName ); 436 } 437 438 public String elementText(String name) { 439 return element.elementText( name ); 440 } 441 442 public String elementText(QName qName) { 443 return element.elementText( qName ); 444 } 445 446 public String elementTextTrim(String name) { 447 return element.elementTextTrim( name ); 448 } 449 450 public String elementTextTrim(QName qName) { 451 return element.elementTextTrim( qName ); 452 } 453 454 public Node getXPathResult(int i) { 455 return element.getXPathResult( i ); 456 } 457 458 public Node node(int i) { 459 return element.node( i ); 460 } 461 462 public int indexOf(Node node) { 463 return element.indexOf( node ); 464 } 465 466 public int nodeCount() { 467 return element.nodeCount(); 468 } 469 470 public Element elementByID(String id) { 471 return element.elementByID( id ); 472 } 473 474 public List content() { 475 return element.content(); 476 } 477 478 public Iterator nodeIterator() { 479 return element.nodeIterator(); 480 } 481 482 public void setContent(List list) { 483 element.setContent( list ); 484 } 485 486 public void appendContent(Branch branch) { 487 element.appendContent( branch ); 488 } 489 490 public void clearContent() { 491 element.clearContent(); 492 } 493 494 public List processingInstructions() { 495 return element.processingInstructions(); 496 } 497 498 public List processingInstructions(String name) { 499 return element.processingInstructions( name ); 500 } 501 502 public ProcessingInstruction processingInstruction(String name) { 503 return element.processingInstruction( name ); 504 } 505 506 public void setProcessingInstructions(List list) { 507 element.setProcessingInstructions( list ); 508 } 509 510 public Element addElement(String name) { 511 return element.addElement( name ); 512 } 513 514 public Element addElement(QName qName) { 515 return element.addElement( qName ); 516 } 517 518 public Element addElement(String name, String text) { 519 return element.addElement( name, text ); 520 521 } 522 523 public boolean removeProcessingInstruction(String name) { 524 return element.removeProcessingInstruction( name ); 525 } 526 527 public void add(Node node) { 528 element.add( node ); 529 } 530 531 public void add(Comment comment) { 532 element.add( comment ); 533 } 534 535 public void add(Element element) { 536 element.add( element ); 537 } 538 539 public void add(ProcessingInstruction processingInstruction) { 540 element.add( processingInstruction ); 541 } 542 543 public boolean remove(Node node) { 544 return element.remove( node ); 545 } 546 547 public boolean remove(Comment comment) { 548 return element.remove( comment ); 549 } 550 551 public boolean remove(Element element) { 552 return element.remove( element ); 553 } 554 555 public boolean remove(ProcessingInstruction processingInstruction) { 556 return element.remove( processingInstruction ); 557 } 558 559 public void normalize() { 560 element.normalize(); 561 } 562 563 public boolean equals(Object other) { 564 return element.equals(other); 565 } 566 567 public int hashCode() { 568 return element.hashCode(); 569 } 570 571 public String toString() { 572 return element.toString(); 573 } 574 575 } 576 | Popular Tags |