Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

DefaultHandler.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    DefaultHandler.h
00006  *
00007  *  $Id: DefaultHandler.h,v 1.1.1.1 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Nanbor Wang <nanbor@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 #ifndef ACEXML_DEFAULTHANDLER_H
00013 #define ACEXML_DEFAULTHANDLER_H
00014 
00015 #include "ace/pre.h"
00016 #include "ACEXML/common/ACEXML_Export.h"
00017 
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 #pragma once
00020 #endif /* ACE_LACKS_PRAGMA_ONCE */
00021 
00022 #include "ACEXML/common/ContentHandler.h"
00023 #include "ACEXML/common/DTDHandler.h"
00024 #include "ACEXML/common/EntityResolver.h"
00025 #include "ACEXML/common/ErrorHandler.h"
00026 
00027 /**
00028  * @class ACEXML_DefaultHandler DefaultHandler.h "ACEXML/common/DefaultHandler.h"
00029  *
00030  * @brief ACEXML_DefaultHandler
00031  *
00032  * This class is available as a convenience base class for SAX2
00033  * applications: it provides default implementations for all of the
00034  * callbacks in the four core SAX2 handler classes:
00035  *
00036  * - EntityResolver
00037  * - DTDHandler
00038  * - ContentHandler
00039  * - ErrorHandler
00040  *
00041  * Application writers can extend this class when they need to implement
00042  * only part of an interface; parser writers can instantiate this class to
00043  * provide default handlers when the application has not supplied its own.
00044  */
00045 class ACEXML_Export ACEXML_DefaultHandler
00046   : public ACEXML_ContentHandler,
00047     public ACEXML_DTDHandler,
00048     public ACEXML_EntityResolver,
00049     public ACEXML_ErrorHandler
00050 {
00051 public:
00052   /**
00053    * Default constructor.
00054    */
00055   ACEXML_DefaultHandler (void);
00056 
00057   /**
00058    * destructor.
00059    */
00060   virtual ~ACEXML_DefaultHandler (void);
00061 
00062   // Methods inherit from ACEXML_ContentHandler.
00063 
00064   /*
00065    * Receive notification of character data.
00066    */
00067   virtual void characters (const ACEXML_Char *ch,
00068                            int start,
00069                            int length ACEXML_ENV_ARG_DECL)
00070         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00071 
00072   /*
00073    * Receive notification of the end of a document.
00074    */
00075   virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL)
00076         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00077 
00078   /*
00079    * Receive notification of the end of an element.
00080    */
00081   virtual void endElement (const ACEXML_Char *namespaceURI,
00082                            const ACEXML_Char *localName,
00083                            const ACEXML_Char *qName ACEXML_ENV_ARG_DECL)
00084         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00085 
00086   /*
00087    * End the scope of a prefix-URI mapping.
00088    */
00089   virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL)
00090         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00091 
00092   /*
00093    * Receive notification of ignorable whitespace in element content.
00094    */
00095   virtual void ignorableWhitespace (const ACEXML_Char *ch,
00096                                     int start,
00097                                     int length ACEXML_ENV_ARG_DECL)
00098         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00099 
00100   /*
00101    * Receive notification of a processing instruction.
00102    */
00103   virtual void processingInstruction (const ACEXML_Char *target,
00104                                       const ACEXML_Char *data ACEXML_ENV_ARG_DECL)
00105         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00106 
00107   /*
00108    * Receive an object for locating the origin of SAX document events.
00109    */
00110   virtual void setDocumentLocator (ACEXML_Locator *locator) ;
00111 
00112   /*
00113    * Receive notification of a skipped entity.
00114    */
00115   virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL)
00116         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00117 
00118   /*
00119    * Receive notification of the beginning of a document.
00120    */
00121   virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL)
00122         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00123 
00124   /*
00125    * Receive notification of the beginning of an element.
00126    */
00127   virtual void startElement (const ACEXML_Char *namespaceURI,
00128                              const ACEXML_Char *localName,
00129                              const ACEXML_Char *qName,
00130                              ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL)
00131         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00132 
00133   /*
00134    * Begin the scope of a prefix-URI Namespace mapping.
00135    */
00136   virtual void startPrefixMapping (const ACEXML_Char *prefix,
00137                                    const ACEXML_Char *uri ACEXML_ENV_ARG_DECL)
00138         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00139 
00140   // *** Methods inherit from ACEXML_DTDHandler.
00141 
00142   /*
00143    * Receive notification of a notation declaration event.
00144    */
00145   virtual void notationDecl (const ACEXML_Char *name,
00146                              const ACEXML_Char *publicId,
00147                              const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL)
00148         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00149 
00150   /*
00151    * Receive notification of an unparsed entity declaration event.
00152    */
00153   virtual void unparsedEntityDecl (const ACEXML_Char *name,
00154                                    const ACEXML_Char *publicId,
00155                                    const ACEXML_Char *systemId,
00156                                    const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL)
00157         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00158 
00159   // Methods inherit from ACEXML_EnitityResolver.
00160 
00161   /*
00162    * Allow the application to resolve external entities.
00163    */
00164   virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId,
00165                                              const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL)
00166         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00167 
00168   // Methods inherit from ACEXML_ErrorHandler.
00169 
00170   /*
00171    * Receive notification of a recoverable error.
00172    */
00173   virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL)
00174         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00175 
00176   /*
00177    * Receive notification of a non-recoverable error.
00178    */
00179   virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL)
00180         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00181 
00182   /*
00183    * Receive notification of a warning.
00184    */
00185   virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL)
00186         ACE_THROW_SPEC ((ACEXML_SAXException)) ;
00187 };
00188 
00189 #if defined (__ACEXML_INLINE__)
00190 # include "ACEXML/common/DefaultHandler.i"
00191 #endif /* __ACEXML_INLINE__ */
00192 
00193 #include "ace/post.h"
00194 
00195 #endif /* ACEXML_DEFAULTHANDLER_H */

Generated on Mon Jun 16 13:23:20 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002