DefaultHandler.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    DefaultHandler.h
00006  *
00007  *  $Id: DefaultHandler.h 78907 2007-07-16 10:22:58Z sowayaa $
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                            size_t start,
00069                            size_t length
00070                            ACEXML_ENV_ARG_DECL);
00071 
00072   /*
00073    * Receive notification of the end of a document.
00074    */
00075   virtual void endDocument (ACEXML_ENV_SINGLE_ARG_DECL);
00076 
00077   /*
00078    * Receive notification of the end of an element.
00079    */
00080   virtual void endElement (const ACEXML_Char *namespaceURI,
00081                            const ACEXML_Char *localName,
00082                            const ACEXML_Char *qName ACEXML_ENV_ARG_DECL);
00083 
00084   /*
00085    * End the scope of a prefix-URI mapping.
00086    */
00087   virtual void endPrefixMapping (const ACEXML_Char *prefix ACEXML_ENV_ARG_DECL);
00088 
00089   /*
00090    * Receive notification of ignorable whitespace in element content.
00091    */
00092   virtual void ignorableWhitespace (const ACEXML_Char *ch,
00093                                     int start,
00094                                     int length ACEXML_ENV_ARG_DECL);
00095 
00096   /*
00097    * Receive notification of a processing instruction.
00098    */
00099   virtual void processingInstruction (const ACEXML_Char *target,
00100                                       const ACEXML_Char *data ACEXML_ENV_ARG_DECL);
00101 
00102   /*
00103    * Receive an object for locating the origin of SAX document events.
00104    */
00105   virtual void setDocumentLocator (ACEXML_Locator *locator) ;
00106 
00107   /*
00108    * Receive notification of a skipped entity.
00109    */
00110   virtual void skippedEntity (const ACEXML_Char *name ACEXML_ENV_ARG_DECL);
00111 
00112   /*
00113    * Receive notification of the beginning of a document.
00114    */
00115   virtual void startDocument (ACEXML_ENV_SINGLE_ARG_DECL);
00116 
00117   /*
00118    * Receive notification of the beginning of an element.
00119    */
00120   virtual void startElement (const ACEXML_Char *namespaceURI,
00121                              const ACEXML_Char *localName,
00122                              const ACEXML_Char *qName,
00123                              ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL);
00124 
00125   /*
00126    * Begin the scope of a prefix-URI Namespace mapping.
00127    */
00128   virtual void startPrefixMapping (const ACEXML_Char *prefix,
00129                                    const ACEXML_Char *uri ACEXML_ENV_ARG_DECL);
00130 
00131   // *** Methods inherit from ACEXML_DTDHandler.
00132 
00133   /*
00134    * Receive notification of a notation declaration event.
00135    */
00136   virtual void notationDecl (const ACEXML_Char *name,
00137                              const ACEXML_Char *publicId,
00138                              const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL);
00139 
00140   /*
00141    * Receive notification of an unparsed entity declaration event.
00142    */
00143   virtual void unparsedEntityDecl (const ACEXML_Char *name,
00144                                    const ACEXML_Char *publicId,
00145                                    const ACEXML_Char *systemId,
00146                                    const ACEXML_Char *notationName ACEXML_ENV_ARG_DECL);
00147 
00148   // Methods inherit from ACEXML_EnitityResolver.
00149 
00150   /*
00151    * Allow the application to resolve external entities.
00152    */
00153   virtual ACEXML_InputSource *resolveEntity (const ACEXML_Char *publicId,
00154                                              const ACEXML_Char *systemId ACEXML_ENV_ARG_DECL);
00155 
00156   // Methods inherit from ACEXML_ErrorHandler.
00157 
00158   /*
00159    * Receive notification of a recoverable error.
00160    */
00161   virtual void error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL);
00162 
00163   /*
00164    * Receive notification of a non-recoverable error.
00165    */
00166   virtual void fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL);
00167 
00168   /*
00169    * Receive notification of a warning.
00170    */
00171   virtual void warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL);
00172 };
00173 
00174 #include /**/ "ace/post.h"
00175 
00176 #endif /* ACEXML_DEFAULTHANDLER_H */

Generated on Sun Jan 27 13:04:15 2008 for ACEXML by doxygen 1.3.6