Project

General

Profile

« Previous | Next » 

Revision 1062

Added by Jing Tao almost 22 years ago

Assign debug level to parser. (it level is 50)

View differences:

src/edu/ucsb/nceas/metacat/DBSAXHandler.java
149 149
 
150 150
   /** SAX Handler that receives notification of beginning of the document */
151 151
   public void startDocument() throws SAXException {
152
     MetaCatUtil.debugMessage("start Document");
152
     MetaCatUtil.debugMessage("start Document", 50);
153 153

  
154 154
     // Create the document node representation as root
155 155
     rootNode = new DBSAXNode(conn, this.docid);
......
160 160

  
161 161
   /** SAX Handler that receives notification of end of the document */
162 162
   public void endDocument() throws SAXException {
163
     MetaCatUtil.debugMessage("end Document");
163
     MetaCatUtil.debugMessage("end Document", 50);
164 164
     // Starting new thread for writing XML Index.
165 165
     // It calls the run method of the thread.
166 166
     try {
......
177 177
   public void startPrefixMapping(String prefix, String uri) 
178 178
                                          throws SAXException
179 179
   {
180
    MetaCatUtil.debugMessage("NAMESPACE");
180
    MetaCatUtil.debugMessage("NAMESPACE", 50);
181 181

  
182 182
    namespaces.put(prefix, uri);
183 183
   }
......
186 186
   public void startElement(String uri, String localName,
187 187
                            String qName, Attributes atts) 
188 188
               throws SAXException {
189
     MetaCatUtil.debugMessage("Start ELEMENT " + qName);
189
     MetaCatUtil.debugMessage("Start ELEMENT " + qName, 50);
190 190
 
191 191
     DBSAXNode parentNode = null;
192 192
     DBSAXNode currentNode = null;
......
205 205
       if (docname == null) {
206 206
         docname = localName;
207 207
         doctype = docname;
208
         MetaCatUtil.debugMessage("DOCNAME-a: " + docname);
209
         MetaCatUtil.debugMessage("DOCTYPE-a: " + doctype);
208
         MetaCatUtil.debugMessage("DOCNAME-a: " + docname, 50);
209
         MetaCatUtil.debugMessage("DOCTYPE-a: " + doctype, 50);
210 210
       } else if (doctype == null) {
211 211
         doctype = docname;
212
         MetaCatUtil.debugMessage("DOCTYPE-b: " + doctype);
212
         MetaCatUtil.debugMessage("DOCTYPE-b: " + doctype, 50);
213 213
       }
214 214
       rootNode.writeNodename(docname);
215 215
       try {
......
379 379

  
380 380
  /** SAX Handler that is called for each XML text node */
381 381
  public void characters(char[] cbuf, int start, int len) throws SAXException {
382
     MetaCatUtil.debugMessage("CHARACTERS");
382
     MetaCatUtil.debugMessage("CHARACTERS", 50);
383 383
     DBSAXNode currentNode = (DBSAXNode)nodeStack.peek();
384 384
     String data = null;
385 385
     int leftover = len;
......
415 415
     // When validation is turned "on", white spaces are reported here
416 416
     // When validation is turned "off" white spaces are not reported here,
417 417
     // but through characters() callback
418
     MetaCatUtil.debugMessage("IGNORABLEWHITESPACE");
418
     MetaCatUtil.debugMessage("IGNORABLEWHITESPACE", 50);
419 419
   
420 420

  
421 421
     DBSAXNode currentNode = (DBSAXNode)nodeStack.peek();
......
450 450
    */
451 451
   public void processingInstruction(String target, String data) 
452 452
          throws SAXException {
453
     MetaCatUtil.debugMessage("PI");
453
     MetaCatUtil.debugMessage("PI", 50);
454 454
     DBSAXNode currentNode = (DBSAXNode)nodeStack.peek();
455 455
     currentNode.writeChildNodeToDB("PI", target, data, docid);
456 456
   }
......
458 458
   /** SAX Handler that is called at the end of each XML element */
459 459
   public void endElement(String uri, String localName,
460 460
                          String qName) throws SAXException {
461
     MetaCatUtil.debugMessage("End ELEMENT " + qName);
461
     MetaCatUtil.debugMessage("End ELEMENT " + qName, 50);
462 462

  
463 463
     // Get the node from the stack
464 464
     DBSAXNode currentNode = (DBSAXNode)nodeStack.pop();
......
475 475
     doctype = publicId;
476 476
     systemid = systemId;
477 477

  
478
     MetaCatUtil.debugMessage("Start DTD");
479
     MetaCatUtil.debugMessage("DOCNAME: " + docname);
480
     MetaCatUtil.debugMessage("DOCTYPE: " + doctype);
481
     MetaCatUtil.debugMessage("  SYSID: " + systemid);
478
     MetaCatUtil.debugMessage("Start DTD", 50);
479
     MetaCatUtil.debugMessage("DOCNAME: " + docname, 50);
480
     MetaCatUtil.debugMessage("DOCTYPE: " + doctype, 50);
481
     MetaCatUtil.debugMessage("  SYSID: " + systemid, 50);
482 482
   }
483 483

  
484 484
   /** 
......
486 486
    */
487 487
   public void endDTD() throws SAXException {
488 488
    
489
     MetaCatUtil.debugMessage("end DTD");
489
     MetaCatUtil.debugMessage("end DTD", 50);
490 490
   }
491 491

  
492 492
   /** 
493 493
    * SAX Handler that receives notification of comments in the DTD
494 494
    */
495 495
   public void comment(char[] ch, int start, int length) throws SAXException {
496
     MetaCatUtil.debugMessage("COMMENT");
496
     MetaCatUtil.debugMessage("COMMENT", 50);
497 497
     if ( !processingDTD ) {
498 498
       DBSAXNode currentNode = (DBSAXNode)nodeStack.peek();
499 499
       currentNode.writeChildNodeToDB("COMMENT", null, new String(ch), docid);
......
504 504
    * SAX Handler that receives notification of the start of CDATA sections
505 505
    */
506 506
   public void startCDATA() throws SAXException {
507
     MetaCatUtil.debugMessage("start CDATA");
507
     MetaCatUtil.debugMessage("start CDATA", 50);
508 508
   }
509 509

  
510 510
   /** 
511 511
    * SAX Handler that receives notification of the end of CDATA sections
512 512
    */
513 513
   public void endCDATA() throws SAXException {
514
     MetaCatUtil.debugMessage("end CDATA");
514
     MetaCatUtil.debugMessage("end CDATA", 50);
515 515
   }
516 516

  
517 517
   /** 
518 518
    * SAX Handler that receives notification of the start of entities
519 519
    */
520 520
   public void startEntity(String name) throws SAXException {
521
     MetaCatUtil.debugMessage("start ENTITY: " + name);
521
     MetaCatUtil.debugMessage("start ENTITY: " + name, 50);
522 522
//System.out.println("start ENTITY: " + name);
523 523
     if (name.equals("[dtd]")) {
524 524
       processingDTD = true;
......
529 529
    * SAX Handler that receives notification of the end of entities
530 530
    */
531 531
   public void endEntity(String name) throws SAXException {
532
     MetaCatUtil.debugMessage("end ENTITY: " + name);
532
     MetaCatUtil.debugMessage("end ENTITY: " + name, 50);
533 533
//System.out.println("end ENTITY: " + name);
534 534
     if (name.equals("[dtd]")) {
535 535
       processingDTD = false;
......
542 542
   public void elementDecl(String name, String model)
543 543
                        throws org.xml.sax.SAXException {
544 544
//System.out.println("ELEMENTDECL: " + name + " " + model);
545
     MetaCatUtil.debugMessage("ELEMENTDECL: " + name + " " + model);
545
     MetaCatUtil.debugMessage("ELEMENTDECL: " + name + " " + model, 50);
546 546
   }
547 547

  
548 548
   /** 
......
557 557
//                        + value);
558 558
     MetaCatUtil.debugMessage("ATTRIBUTEDECL: " + eName + " " 
559 559
                        + aName + " " + type + " " + valueDefault + " "
560
                        + value);
560
                        + value, 50);
561 561
   }
562 562

  
563 563
   /** 
......
566 566
   public void internalEntityDecl(String name, String value)
567 567
                        throws org.xml.sax.SAXException {
568 568
//System.out.println("INTERNENTITYDECL: " + name + " " + value);
569
     MetaCatUtil.debugMessage("INTERNENTITYDECL: " + name + " " + value);
569
     MetaCatUtil.debugMessage("INTERNENTITYDECL: " + name + " " + value, 50);
570 570
   }
571 571

  
572 572
   /** 
......
578 578
//System.out.println("EXTERNENTITYDECL: " + name + " " + publicId 
579 579
//                              + " " + systemId);
580 580
     MetaCatUtil.debugMessage("EXTERNENTITYDECL: " + name + " " + publicId 
581
                              + " " + systemId);
581
                              + " " + systemId, 50);
582 582
     // it processes other external entity, not the DTD;
583 583
     // it doesn't signal for the DTD here
584 584
     processingDTD = false;
......
592 592
    * SAX Handler that receives notification of fatal parsing errors
593 593
    */
594 594
   public void fatalError(SAXParseException exception) throws SAXException {
595
     MetaCatUtil.debugMessage("FATALERROR");
595
     MetaCatUtil.debugMessage("FATALERROR", 50);
596 596
     throw (new SAXException("Fatal processing error.", exception));
597 597
   }
598 598

  
......
600 600
    * SAX Handler that receives notification of recoverable parsing errors
601 601
    */
602 602
   public void error(SAXParseException exception) throws SAXException {
603
     MetaCatUtil.debugMessage("ERROR");
603
     MetaCatUtil.debugMessage("ERROR", 50);
604 604
     throw (new SAXException("Processing error.", exception));
605 605
   }
606 606

  
......
608 608
    * SAX Handler that receives notification of warnings
609 609
    */
610 610
   public void warning(SAXParseException exception) throws SAXException {
611
     MetaCatUtil.debugMessage("WARNING");
611
     MetaCatUtil.debugMessage("WARNING", 50);
612 612
     throw (new SAXException("Warning.", exception));
613 613
   }
614 614

  

Also available in: Unified diff