1 57 58 package com.sun.org.apache.xerces.internal.parsers; 59 60 import com.sun.org.apache.xerces.internal.xni.Augmentations; 61 import com.sun.org.apache.xerces.internal.xni.NamespaceContext; 62 import com.sun.org.apache.xerces.internal.xni.QName; 63 import com.sun.org.apache.xerces.internal.xni.XMLAttributes; 64 import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler; 65 import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler; 66 import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler; 67 import com.sun.org.apache.xerces.internal.xni.XMLLocator; 68 import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; 69 import com.sun.org.apache.xerces.internal.xni.XMLString; 70 import com.sun.org.apache.xerces.internal.xni.XNIException; 71 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDContentModelSource; 72 import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource; 73 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource; 74 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; 75 76 88 public abstract class AbstractXMLDocumentParser 89 extends XMLParser 90 implements XMLDocumentHandler, XMLDTDHandler, XMLDTDContentModelHandler { 91 92 96 98 99 protected boolean fInDTD; 100 101 102 protected XMLDocumentSource fDocumentSource; 103 104 105 protected XMLDTDSource fDTDSource; 106 107 108 protected XMLDTDContentModelSource fDTDContentModelSource; 109 110 114 118 protected AbstractXMLDocumentParser(XMLParserConfiguration config) { 119 super(config); 120 121 config.setDocumentHandler(this); 123 config.setDTDHandler(this); 124 config.setDTDContentModelHandler(this); 125 126 } 128 132 154 155 public void startDocument(XMLLocator locator, String encoding, 156 NamespaceContext namespaceContext, Augmentations augs) 157 throws XNIException { 158 } 160 173 public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) 174 throws XNIException { 175 } 177 189 public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs) 190 throws XNIException { 191 } 193 204 public void startElement(QName element, XMLAttributes attributes, Augmentations augs) 205 throws XNIException { 206 } 208 217 public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) 218 throws XNIException { 219 220 startElement(element, attributes, augs); 221 endElement(element, augs); 222 223 } 225 233 public void characters(XMLString text, Augmentations augs) throws XNIException { 234 } 236 249 public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException { 250 } 252 260 public void endElement(QName element, Augmentations augs) throws XNIException { 261 } 263 269 public void startCDATA(Augmentations augs) throws XNIException { 270 } 272 278 public void endCDATA(Augmentations augs) throws XNIException { 279 } 281 287 public void endDocument(Augmentations augs) throws XNIException { 288 } 290 291 308 public void startGeneralEntity(String name, 309 XMLResourceIdentifier identifier, 310 String encoding, 311 Augmentations augs) throws XNIException { 312 } 314 332 public void textDecl(String version, String encoding, Augmentations augs) throws XNIException { 333 } 335 347 public void endGeneralEntity(String name, Augmentations augs) 348 throws XNIException { 349 } 351 360 public void comment(XMLString text, Augmentations augs) throws XNIException { 361 } 363 381 public void processingInstruction(String target, XMLString data, Augmentations augs) 382 throws XNIException { 383 } 385 386 387 public void setDocumentSource(XMLDocumentSource source){ 388 fDocumentSource = source; 389 } 391 392 public XMLDocumentSource getDocumentSource (){ 393 return fDocumentSource; 394 } 399 413 public void startDTD(XMLLocator locator, Augmentations augs) throws XNIException { 414 fInDTD = true; 415 } 417 418 426 public void startExternalSubset(XMLResourceIdentifier identifier, Augmentations augmentations) 427 throws XNIException { 428 } 430 438 public void endExternalSubset(Augmentations augmentations) 439 throws XNIException { 440 } 442 459 public void startParameterEntity(String name, 460 XMLResourceIdentifier identifier, 461 String encoding, 462 Augmentations augs) throws XNIException { 463 } 465 477 public void endParameterEntity(String name, Augmentations augs) 478 throws XNIException { 479 } 481 490 public void ignoredCharacters(XMLString text, Augmentations augs) throws XNIException { 491 } 493 503 public void elementDecl(String name, String contentModel, Augmentations augs) 504 throws XNIException { 505 } 507 517 public void startAttlist(String elementName, Augmentations augs) throws XNIException { 518 } 520 545 public void attributeDecl(String elementName, String attributeName, 546 String type, String [] enumeration, 547 String defaultType, XMLString defaultValue, 548 XMLString nonNormalizedDefaultValue, Augmentations augs) 549 throws XNIException { 550 } 552 560 public void endAttlist(Augmentations augs) throws XNIException { 561 } 563 579 public void internalEntityDecl(String name, XMLString text, 580 XMLString nonNormalizedText, Augmentations augs) 581 throws XNIException { 582 } 584 597 public void externalEntityDecl(String name, XMLResourceIdentifier identifier, 598 Augmentations augs) throws XNIException { 599 } 601 613 public void unparsedEntityDecl(String name, XMLResourceIdentifier identifier, 614 String notation, Augmentations augs) throws XNIException { 615 } 617 628 public void notationDecl(String name, XMLResourceIdentifier identifier, 629 Augmentations augs) 630 throws XNIException { 631 } 633 646 public void startConditional(short type, Augmentations augs) throws XNIException { 647 } 649 657 public void endConditional(Augmentations augs) throws XNIException { 658 } 660 668 public void endDTD(Augmentations augs) throws XNIException { 669 fInDTD = false; 670 } 672 public void setDTDSource(XMLDTDSource source) { 674 fDTDSource = source; 675 } 676 677 public XMLDTDSource getDTDSource() { 679 return fDTDSource; 680 } 681 682 686 697 public void startContentModel(String elementName, Augmentations augs) throws XNIException { 698 } 700 711 public void any(Augmentations augs) throws XNIException { 712 } 714 725 public void empty(Augmentations augs) throws XNIException { 726 } 728 742 public void startGroup(Augmentations augs) throws XNIException { 743 } 745 757 public void pcdata(Augmentations augs) throws XNIException { 758 } 760 769 public void element(String elementName, Augmentations augs) throws XNIException { 770 } 772 785 public void separator(short separator, Augmentations augs) throws XNIException { 786 } 788 803 public void occurrence(short occurrence, Augmentations augs) throws XNIException { 804 } 806 814 public void endGroup(Augmentations augs) throws XNIException { 815 } 817 825 public void endContentModel(Augmentations augs) throws XNIException { 826 } 828 public void setDTDContentModelSource(XMLDTDContentModelSource source) { 830 fDTDContentModelSource = source; 831 } 832 833 public XMLDTDContentModelSource getDTDContentModelSource() { 835 return fDTDContentModelSource; 836 } 837 838 842 845 protected void reset() throws XNIException { 846 super.reset(); 847 fInDTD = false; 848 } 850 } | Popular Tags |