1 9 10 package org.netbeans.modules.tasklist.bugs.issues; 11 12 import java.net.MalformedURLException ; 13 import java.net.URL ; 14 15 32 public class IssuesScanner { 33 36 org.w3c.dom.Document document; 37 38 private IssuesList list; 39 private ProductComponent component; 40 private Person person; 41 private Issue issue; 42 43 46 public IssuesScanner(org.w3c.dom.Document document) { 47 this.document = document; 48 } 49 50 55 public IssuesList visitDocument() { 56 list = new IssuesList(); 57 org.w3c.dom.Element element = document.getDocumentElement(); 58 if ((element != null) && element.getTagName().equals("issues")) { 59 visitElement_issues(element); 60 } 61 if ((element != null) && element.getTagName().equals("components")) { 62 visitElement_components(element); 63 } 64 if ((element != null) && element.getTagName().equals("component")) { 65 visitElement_component(element); 66 } 67 if ((element != null) && element.getTagName().equals("subcomponent")) { 68 visitElement_subcomponent(element); 69 } 70 if ((element != null) && element.getTagName().equals("statuses")) { 71 visitElement_statuses(element); 72 } 73 if ((element != null) && element.getTagName().equals("status")) { 74 visitElement_status(element); 75 } 76 if ((element != null) && element.getTagName().equals("platforms")) { 77 visitElement_platforms(element); 78 } 79 if ((element != null) && element.getTagName().equals("platform")) { 80 visitElement_platform(element); 81 } 82 if ((element != null) && element.getTagName().equals("operating-systems")) { 83 visitElement_operating_systems(element); 84 } 85 if ((element != null) && element.getTagName().equals("os")) { 86 visitElement_os(element); 87 } 88 if ((element != null) && element.getTagName().equals("versions")) { 89 visitElement_versions(element); 90 } 91 if ((element != null) && element.getTagName().equals("version")) { 92 visitElement_version(element); 93 } 94 if ((element != null) && element.getTagName().equals("priorities")) { 95 visitElement_priorities(element); 96 } 97 if ((element != null) && element.getTagName().equals("priority")) { 98 visitElement_priority(element); 99 } 100 if ((element != null) && element.getTagName().equals("issue-types")) { 101 visitElement_issue_types(element); 102 } 103 if ((element != null) && element.getTagName().equals("issue-type")) { 104 visitElement_issue_type(element); 105 } 106 if ((element != null) && element.getTagName().equals("persons")) { 107 visitElement_persons(element); 108 } 109 if ((element != null) && element.getTagName().equals("person")) { 110 visitElement_person(element); 111 } 112 if ((element != null) && element.getTagName().equals("resolutions")) { 113 visitElement_resolutions(element); 114 } 115 if ((element != null) && element.getTagName().equals("resolution")) { 116 visitElement_resolution(element); 117 } 118 if ((element != null) && element.getTagName().equals("issue")) { 119 visitElement_issue(element); 120 } 121 if ((element != null) && element.getTagName().equals("depends-on")) { 122 visitElement_depends_on(element); 123 } 124 if ((element != null) && element.getTagName().equals("comment")) { 125 visitElement_comment(element); 126 } 127 return list; 128 } 129 130 133 void visitElement_issues(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 136 for (int i = 0; i < nodes.getLength(); i++) { 137 org.w3c.dom.Node node = nodes.item(i); 138 switch (node.getNodeType()) { 139 case org.w3c.dom.Node.CDATA_SECTION_NODE: 140 break; 142 case org.w3c.dom.Node.ELEMENT_NODE: 143 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 144 if (nodeElement.getTagName().equals("components")) { 145 visitElement_components(nodeElement); 146 } 147 if (nodeElement.getTagName().equals("statuses")) { 148 visitElement_statuses(nodeElement); 149 } 150 if (nodeElement.getTagName().equals("platforms")) { 151 visitElement_platforms(nodeElement); 152 } 153 if (nodeElement.getTagName().equals("operating-systems")) { 154 visitElement_operating_systems(nodeElement); 155 } 156 if (nodeElement.getTagName().equals("versions")) { 157 visitElement_versions(nodeElement); 158 } 159 if (nodeElement.getTagName().equals("priorities")) { 160 visitElement_priorities(nodeElement); 161 } 162 if (nodeElement.getTagName().equals("issue-types")) { 163 visitElement_issue_types(nodeElement); 164 } 165 if (nodeElement.getTagName().equals("persons")) { 166 visitElement_persons(nodeElement); 167 } 168 if (nodeElement.getTagName().equals("resolutions")) { 169 visitElement_resolutions(nodeElement); 170 } 171 if (nodeElement.getTagName().equals("issue")) { 172 visitElement_issue(nodeElement); 173 } 174 break; 175 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 176 break; 179 } 180 } 181 } 182 183 186 void visitElement_components(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 189 for (int i = 0; i < nodes.getLength(); i++) { 190 org.w3c.dom.Node node = nodes.item(i); 191 switch (node.getNodeType()) { 192 case org.w3c.dom.Node.CDATA_SECTION_NODE: 193 break; 195 case org.w3c.dom.Node.ELEMENT_NODE: 196 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 197 if (nodeElement.getTagName().equals("component")) { 198 visitElement_component(nodeElement); 199 } 200 break; 201 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 202 break; 205 } 206 } 207 } 208 209 212 void visitElement_component(org.w3c.dom.Element element) { org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 215 for (int i = 0; i < attrs.getLength(); i++) { 216 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 217 if (attr.getName().equals("name")) { component = new ProductComponent(); 219 component.name = attr.getValue(); 220 list.components.add(component); 221 } 222 } 223 org.w3c.dom.NodeList nodes = element.getChildNodes(); 224 for (int i = 0; i < nodes.getLength(); i++) { 225 org.w3c.dom.Node node = nodes.item(i); 226 switch (node.getNodeType()) { 227 case org.w3c.dom.Node.CDATA_SECTION_NODE: 228 break; 230 case org.w3c.dom.Node.ELEMENT_NODE: 231 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 232 if (nodeElement.getTagName().equals("subcomponent")) { 233 visitElement_subcomponent(nodeElement); 234 } 235 break; 236 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 237 break; 240 } 241 } 242 } 243 244 247 void visitElement_subcomponent(org.w3c.dom.Element element) { org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 250 for (int i = 0; i < attrs.getLength(); i++) { 251 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 252 if (attr.getName().equals("name")) { component.subcomponents.add(attr.getValue()); 254 } 255 } 256 org.w3c.dom.NodeList nodes = element.getChildNodes(); 257 for (int i = 0; i < nodes.getLength(); i++) { 258 org.w3c.dom.Node node = nodes.item(i); 259 switch (node.getNodeType()) { 260 case org.w3c.dom.Node.CDATA_SECTION_NODE: 261 break; 263 case org.w3c.dom.Node.ELEMENT_NODE: 264 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 265 break; 266 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 267 break; 270 } 271 } 272 } 273 274 277 void visitElement_statuses(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 280 for (int i = 0; i < nodes.getLength(); i++) { 281 org.w3c.dom.Node node = nodes.item(i); 282 switch (node.getNodeType()) { 283 case org.w3c.dom.Node.CDATA_SECTION_NODE: 284 break; 286 case org.w3c.dom.Node.ELEMENT_NODE: 287 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 288 if (nodeElement.getTagName().equals("status")) { 289 visitElement_status(nodeElement); 290 } 291 break; 292 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 293 break; 296 } 297 } 298 } 299 300 303 void visitElement_status(org.w3c.dom.Element element) { org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 306 for (int i = 0; i < attrs.getLength(); i++) { 307 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 308 if (attr.getName().equals("name")) { list.statuses.add(attr.getValue()); 310 } 311 } 312 org.w3c.dom.NodeList nodes = element.getChildNodes(); 313 for (int i = 0; i < nodes.getLength(); i++) { 314 org.w3c.dom.Node node = nodes.item(i); 315 switch (node.getNodeType()) { 316 case org.w3c.dom.Node.CDATA_SECTION_NODE: 317 break; 319 case org.w3c.dom.Node.ELEMENT_NODE: 320 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 321 break; 322 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 323 break; 326 } 327 } 328 } 329 330 333 void visitElement_platforms(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 336 for (int i = 0; i < nodes.getLength(); i++) { 337 org.w3c.dom.Node node = nodes.item(i); 338 switch (node.getNodeType()) { 339 case org.w3c.dom.Node.CDATA_SECTION_NODE: 340 break; 342 case org.w3c.dom.Node.ELEMENT_NODE: 343 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 344 if (nodeElement.getTagName().equals("platform")) { 345 visitElement_platform(nodeElement); 346 } 347 break; 348 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 349 break; 352 } 353 } 354 } 355 356 359 void visitElement_platform(org.w3c.dom.Element element) { org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 362 for (int i = 0; i < attrs.getLength(); i++) { 363 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 364 if (attr.getName().equals("name")) { list.platforms.add(attr.getValue()); 366 } 367 } 368 org.w3c.dom.NodeList nodes = element.getChildNodes(); 369 for (int i = 0; i < nodes.getLength(); i++) { 370 org.w3c.dom.Node node = nodes.item(i); 371 switch (node.getNodeType()) { 372 case org.w3c.dom.Node.CDATA_SECTION_NODE: 373 break; 375 case org.w3c.dom.Node.ELEMENT_NODE: 376 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 377 break; 378 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 379 break; 382 } 383 } 384 } 385 386 389 void visitElement_operating_systems(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 392 for (int i = 0; i < nodes.getLength(); i++) { 393 org.w3c.dom.Node node = nodes.item(i); 394 switch (node.getNodeType()) { 395 case org.w3c.dom.Node.CDATA_SECTION_NODE: 396 break; 398 case org.w3c.dom.Node.ELEMENT_NODE: 399 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 400 if (nodeElement.getTagName().equals("os")) { 401 visitElement_os(nodeElement); 402 } 403 break; 404 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 405 break; 408 } 409 } 410 } 411 412 415 void visitElement_os(org.w3c.dom.Element element) { org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 418 for (int i = 0; i < attrs.getLength(); i++) { 419 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 420 if (attr.getName().equals("name")) { list.operatingSystems.add(attr.getValue()); 422 } 423 } 424 org.w3c.dom.NodeList nodes = element.getChildNodes(); 425 for (int i = 0; i < nodes.getLength(); i++) { 426 org.w3c.dom.Node node = nodes.item(i); 427 switch (node.getNodeType()) { 428 case org.w3c.dom.Node.CDATA_SECTION_NODE: 429 break; 431 case org.w3c.dom.Node.ELEMENT_NODE: 432 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 433 break; 434 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 435 break; 438 } 439 } 440 } 441 442 445 void visitElement_versions(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 448 for (int i = 0; i < nodes.getLength(); i++) { 449 org.w3c.dom.Node node = nodes.item(i); 450 switch (node.getNodeType()) { 451 case org.w3c.dom.Node.CDATA_SECTION_NODE: 452 break; 454 case org.w3c.dom.Node.ELEMENT_NODE: 455 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 456 if (nodeElement.getTagName().equals("version")) { 457 visitElement_version(nodeElement); 458 } 459 break; 460 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 461 break; 464 } 465 } 466 } 467 468 471 void visitElement_version(org.w3c.dom.Element element) { org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 474 for (int i = 0; i < attrs.getLength(); i++) { 475 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 476 if (attr.getName().equals("name")) { list.versions.add(attr.getValue()); 478 } 479 } 480 org.w3c.dom.NodeList nodes = element.getChildNodes(); 481 for (int i = 0; i < nodes.getLength(); i++) { 482 org.w3c.dom.Node node = nodes.item(i); 483 switch (node.getNodeType()) { 484 case org.w3c.dom.Node.CDATA_SECTION_NODE: 485 break; 487 case org.w3c.dom.Node.ELEMENT_NODE: 488 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 489 break; 490 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 491 break; 494 } 495 } 496 } 497 498 501 void visitElement_priorities(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 504 for (int i = 0; i < nodes.getLength(); i++) { 505 org.w3c.dom.Node node = nodes.item(i); 506 switch (node.getNodeType()) { 507 case org.w3c.dom.Node.CDATA_SECTION_NODE: 508 break; 510 case org.w3c.dom.Node.ELEMENT_NODE: 511 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 512 if (nodeElement.getTagName().equals("priority")) { 513 visitElement_priority(nodeElement); 514 } 515 break; 516 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 517 break; 520 } 521 } 522 } 523 524 527 void visitElement_priority(org.w3c.dom.Element element) { org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 530 for (int i = 0; i < attrs.getLength(); i++) { 531 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 532 if (attr.getName().equals("name")) { list.priorities.add(attr.getValue()); 534 } 535 } 536 org.w3c.dom.NodeList nodes = element.getChildNodes(); 537 for (int i = 0; i < nodes.getLength(); i++) { 538 org.w3c.dom.Node node = nodes.item(i); 539 switch (node.getNodeType()) { 540 case org.w3c.dom.Node.CDATA_SECTION_NODE: 541 break; 543 case org.w3c.dom.Node.ELEMENT_NODE: 544 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 545 break; 546 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 547 break; 550 } 551 } 552 } 553 554 557 void visitElement_issue_types(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 560 for (int i = 0; i < nodes.getLength(); i++) { 561 org.w3c.dom.Node node = nodes.item(i); 562 switch (node.getNodeType()) { 563 case org.w3c.dom.Node.CDATA_SECTION_NODE: 564 break; 566 case org.w3c.dom.Node.ELEMENT_NODE: 567 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 568 if (nodeElement.getTagName().equals("issue-type")) { 569 visitElement_issue_type(nodeElement); 570 } 571 break; 572 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 573 break; 576 } 577 } 578 } 579 580 583 void visitElement_issue_type(org.w3c.dom.Element element) { org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 586 for (int i = 0; i < attrs.getLength(); i++) { 587 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 588 if (attr.getName().equals("name")) { list.issueTypes.add(attr.getValue()); 590 } 591 } 592 org.w3c.dom.NodeList nodes = element.getChildNodes(); 593 for (int i = 0; i < nodes.getLength(); i++) { 594 org.w3c.dom.Node node = nodes.item(i); 595 switch (node.getNodeType()) { 596 case org.w3c.dom.Node.CDATA_SECTION_NODE: 597 break; 599 case org.w3c.dom.Node.ELEMENT_NODE: 600 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 601 break; 602 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 603 break; 606 } 607 } 608 } 609 610 613 void visitElement_persons(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 616 for (int i = 0; i < nodes.getLength(); i++) { 617 org.w3c.dom.Node node = nodes.item(i); 618 switch (node.getNodeType()) { 619 case org.w3c.dom.Node.CDATA_SECTION_NODE: 620 break; 622 case org.w3c.dom.Node.ELEMENT_NODE: 623 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 624 if (nodeElement.getTagName().equals("person")) { 625 visitElement_person(nodeElement); 626 } 627 break; 628 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 629 break; 632 } 633 } 634 } 635 636 639 void visitElement_person(org.w3c.dom.Element element) { person = new Person(); 642 list.persons.add(person); 643 org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 644 for (int i = 0; i < attrs.getLength(); i++) { 645 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 646 if (attr.getName().equals("first-name")) { person.firstName = attr.getValue(); 648 } 649 if (attr.getName().equals("surname")) { person.surname = attr.getValue(); 651 } 652 if (attr.getName().equals("email")) { person.email = attr.getValue(); 654 } 655 } 656 org.w3c.dom.NodeList nodes = element.getChildNodes(); 657 for (int i = 0; i < nodes.getLength(); i++) { 658 org.w3c.dom.Node node = nodes.item(i); 659 switch (node.getNodeType()) { 660 case org.w3c.dom.Node.CDATA_SECTION_NODE: 661 break; 663 case org.w3c.dom.Node.ELEMENT_NODE: 664 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 665 break; 666 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 667 break; 670 } 671 } 672 } 673 674 677 void visitElement_resolutions(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 680 for (int i = 0; i < nodes.getLength(); i++) { 681 org.w3c.dom.Node node = nodes.item(i); 682 switch (node.getNodeType()) { 683 case org.w3c.dom.Node.CDATA_SECTION_NODE: 684 break; 686 case org.w3c.dom.Node.ELEMENT_NODE: 687 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 688 if (nodeElement.getTagName().equals("resolution")) { 689 visitElement_resolution(nodeElement); 690 } 691 break; 692 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 693 break; 696 } 697 } 698 } 699 700 703 void visitElement_resolution(org.w3c.dom.Element element) { org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 706 for (int i = 0; i < attrs.getLength(); i++) { 707 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 708 if (attr.getName().equals("name")) { list.resolutions.add(attr.getValue()); 710 } 711 } 712 org.w3c.dom.NodeList nodes = element.getChildNodes(); 713 for (int i = 0; i < nodes.getLength(); i++) { 714 org.w3c.dom.Node node = nodes.item(i); 715 switch (node.getNodeType()) { 716 case org.w3c.dom.Node.CDATA_SECTION_NODE: 717 break; 719 case org.w3c.dom.Node.ELEMENT_NODE: 720 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 721 break; 722 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 723 break; 726 } 727 } 728 } 729 730 733 void visitElement_issue(org.w3c.dom.Element element) { issue = list.createIssue(); 736 737 org.w3c.dom.NamedNodeMap attrs = element.getAttributes(); 739 for (int i = 0; i < attrs.getLength(); i++) { 740 org.w3c.dom.Attr attr = (org.w3c.dom.Attr )attrs.item(i); 741 if (attr.getName().equals("id")) { issue.id = Integer.parseInt(attr.getValue()); 743 } 744 if (attr.getName().equals("component")) { issue.component = Integer.parseInt(attr.getValue()); 746 } 747 if (attr.getName().equals("subcomponent")) { issue.subcomponent = Integer.parseInt(attr.getValue()); 749 } 750 if (attr.getName().equals("status")) { issue.status = Integer.parseInt(attr.getValue()); 752 } 753 if (attr.getName().equals("platform")) { issue.platform = Integer.parseInt(attr.getValue()); 755 } 756 if (attr.getName().equals("os")) { issue.os = Integer.parseInt(attr.getValue()); 758 } 759 if (attr.getName().equals("version")) { issue.version = Integer.parseInt(attr.getValue()); 761 } 762 if (attr.getName().equals("priority")) { issue.priority = Integer.parseInt(attr.getValue()); 764 } 765 if (attr.getName().equals("issue-type")) { issue.type = Integer.parseInt(attr.getValue()); 767 } 768 if (attr.getName().equals("target-version")) { issue.targetVersion = Integer.parseInt(attr.getValue()); 770 } 771 if (attr.getName().equals("assigned-to")) { issue.assignedTo = Integer.parseInt(attr.getValue()); 773 } 774 if (attr.getName().equals("url")) { try { 776 issue.url = new URL (attr.getValue()); 777 } catch (MalformedURLException e) { 778 e.printStackTrace(); } 780 } 781 if (attr.getName().equals("summary")) { issue.summary = attr.getValue(); 783 } 784 if (attr.getName().equals("resolution")) { issue.resolution = Integer.parseInt(attr.getValue()); 786 } 787 } 788 org.w3c.dom.NodeList nodes = element.getChildNodes(); 789 for (int i = 0; i < nodes.getLength(); i++) { 790 org.w3c.dom.Node node = nodes.item(i); 791 switch (node.getNodeType()) { 792 case org.w3c.dom.Node.CDATA_SECTION_NODE: 793 break; 795 case org.w3c.dom.Node.ELEMENT_NODE: 796 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 797 if (nodeElement.getTagName().equals("depends-on")) { 798 visitElement_depends_on(nodeElement); 799 } 800 if (nodeElement.getTagName().equals("comment")) { 801 visitElement_comment(nodeElement); 802 } 803 break; 804 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 805 break; 808 } 809 } 810 } 811 812 815 void visitElement_depends_on(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 818 for (int i = 0; i < nodes.getLength(); i++) { 819 org.w3c.dom.Node node = nodes.item(i); 820 switch (node.getNodeType()) { 821 case org.w3c.dom.Node.CDATA_SECTION_NODE: 822 break; 824 case org.w3c.dom.Node.ELEMENT_NODE: 825 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 826 break; 827 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 828 break; 831 case org.w3c.dom.Node.TEXT_NODE: 832 issue.dependsOn.add(((org.w3c.dom.Text )node).getData()); 833 break; 834 } 835 } 836 } 837 838 841 void visitElement_comment(org.w3c.dom.Element element) { org.w3c.dom.NodeList nodes = element.getChildNodes(); 844 for (int i = 0; i < nodes.getLength(); i++) { 845 org.w3c.dom.Node node = nodes.item(i); 846 switch (node.getNodeType()) { 847 case org.w3c.dom.Node.CDATA_SECTION_NODE: 848 break; 850 case org.w3c.dom.Node.ELEMENT_NODE: 851 org.w3c.dom.Element nodeElement = (org.w3c.dom.Element )node; 852 break; 853 case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE: 854 break; 857 case org.w3c.dom.Node.TEXT_NODE: 858 issue.comments.add(((org.w3c.dom.Text )node).getData()); 859 break; 860 } 861 } 862 } 863 } 864 | Popular Tags |