1 16 19 package org.apache.xml.utils; 20 21 import org.apache.xml.res.XMLErrorResources; 22 import org.apache.xml.res.XMLMessages; 23 24 import org.w3c.dom.Attr ; 25 import org.w3c.dom.CDATASection ; 26 import org.w3c.dom.Comment ; 27 import org.w3c.dom.DOMException ; 28 import org.w3c.dom.DOMImplementation ; 29 import org.w3c.dom.Document ; 30 import org.w3c.dom.DocumentFragment ; 31 import org.w3c.dom.DocumentType ; 32 import org.w3c.dom.Element ; 33 import org.w3c.dom.EntityReference ; 34 import org.w3c.dom.NamedNodeMap ; 35 import org.w3c.dom.Node ; 36 import org.w3c.dom.NodeList ; 37 import org.w3c.dom.ProcessingInstruction ; 38 import org.w3c.dom.Text ; 39 40 44 public class UnImplNode implements Node , Element , NodeList , Document 45 { 46 47 51 public UnImplNode(){} 52 53 58 public void error(String msg) 59 { 60 61 System.out.println("DOM ERROR! class: " + this.getClass().getName()); 62 63 throw new RuntimeException (XMLMessages.createXMLMessage(msg, null)); 64 } 65 66 72 public void error(String msg, Object [] args) 73 { 74 75 System.out.println("DOM ERROR! class: " + this.getClass().getName()); 76 77 throw new RuntimeException (XMLMessages.createXMLMessage(msg, args)); } 79 80 89 public Node appendChild(Node newChild) throws DOMException 90 { 91 92 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 94 return null; 95 } 96 97 102 public boolean hasChildNodes() 103 { 104 105 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 107 return false; 108 } 109 110 115 public short getNodeType() 116 { 117 118 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 120 return 0; 121 } 122 123 128 public Node getParentNode() 129 { 130 131 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 133 return null; 134 } 135 136 141 public NodeList getChildNodes() 142 { 143 144 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 146 return null; 147 } 148 149 154 public Node getFirstChild() 155 { 156 157 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 159 return null; 160 } 161 162 167 public Node getLastChild() 168 { 169 170 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 172 return null; 173 } 174 175 180 public Node getNextSibling() 181 { 182 183 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 185 return null; 186 } 187 188 193 public int getLength() 194 { 195 196 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 198 return 0; 199 } 201 208 public Node item(int index) 209 { 210 211 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 213 return null; 214 } 216 221 public Document getOwnerDocument() 222 { 223 224 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 226 return null; 227 } 228 229 234 public String getTagName() 235 { 236 237 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 239 return null; 240 } 241 242 247 public String getNodeName() 248 { 249 250 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 252 return null; 253 } 254 255 256 public void normalize() 257 { 258 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); } 260 261 268 public NodeList getElementsByTagName(String name) 269 { 270 271 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 273 return null; 274 } 275 276 285 public Attr removeAttributeNode(Attr oldAttr) throws DOMException 286 { 287 288 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 290 return null; 291 } 292 293 302 public Attr setAttributeNode(Attr newAttr) throws DOMException 303 { 304 305 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 307 return null; 308 } 309 310 318 public boolean hasAttribute(String name) 319 { 320 321 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 323 return false; 324 } 325 326 335 public boolean hasAttributeNS(String name, String x) 336 { 337 338 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 340 return false; 341 } 342 343 351 public Attr getAttributeNode(String name) 352 { 353 354 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 356 return null; 357 } 358 359 366 public void removeAttribute(String name) throws DOMException 367 { 368 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); } 370 371 379 public void setAttribute(String name, String value) throws DOMException 380 { 381 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); } 383 384 391 public String getAttribute(String name) 392 { 393 394 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 396 return null; 397 } 398 399 404 public boolean hasAttributes() 405 { 406 407 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 409 return false; 410 } 411 412 420 public NodeList getElementsByTagNameNS(String namespaceURI, 421 String localName) 422 { 423 424 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 426 return null; 427 } 428 429 438 public Attr setAttributeNodeNS(Attr newAttr) throws DOMException 439 { 440 441 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 443 return null; 444 } 445 446 454 public Attr getAttributeNodeNS(String namespaceURI, String localName) 455 { 456 457 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 459 return null; 460 } 461 462 470 public void removeAttributeNS(String namespaceURI, String localName) 471 throws DOMException 472 { 473 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); } 475 476 486 public void setAttributeNS( 487 String namespaceURI, String qualifiedName, String value) 488 throws DOMException 489 { 490 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); } 492 493 501 public String getAttributeNS(String namespaceURI, String localName) 502 { 503 504 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 506 return null; 507 } 508 509 514 public Node getPreviousSibling() 515 { 516 517 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 519 return null; 520 } 521 522 529 public Node cloneNode(boolean deep) 530 { 531 532 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 534 return null; 535 } 536 537 544 public String getNodeValue() throws DOMException 545 { 546 547 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 549 return null; 550 } 551 552 559 public void setNodeValue(String nodeValue) throws DOMException 560 { 561 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); } 563 564 573 574 580 587 public void setValue(String value) throws DOMException 588 { 589 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); } 591 592 597 598 603 608 public Element getOwnerElement() 609 { 610 611 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 613 return null; 614 } 615 616 621 public boolean getSpecified() 622 { 623 624 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 626 return false; 627 } 628 629 634 public NamedNodeMap getAttributes() 635 { 636 637 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 639 return null; 640 } 641 642 652 public Node insertBefore(Node newChild, Node refChild) throws DOMException 653 { 654 655 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 657 return null; 658 } 659 660 670 public Node replaceChild(Node newChild, Node oldChild) throws DOMException 671 { 672 673 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 675 return null; 676 } 677 678 687 public Node removeChild(Node oldChild) throws DOMException 688 { 689 690 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 692 return null; 693 } 694 695 711 public boolean isSupported(String feature, String version) 712 { 713 return false; 714 } 715 716 721 public String getNamespaceURI() 722 { 723 724 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 726 return null; 727 } 728 729 734 public String getPrefix() 735 { 736 737 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 739 return null; 740 } 741 742 749 public void setPrefix(String prefix) throws DOMException 750 { 751 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); } 753 754 759 public String getLocalName() 760 { 761 762 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 764 return null; 765 } 766 767 772 public DocumentType getDoctype() 773 { 774 775 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 776 777 return null; 778 } 779 780 785 public DOMImplementation getImplementation() 786 { 787 788 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 789 790 return null; 791 } 792 793 798 public Element getDocumentElement() 799 { 800 801 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 802 803 return null; 804 } 805 806 815 public Element createElement(String tagName) throws DOMException 816 { 817 818 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 819 820 return null; 821 } 822 823 828 public DocumentFragment createDocumentFragment() 829 { 830 831 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 832 833 return null; 834 } 835 836 843 public Text createTextNode(String data) 844 { 845 846 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 847 848 return null; 849 } 850 851 858 public Comment createComment(String data) 859 { 860 861 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 862 863 return null; 864 } 865 866 875 public CDATASection createCDATASection(String data) throws DOMException 876 { 877 878 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 879 880 return null; 881 } 882 883 893 public ProcessingInstruction createProcessingInstruction( 894 String target, String data) throws DOMException 895 { 896 897 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 898 899 return null; 900 } 901 902 911 public Attr createAttribute(String name) throws DOMException 912 { 913 914 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 915 916 return null; 917 } 918 919 928 public EntityReference createEntityReference(String name) 929 throws DOMException 930 { 931 932 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 933 934 return null; 935 } 936 937 953 public Node importNode(Node importedNode, boolean deep) throws DOMException 954 { 955 956 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 957 958 return null; 959 } 960 961 971 public Element createElementNS(String namespaceURI, String qualifiedName) 972 throws DOMException 973 { 974 975 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 976 977 return null; 978 } 979 980 990 public Attr createAttributeNS(String namespaceURI, String qualifiedName) 991 throws DOMException 992 { 993 994 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 995 996 return null; 997 } 998 999 1006 public Element getElementById(String elementId) 1007 { 1008 1009 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1010 1011 return null; 1012 } 1013 1014 1022 public void setData(String data) throws DOMException 1023 { 1024 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1025 } 1026 1027 1037 public String substringData(int offset, int count) throws DOMException 1038 { 1039 1040 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1041 1042 return null; 1043 } 1044 1045 1052 public void appendData(String arg) throws DOMException 1053 { 1054 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1055 } 1056 1057 1066 public void insertData(int offset, String arg) throws DOMException 1067 { 1068 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1069 } 1070 1071 1079 public void deleteData(int offset, int count) throws DOMException 1080 { 1081 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1082 } 1083 1084 1093 public void replaceData(int offset, int count, String arg) 1094 throws DOMException 1095 { 1096 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1097 } 1098 1099 1108 public Text splitText(int offset) throws DOMException 1109 { 1110 1111 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1112 1113 return null; 1114 } 1115 1116 1126 public Node adoptNode(Node source) throws DOMException 1127 { 1128 1129 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1130 1131 return null; 1132 } 1133 1134 1145 public String getEncoding() 1146 { 1147 1148 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1149 1150 return null; 1151 } 1152 1153 1164 public void setEncoding(String encoding) 1165 { 1166 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1167 } 1168 1169 1180 public boolean getStandalone() 1181 { 1182 1183 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1184 1185 return false; 1186 } 1187 1188 1199 public void setStandalone(boolean standalone) 1200 { 1201 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1202 } 1203 1204 1219 public boolean getStrictErrorChecking() 1220 { 1221 1222 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1223 1224 return false; 1225 } 1226 1227 1242 public void setStrictErrorChecking(boolean strictErrorChecking) 1243 { 1244 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1245 } 1246 1247 1258 public String getVersion() 1259 { 1260 1261 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1262 1263 return null; 1264 } 1265 1266 1277 public void setVersion(String version) 1278 { 1279 error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); 1280 } 1281} 1282 | Popular Tags |