Xerces-C++ 3.2.0

DefaultHandler.hpp
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 /*
19 * $Id: DefaultHandler.hpp 932889 2010-04-11 13:10:10Z borisk $
20 */
21
22 #if !defined(XERCESC_INCLUDE_GUARD_DEFAULTHANDLER_HPP)
23 #define XERCESC_INCLUDE_GUARD_DEFAULTHANDLER_HPP
24
25 #include <xercesc/sax2/ContentHandler.hpp>
26 #include <xercesc/sax2/LexicalHandler.hpp>
27 #include <xercesc/sax2/DeclHandler.hpp>
28 #include <xercesc/sax/DTDHandler.hpp>
29 #include <xercesc/sax/EntityResolver.hpp>
30 #include <xercesc/sax/ErrorHandler.hpp>
31 #include <xercesc/sax/SAXParseException.hpp>
32
33 XERCES_CPP_NAMESPACE_BEGIN
34
35 class Locator;
36 class Attributes;
37
60 class SAX2_EXPORT DefaultHandler :
61
62 public EntityResolver,
63 public DTDHandler,
64 public ContentHandler,
65 public ErrorHandler,
66 public LexicalHandler,
67 public DeclHandler
68 {
69 public:
87 virtual void characters
88 (
89 const XMLCh* const chars
90 , const XMLSize_t length
91 );
92
105 virtual void endDocument();
106
122 virtual void endElement
123 (
124 const XMLCh* const uri,
125 const XMLCh* const localname,
126 const XMLCh* const qname
127 );
128
144 virtual void ignorableWhitespace
145 (
146 const XMLCh* const chars
147 , const XMLSize_t length
148 );
149
165 virtual void processingInstruction
166 (
167 const XMLCh* const target
168 , const XMLCh* const data
169 );
170
176 virtual void resetDocument();
178
193 virtual void setDocumentLocator(const Locator* const locator);
194
207 virtual void startDocument();
208
225 virtual void startElement
226 (
227 const XMLCh* const uri,
228 const XMLCh* const localname,
229 const XMLCh* const qname
230 , const Attributes& attrs
231 );
232
246 virtual void startPrefixMapping
247 (
248 const XMLCh* const prefix,
249 const XMLCh* const uri
250 ) ;
251
264 virtual void endPrefixMapping
265 (
266 const XMLCh* const prefix
267 ) ;
268
286 virtual void skippedEntity
287 (
288 const XMLCh* const name
289 ) ;
290
292
317 virtual InputSource* resolveEntity
318 (
319 const XMLCh* const publicId
320 , const XMLCh* const systemId
321 );
322
324
341 virtual void error(const SAXParseException& exc);
342
360 virtual void fatalError(const SAXParseException& exc);
361
376 virtual void warning(const SAXParseException& exc);
377
383 virtual void resetErrors();
384
386
387
390
404 virtual void notationDecl
405 (
406 const XMLCh* const name
407 , const XMLCh* const publicId
408 , const XMLCh* const systemId
409 );
410
416 virtual void resetDocType();
417
432 virtual void unparsedEntityDecl
433 (
434 const XMLCh* const name
435 , const XMLCh* const publicId
436 , const XMLCh* const systemId
437 , const XMLCh* const notationName
438 );
440
441
459 virtual void comment
460 (
461 const XMLCh* const chars
462 , const XMLSize_t length
463 );
464
474 virtual void endCDATA ();
475
485 virtual void endDTD ();
486
497 virtual void endEntity (const XMLCh* const name);
498
508 virtual void startCDATA ();
509
522 virtual void startDTD
523 (
524 const XMLCh* const name
525 , const XMLCh* const publicId
526 , const XMLCh* const systemId
527 );
528
539 virtual void startEntity (const XMLCh* const name);
540
542
546
563 virtual void elementDecl
564 (
565 const XMLCh* const name
566 , const XMLCh* const model
567 );
568
583 virtual void attributeDecl
584 (
585 const XMLCh* const eName
586 , const XMLCh* const aName
587 , const XMLCh* const type
588 , const XMLCh* const mode
589 , const XMLCh* const value
590 );
591
604 virtual void internalEntityDecl
605 (
606 const XMLCh* const name
607 , const XMLCh* const value
608 );
609
622 virtual void externalEntityDecl
623 (
624 const XMLCh* const name
625 , const XMLCh* const publicId
626 , const XMLCh* const systemId
627 );
628
630
631 DefaultHandler() {};
632 virtual ~DefaultHandler() {};
633
634 private:
635 // -----------------------------------------------------------------------
636 // Unimplemented constructors and operators
637 // -----------------------------------------------------------------------
638 DefaultHandler(const DefaultHandler&);
639 DefaultHandler& operator=(const DefaultHandler&);
640 };
641
642
643 // ---------------------------------------------------------------------------
644 // HandlerBase: Inline default implementations
645 // ---------------------------------------------------------------------------
646 inline void DefaultHandler::characters(const XMLCh* const
647 ,const XMLSize_t)
648 {
649 }
650
651 inline void DefaultHandler::endDocument()
652 {
653 }
654
655 inline void DefaultHandler::endElement(const XMLCh* const
656 , const XMLCh* const
657 , const XMLCh* const)
658 {
659 }
660
661 inline void DefaultHandler::error(const SAXParseException&)
662 {
663 }
664
665 inline void DefaultHandler::fatalError(const SAXParseException& exc)
666 {
667 throw exc;
668 }
669
670 inline void
671 DefaultHandler::ignorableWhitespace( const XMLCh* const
672 , const XMLSize_t)
673 {
674 }
675
676 inline void DefaultHandler::notationDecl( const XMLCh* const
677 , const XMLCh* const
678 , const XMLCh* const)
679 {
680 }
681
682 inline void
683 DefaultHandler::processingInstruction( const XMLCh* const
684 , const XMLCh* const)
685 {
686 }
687
688 inline void DefaultHandler::resetErrors()
689 {
690 }
691
692 inline void DefaultHandler::resetDocument()
693 {
694 }
695
696 inline void DefaultHandler::resetDocType()
697 {
698 }
699
700 inline InputSource*
701 DefaultHandler::resolveEntity( const XMLCh* const
702 , const XMLCh* const)
703 {
704 return 0;
705 }
706
707 inline void
708 DefaultHandler::unparsedEntityDecl(const XMLCh* const
709 , const XMLCh* const
710 , const XMLCh* const
711 , const XMLCh* const)
712 {
713 }
714
715 inline void DefaultHandler::setDocumentLocator(const Locator* const)
716 {
717 }
718
719 inline void DefaultHandler::startDocument()
720 {
721 }
722
723 inline void
724 DefaultHandler::startElement( const XMLCh* const
725 , const XMLCh* const
726 , const XMLCh* const
727 , const Attributes&
728 )
729 {
730 }
731
732 inline void DefaultHandler::warning(const SAXParseException&)
733 {
734 }
735
736 inline void DefaultHandler::startPrefixMapping ( const XMLCh* const
737 ,const XMLCh* const)
738 {
739 }
740
741 inline void DefaultHandler::endPrefixMapping ( const XMLCh* const)
742 {
743 }
744
745 inline void DefaultHandler::skippedEntity ( const XMLCh* const)
746 {
747 }
748
749 inline void DefaultHandler::comment( const XMLCh* const
750 , const XMLSize_t)
751 {
752 }
753
754 inline void DefaultHandler::endCDATA ()
755 {
756 }
757
758 inline void DefaultHandler::endDTD ()
759 {
760 }
761
762 inline void DefaultHandler::endEntity (const XMLCh* const)
763 {
764 }
765
766 inline void DefaultHandler::startCDATA ()
767 {
768 }
769
770 inline void DefaultHandler::startDTD( const XMLCh* const
771 , const XMLCh* const
772 , const XMLCh* const)
773 {
774 }
775
776 inline void DefaultHandler::startEntity (const XMLCh* const)
777 {
778 }
779
780 inline void DefaultHandler::attributeDecl(const XMLCh* const,
781 const XMLCh* const,
782 const XMLCh* const,
783 const XMLCh* const,
784 const XMLCh* const)
785 {
786 }
787
788 inline void DefaultHandler::elementDecl(const XMLCh* const,
789 const XMLCh* const)
790 {
791 }
792
793 inline void DefaultHandler::externalEntityDecl(const XMLCh* const,
794 const XMLCh* const,
795 const XMLCh* const)
796 {
797 }
798
799 inline void DefaultHandler::internalEntityDecl(const XMLCh* const,
800 const XMLCh* const)
801 {
802 }
803
804 XERCES_CPP_NAMESPACE_END
805
806 #endif // ! DEFAULTHANDLER_HPP
DefaultHandler::resetErrors
virtual void resetErrors()
Reset the Error handler object on its reuse.
Definition: DefaultHandler.hpp:688
LexicalHandler::startEntity
virtual void startEntity(const XMLCh *const name)=0
Receive notification of the start of an entity.
ContentHandler::startPrefixMapping
virtual void startPrefixMapping(const XMLCh *const prefix, const XMLCh *const uri)=0
Receive notification of the start of an namespace prefix mapping.
DefaultHandler::internalEntityDecl
virtual void internalEntityDecl(const XMLCh *const name, const XMLCh *const value)
Report an internal entity declaration.
Definition: DefaultHandler.hpp:799
ErrorHandler::fatalError
virtual void fatalError(const SAXParseException &exc)=0
Receive notification of a non-recoverable error.
ErrorHandler::error
virtual void error(const SAXParseException &exc)=0
Receive notification of a recoverable error.
DefaultHandler::endEntity
virtual void endEntity(const XMLCh *const name)
Receive notification of the end of an entity.
Definition: DefaultHandler.hpp:762
DTDHandler.hpp
ContentHandler::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)=0
Receive an object for locating the origin of SAX document events.
ContentHandler::skippedEntity
virtual void skippedEntity(const XMLCh *const name)=0
Receive notification of a skipped entity.
DefaultHandler::attributeDecl
virtual void attributeDecl(const XMLCh *const eName, const XMLCh *const aName, const XMLCh *const type, const XMLCh *const mode, const XMLCh *const value)
Report an attribute type declaration.
Definition: DefaultHandler.hpp:780
DTDHandler
Receive notification of basic DTD-related events.
Definition: DTDHandler.hpp:59
DefaultHandler::startDocument
virtual void startDocument()
Receive notification of the beginning of the document.
Definition: DefaultHandler.hpp:719
DefaultHandler::fatalError
virtual void fatalError(const SAXParseException &exc)
Report a fatal XML parsing error.
Definition: DefaultHandler.hpp:665
ErrorHandler::resetErrors
virtual void resetErrors()=0
Reset the Error handler object on its reuse.
LexicalHandler::endCDATA
virtual void endCDATA()=0
Receive notification of the end of a CDATA section.
DTDHandler::unparsedEntityDecl
virtual void unparsedEntityDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const notationName)=0
Receive notification of an unparsed entity declaration event.
DefaultHandler::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)
Receive notification of character data inside an element.
Definition: DefaultHandler.hpp:646
LexicalHandler::comment
virtual void comment(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of comments.
DeclHandler::externalEntityDecl
virtual void externalEntityDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
Report a parsed external entity declaration.
DefaultHandler::startCDATA
virtual void startCDATA()
Receive notification of the start of a CDATA section.
Definition: DefaultHandler.hpp:766
DeclHandler::attributeDecl
virtual void attributeDecl(const XMLCh *const eName, const XMLCh *const aName, const XMLCh *const type, const XMLCh *const mode, const XMLCh *const value)=0
Report an attribute type declaration.
EntityResolver
Basic interface for resolving entities.
Definition: EntityResolver.hpp:86
ContentHandler::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of ignorable whitespace in element content.
DTDHandler::resetDocType
virtual void resetDocType()=0
Reset the DocType object on its reuse.
DeclHandler.hpp
DefaultHandler
Default base class for SAX2 handlers.
Definition: DefaultHandler.hpp:60
DefaultHandler::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)
Resolve an external entity.
Definition: DefaultHandler.hpp:701
ErrorHandler
Basic interface for SAX error handlers.
Definition: ErrorHandler.hpp:60
DefaultHandler::externalEntityDecl
virtual void externalEntityDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)
Report a parsed external entity declaration.
Definition: DefaultHandler.hpp:793
ContentHandler::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
Receive notification of a processing instruction.
DefaultHandler::endPrefixMapping
virtual void endPrefixMapping(const XMLCh *const prefix)
Receive notification of the end of an namespace prefix mapping.
Definition: DefaultHandler.hpp:741
DeclHandler::elementDecl
virtual void elementDecl(const XMLCh *const name, const XMLCh *const model)=0
Report an element type declaration.
SAX2_EXPORT
#define SAX2_EXPORT
Definition: XercesDefs.hpp:165
LexicalHandler::endDTD
virtual void endDTD()=0
Receive notification of the end of the DTD declarations.
DefaultHandler::unparsedEntityDecl
virtual void unparsedEntityDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId, const XMLCh *const notationName)
Receive notification of an unparsed entity declaration.
Definition: DefaultHandler.hpp:708
Locator
Interface for associating a SAX event with a document location.
Definition: Locator.hpp:54
Attributes
Interface for an element&#39;s attribute specifications.
Definition: Attributes.hpp:82
DefaultHandler::comment
virtual void comment(const XMLCh *const chars, const XMLSize_t length)
Receive notification of comments.
Definition: DefaultHandler.hpp:749
DefaultHandler::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)
Receive notification of a processing instruction.
Definition: DefaultHandler.hpp:683
DefaultHandler::endDocument
virtual void endDocument()
Receive notification of the end of the document.
Definition: DefaultHandler.hpp:651
DTDHandler::notationDecl
virtual void notationDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
Receive notification of a notation declaration event.
DefaultHandler::endCDATA
virtual void endCDATA()
Receive notification of the end of a CDATA section.
Definition: DefaultHandler.hpp:754
DefaultHandler::warning
virtual void warning(const SAXParseException &exc)
Receive notification of a parser warning.
Definition: DefaultHandler.hpp:732
DefaultHandler::endDTD
virtual void endDTD()
Receive notification of the end of the DTD declarations.
Definition: DefaultHandler.hpp:758
DefaultHandler::startPrefixMapping
virtual void startPrefixMapping(const XMLCh *const prefix, const XMLCh *const uri)
Receive notification of the start of an namespace prefix mapping.
Definition: DefaultHandler.hpp:736
DefaultHandler::resetDocType
virtual void resetDocType()
Reset the DTD object on its reuse.
Definition: DefaultHandler.hpp:696
DefaultHandler::error
virtual void error(const SAXParseException &exc)
Receive notification of a recoverable parser error.
Definition: DefaultHandler.hpp:661
DeclHandler::internalEntityDecl
virtual void internalEntityDecl(const XMLCh *const name, const XMLCh *const value)=0
Report an internal entity declaration.
DefaultHandler::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)
Receive notification of ignorable whitespace in element content.
Definition: DefaultHandler.hpp:671
ErrorHandler::warning
virtual void warning(const SAXParseException &exc)=0
Receive notification of a warning.
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:118
ContentHandler
Receive notification of general document events.
Definition: ContentHandler.hpp:60
DeclHandler
Receive notification of DTD declaration events.
Definition: DeclHandler.hpp:48
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
ContentHandler.hpp
LexicalHandler::startDTD
virtual void startDTD(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
Receive notification of the start of the DTD declarations.
LexicalHandler.hpp
DefaultHandler::DefaultHandler
DefaultHandler()
Definition: DefaultHandler.hpp:631
LexicalHandler::startCDATA
virtual void startCDATA()=0
Receive notification of the start of a CDATA section.
DefaultHandler::startEntity
virtual void startEntity(const XMLCh *const name)
Receive notification of the start of an entity.
Definition: DefaultHandler.hpp:776
DefaultHandler::skippedEntity
virtual void skippedEntity(const XMLCh *const name)
Receive notification of a skipped entity.
Definition: DefaultHandler.hpp:745
ContentHandler::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of character data.
XMLSize_t
size_t XMLSize_t
Definition: Xerces_autoconf_config.hpp:110
DefaultHandler::~DefaultHandler
virtual ~DefaultHandler()
Definition: DefaultHandler.hpp:632
ContentHandler::startElement
virtual void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attrs)=0
Receive notification of the beginning of an element.
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
LexicalHandler::endEntity
virtual void endEntity(const XMLCh *const name)=0
Receive notification of the end of an entity.
EntityResolver::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)=0
Allow the application to resolve external entities.
ContentHandler::endPrefixMapping
virtual void endPrefixMapping(const XMLCh *const prefix)=0
Receive notification of the end of an namespace prefix mapping.
ContentHandler::endElement
virtual void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)=0
Receive notification of the end of an element.
DefaultHandler::resetDocument
virtual void resetDocument()
Reset the Document object on its reuse.
Definition: DefaultHandler.hpp:692
SAXParseException.hpp
ContentHandler::startDocument
virtual void startDocument()=0
Receive notification of the beginning of a document.
DefaultHandler::startElement
virtual void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attrs)
Receive notification of the start of an element.
Definition: DefaultHandler.hpp:724
DefaultHandler::elementDecl
virtual void elementDecl(const XMLCh *const name, const XMLCh *const model)
Report an element type declaration.
Definition: DefaultHandler.hpp:788
EntityResolver.hpp
ContentHandler::endDocument
virtual void endDocument()=0
Receive notification of the end of a document.
DefaultHandler::startDTD
virtual void startDTD(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)
Receive notification of the start of the DTD declarations.
Definition: DefaultHandler.hpp:770
ErrorHandler.hpp
SAXParseException
Encapsulate an XML parse error or warning.
Definition: SAXParseException.hpp:48
DefaultHandler::notationDecl
virtual void notationDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)
Receive notification of a notation declaration.
Definition: DefaultHandler.hpp:676
DefaultHandler::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)
Receive a Locator object for document events.
Definition: DefaultHandler.hpp:715
LexicalHandler
Receive notification of lexical events.
Definition: LexicalHandler.hpp:46
InputSource
A single input source for an XML entity.
Definition: InputSource.hpp:62
DefaultHandler::endElement
virtual void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
Receive notification of the end of an element.
Definition: DefaultHandler.hpp:655