http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Download
Installation
Build

API Docs
Samples
Schema

FAQs
Programming
Migration

Releases
Bug-Reporting
Feedback

Y2K Compliance
PDF Document

CVS Repository
Mail Archive

API Docs for SAX and DOM
 

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

DefaultHandler.hpp

Go to the documentation of this file.
00001 /*
00002  * The Apache Software License, Version 1.1
00003  *
00004  * Copyright (c) 1999-2000 The Apache Software Foundation.  All rights
00005  * reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  *
00014  * 2. Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in
00016  *    the documentation and/or other materials provided with the
00017  *    distribution.
00018  *
00019  * 3. The end-user documentation included with the redistribution,
00020  *    if any, must include the following acknowledgment:
00021  *       "This product includes software developed by the
00022  *        Apache Software Foundation (http://www.apache.org/)."
00023  *    Alternately, this acknowledgment may appear in the software itself,
00024  *    if and wherever such third-party acknowledgments normally appear.
00025  *
00026  * 4. The names "Xerces" and "Apache Software Foundation" must
00027  *    not be used to endorse or promote products derived from this
00028  *    software without prior written permission. For written
00029  *    permission, please contact apache\@apache.org.
00030  *
00031  * 5. Products derived from this software may not be called "Apache",
00032  *    nor may "Apache" appear in their name, without prior written
00033  *    permission of the Apache Software Foundation.
00034  *
00035  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00036  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00037  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00038  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00039  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00040  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00041  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00042  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00043  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00044  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00045  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00046  * SUCH DAMAGE.
00047  * ====================================================================
00048  *
00049  * This software consists of voluntary contributions made by many
00050  * individuals on behalf of the Apache Software Foundation, and was
00051  * originally based on software copyright (c) 1999, International
00052  * Business Machines, Inc., http://www.ibm.com .  For more information
00053  * on the Apache Software Foundation, please see
00054  * <http://www.apache.org/>.
00055  */
00056 
00057 /*
00058  * $Log: DefaultHandler.hpp,v $
00059  * Revision 1.5  2001/11/13 13:24:05  tng
00060  * Fix documentation for DefaultHandler.
00061  *
00062  * Revision 1.4  2000/12/22 15:17:01  tng
00063  * SAX2-ext's LexicalHandler support added by David Bertoni.
00064  *
00065  * Revision 1.3  2000/08/14 18:56:14  aruna1
00066  * Virtual parameter inconsistency fixed
00067  *
00068  * Revision 1.2  2000/08/07 18:21:27  jpolast
00069  * change  module to 
00070  *
00071  * Revision 1.1  2000/08/02 18:02:34  jpolast
00072  * initial checkin of sax2 implementation
00073  * submitted by Simon Fell (simon@fell.com)
00074  * and Joe Polastre (jpolast@apache.org)
00075  *
00076  *
00077  */
00078 
00079 
00080 #ifndef DEFAULTHANDLER_HPP
00081 #define DEFAULTHANDLER_HPP
00082 
00083 #include <sax2/ContentHandler.hpp>
00084 #include <sax2/LexicalHandler.hpp>
00085 #include <sax/DTDHandler.hpp>
00086 #include <sax/EntityResolver.hpp>
00087 #include <sax/ErrorHandler.hpp>
00088 #include <sax/SAXParseException.hpp>
00089 
00090 class Locator;
00091 class Attributes;
00092 
00113 
00114 class  DefaultHandler :
00115 
00116     public EntityResolver,
00117     public DTDHandler,
00118     public ContentHandler,
00119    public ErrorHandler,
00120    public LexicalHandler
00121 {
00122 public:
00125 
00140     virtual void characters
00141     (
00142         const   XMLCh* const    chars
00143         , const unsigned int    length
00144     );
00145 
00158     virtual void endDocument();
00159 
00175     virtual void endElement
00176     (
00177         const XMLCh* const uri,
00178         const XMLCh* const localname,
00179         const XMLCh* const qname
00180     );
00181 
00197     virtual void ignorableWhitespace
00198     (
00199         const   XMLCh* const    chars
00200         , const unsigned int    length
00201     );
00202 
00218     virtual void processingInstruction
00219     (
00220         const   XMLCh* const    target
00221         , const XMLCh* const    data
00222     );
00223 
00229     virtual void resetDocument();
00231 
00233 
00235 
00246     virtual void setDocumentLocator(const Locator* const locator);
00247 
00260     virtual void startDocument();
00261 
00278     virtual void startElement
00279     (
00280         const   XMLCh* const    uri,
00281         const   XMLCh* const    localname,
00282         const   XMLCh* const    qname
00283         , const Attributes& attrs
00284     );
00285 
00301     virtual void startPrefixMapping
00302     (
00303         const   XMLCh* const    prefix,
00304         const   XMLCh* const    uri
00305     ) ;
00306 
00321     virtual void endPrefixMapping
00322     (
00323         const   XMLCh* const    prefix
00324     ) ;
00325 
00343     virtual void skippedEntity
00344     (
00345         const   XMLCh* const    name
00346     ) ;
00347 
00349 
00351 
00353 
00372     virtual InputSource* resolveEntity
00373     (
00374         const   XMLCh* const    publicId
00375         , const XMLCh* const    systemId
00376     );
00377 
00379 
00382 
00396     virtual void error(const SAXParseException& exception);
00397 
00415     virtual void fatalError(const SAXParseException& exception);
00416 
00431     virtual void warning(const SAXParseException& exception);
00432 
00438     virtual void resetErrors();
00439 
00441 
00442 
00445 
00459     virtual void notationDecl
00460     (
00461         const   XMLCh* const    name
00462         , const XMLCh* const    publicId
00463         , const XMLCh* const    systemId
00464     );
00465 
00471     virtual void resetDocType();
00472 
00487     virtual void unparsedEntityDecl
00488     (
00489         const   XMLCh* const    name
00490         , const XMLCh* const    publicId
00491         , const XMLCh* const    systemId
00492         , const XMLCh* const    notationName
00493     );
00495 
00496 
00498 
00500 
00514     virtual void comment
00515     (
00516         const   XMLCh* const    chars
00517         , const unsigned int    length
00518     );
00519 
00529     virtual void endCDATA ();
00530 
00540     virtual void endDTD ();
00541 
00552     virtual void endEntity (const XMLCh* const name);
00553 
00563     virtual void startCDATA ();
00564 
00577     virtual void startDTD
00578     (
00579         const   XMLCh* const    name
00580         , const   XMLCh* const    publicId
00581         , const   XMLCh* const    systemId
00582     );
00583 
00594     virtual void startEntity (const XMLCh* const name);
00595 
00597 };
00598 
00599 
00600 // ---------------------------------------------------------------------------
00601 //  HandlerBase: Inline default implementations
00602 // ---------------------------------------------------------------------------
00603 inline void DefaultHandler::characters(const   XMLCh* const    chars
00604                                        ,const   unsigned int    length)
00605 {
00606 }
00607 
00608 inline void DefaultHandler::endDocument()
00609 {
00610 }
00611 
00612 inline void DefaultHandler::endElement(const    XMLCh* const uri
00613                                         , const XMLCh* const localname
00614                                         , const XMLCh* const qname)
00615 {
00616 }
00617 
00618 inline void DefaultHandler::error(const SAXParseException& exception)
00619 {
00620 }
00621 
00622 inline void DefaultHandler::fatalError(const SAXParseException& exception)
00623 {
00624     throw exception;
00625 }
00626 
00627 inline void
00628 DefaultHandler::ignorableWhitespace( const   XMLCh* const   chars
00629                                     , const unsigned int    length)
00630 {
00631 }
00632 
00633 inline void DefaultHandler::notationDecl(  const   XMLCh* const name
00634                                             , const XMLCh* const publicId
00635                                             , const XMLCh* const systemId)
00636 {
00637 }
00638 
00639 inline void
00640 DefaultHandler::processingInstruction( const   XMLCh* const target
00641                                         , const XMLCh* const data)
00642 {
00643 }
00644 
00645 inline void DefaultHandler::resetErrors()
00646 {
00647 }
00648 
00649 inline void DefaultHandler::resetDocument()
00650 {
00651 }
00652 
00653 inline void DefaultHandler::resetDocType()
00654 {
00655 }
00656 
00657 inline InputSource*
00658 DefaultHandler::resolveEntity( const   XMLCh* const publicId
00659                                 , const XMLCh* const systemId)
00660 {
00661     return 0;
00662 }
00663 
00664 inline void
00665 DefaultHandler::unparsedEntityDecl(const   XMLCh* const name
00666                                     , const XMLCh* const publicId
00667                                     , const XMLCh* const systemId
00668                                     , const XMLCh* const notationName)
00669 {
00670 }
00671 
00672 inline void DefaultHandler::setDocumentLocator(const Locator* const locator)
00673 {
00674 }
00675 
00676 inline void DefaultHandler::startDocument()
00677 {
00678 }
00679 
00680 inline void
00681 DefaultHandler::startElement(  const     XMLCh* const  uri
00682                                 , const   XMLCh* const  localname
00683                                 , const   XMLCh* const  qname
00684                                 , const   Attributes&       attrs
00685 )
00686 {
00687 }
00688 
00689 inline void DefaultHandler::warning(const SAXParseException& exception)
00690 {
00691 }
00692 
00693 inline void DefaultHandler::startPrefixMapping ( const  XMLCh* const    prefix
00694                                                 ,const  XMLCh* const    uri)
00695 {
00696 }
00697 
00698 inline void DefaultHandler::endPrefixMapping ( const    XMLCh* const    prefix )
00699 {
00700 }
00701 
00702 inline void DefaultHandler::skippedEntity ( const   XMLCh* const    name )
00703 {
00704 }
00705 
00706 inline void DefaultHandler::comment(  const   XMLCh* const    chars
00707                                        , const unsigned int    length)
00708 {
00709 }
00710 
00711 inline void DefaultHandler::endCDATA ()
00712 {
00713 }
00714 
00715 inline void DefaultHandler::endDTD ()
00716 {
00717 }
00718 
00719 inline void DefaultHandler::endEntity (const XMLCh* const name)
00720 {
00721 }
00722 
00723 inline void DefaultHandler::startCDATA ()
00724 {
00725 }
00726 
00727 inline void DefaultHandler::startDTD(  const   XMLCh* const    name
00728                                         , const   XMLCh* const publicId
00729                                         , const   XMLCh* const systemId)
00730 {
00731 }
00732 
00733 inline void DefaultHandler::startEntity (const XMLCh* const name)
00734 {
00735 }
00736 
00737 #endif // ! DEFAULTHANDLER_HPP


Copyright © 2000 The Apache Software Foundation. All Rights Reserved.