Xerces-C++  3.1.2
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 932887 2010-04-11 13:04:59Z borisk $
20  */
21 
22 #if !defined(XERCESC_INCLUDE_GUARD_DEFAULTHANDLER_HPP)
23 #define XERCESC_INCLUDE_GUARD_DEFAULTHANDLER_HPP
24 
32 
34 
35 class Locator;
36 class Attributes;
37 
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 
632  virtual ~DefaultHandler() {};
633 
634 private:
635  // -----------------------------------------------------------------------
636  // Unimplemented constructors and operators
637  // -----------------------------------------------------------------------
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 
652 {
653 }
654 
655 inline void DefaultHandler::endElement(const XMLCh* const
656  , const XMLCh* const
657  , const XMLCh* const)
658 {
659 }
660 
662 {
663 }
664 
666 {
667  throw exc;
668 }
669 
670 inline void
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
684  , const XMLCh* const)
685 {
686 }
687 
689 {
690 }
691 
693 {
694 }
695 
697 {
698 }
699 
700 inline InputSource*
702  , const XMLCh* const)
703 {
704  return 0;
705 }
706 
707 inline void
709  , const XMLCh* const
710  , const XMLCh* const
711  , const XMLCh* const)
712 {
713 }
714 
716 {
717 }
718 
720 {
721 }
722 
723 inline void
725  , const XMLCh* const
726  , const XMLCh* const
727  , const Attributes&
728 )
729 {
730 }
731 
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 
755 {
756 }
757 
759 {
760 }
761 
762 inline void DefaultHandler::endEntity (const XMLCh* const)
763 {
764 }
765 
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 
805 
806 #endif // ! DEFAULTHANDLER_HPP
virtual void resetErrors()
Reset the Error handler object on its reuse.
Definition: DefaultHandler.hpp:688
virtual void startEntity(const XMLCh *const name)=0
Receive notification of the start of an entity.
virtual void startPrefixMapping(const XMLCh *const prefix, const XMLCh *const uri)=0
Receive notification of the start of an namespace prefix mapping.
virtual void internalEntityDecl(const XMLCh *const name, const XMLCh *const value)
Report an internal entity declaration.
Definition: DefaultHandler.hpp:799
virtual void fatalError(const SAXParseException &exc)=0
Receive notification of a non-recoverable error.
virtual void error(const SAXParseException &exc)=0
Receive notification of a recoverable error.
virtual void endEntity(const XMLCh *const name)
Receive notification of the end of an entity.
Definition: DefaultHandler.hpp:762
virtual void setDocumentLocator(const Locator *const locator)=0
Receive an object for locating the origin of SAX document events.
virtual void skippedEntity(const XMLCh *const name)=0
Receive notification of a skipped entity.
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
Receive notification of basic DTD-related events.
Definition: DTDHandler.hpp:59
virtual void startDocument()
Receive notification of the beginning of the document.
Definition: DefaultHandler.hpp:719
virtual void fatalError(const SAXParseException &exc)
Report a fatal XML parsing error.
Definition: DefaultHandler.hpp:665
virtual void resetErrors()=0
Reset the Error handler object on its reuse.
virtual void endCDATA()=0
Receive notification of the end of a CDATA section.
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.
virtual void characters(const XMLCh *const chars, const XMLSize_t length)
Receive notification of character data inside an element.
Definition: DefaultHandler.hpp:646
virtual void comment(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of comments.
virtual void externalEntityDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
Report a parsed external entity declaration.
virtual void startCDATA()
Receive notification of the start of a CDATA section.
Definition: DefaultHandler.hpp:766
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.
Basic interface for resolving entities.
Definition: EntityResolver.hpp:86
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of ignorable whitespace in element content.
virtual void resetDocType()=0
Reset the DocType object on its reuse.
Default base class for SAX2 handlers.
Definition: DefaultHandler.hpp:60
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)
Resolve an external entity.
Definition: DefaultHandler.hpp:701
Basic interface for SAX error handlers.
Definition: ErrorHandler.hpp:60
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
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
Receive notification of a processing instruction.
virtual void endPrefixMapping(const XMLCh *const prefix)
Receive notification of the end of an namespace prefix mapping.
Definition: DefaultHandler.hpp:741
virtual void elementDecl(const XMLCh *const name, const XMLCh *const model)=0
Report an element type declaration.
#define SAX2_EXPORT
Definition: XercesDefs.hpp:165
virtual void endDTD()=0
Receive notification of the end of the DTD declarations.
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
Interface for associating a SAX event with a document location.
Definition: Locator.hpp:54
Interface for an element's attribute specifications.
Definition: Attributes.hpp:82
virtual void comment(const XMLCh *const chars, const XMLSize_t length)
Receive notification of comments.
Definition: DefaultHandler.hpp:749
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)
Receive notification of a processing instruction.
Definition: DefaultHandler.hpp:683
virtual void endDocument()
Receive notification of the end of the document.
Definition: DefaultHandler.hpp:651
virtual void notationDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
Receive notification of a notation declaration event.
virtual void endCDATA()
Receive notification of the end of a CDATA section.
Definition: DefaultHandler.hpp:754
virtual void warning(const SAXParseException &exc)
Receive notification of a parser warning.
Definition: DefaultHandler.hpp:732
virtual void endDTD()
Receive notification of the end of the DTD declarations.
Definition: DefaultHandler.hpp:758
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
virtual void resetDocType()
Reset the DTD object on its reuse.
Definition: DefaultHandler.hpp:696
virtual void error(const SAXParseException &exc)
Receive notification of a recoverable parser error.
Definition: DefaultHandler.hpp:661
virtual void internalEntityDecl(const XMLCh *const name, const XMLCh *const value)=0
Report an internal entity declaration.
SIZE_T XMLSize_t
Definition: Xerces_autoconf_config.borland.hpp:86
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)
Receive notification of ignorable whitespace in element content.
Definition: DefaultHandler.hpp:671
virtual void warning(const SAXParseException &exc)=0
Receive notification of a warning.
Receive notification of general document events.
Definition: ContentHandler.hpp:60
Receive notification of DTD declaration events.
Definition: DeclHandler.hpp:48
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
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.
wchar_t XMLCh
Definition: Xerces_autoconf_config.borland.hpp:92
DefaultHandler()
Definition: DefaultHandler.hpp:631
virtual void startCDATA()=0
Receive notification of the start of a CDATA section.
virtual void startEntity(const XMLCh *const name)
Receive notification of the start of an entity.
Definition: DefaultHandler.hpp:776
virtual void skippedEntity(const XMLCh *const name)
Receive notification of a skipped entity.
Definition: DefaultHandler.hpp:745
virtual void characters(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of character data.
virtual ~DefaultHandler()
Definition: DefaultHandler.hpp:632
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.
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
virtual void endEntity(const XMLCh *const name)=0
Receive notification of the end of an entity.
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)=0
Allow the application to resolve external entities.
virtual void endPrefixMapping(const XMLCh *const prefix)=0
Receive notification of the end of an namespace prefix mapping.
virtual void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)=0
Receive notification of the end of an element.
virtual void resetDocument()
Reset the Document object on its reuse.
Definition: DefaultHandler.hpp:692
virtual void startDocument()=0
Receive notification of the beginning of a document.
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
virtual void elementDecl(const XMLCh *const name, const XMLCh *const model)
Report an element type declaration.
Definition: DefaultHandler.hpp:788
virtual void endDocument()=0
Receive notification of the end of a document.
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
Encapsulate an XML parse error or warning.
Definition: SAXParseException.hpp:48
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
virtual void setDocumentLocator(const Locator *const locator)
Receive a Locator object for document events.
Definition: DefaultHandler.hpp:715
Receive notification of lexical events.
Definition: LexicalHandler.hpp:46
A single input source for an XML entity.
Definition: InputSource.hpp:62
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