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

Home

Readme
Installation
Build

API Docs
Samples
Programming
Migration
FAQs

Releases
Feedback
Bug-Todo

Download
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.4  2000/12/22 15:17:01  tng

00060  * SAX2-ext's LexicalHandler support added by David Bertoni.

00061  *
00062  * Revision 1.3  2000/08/14 18:56:14  aruna1

00063  * Virtual parameter inconsistency fixed

00064  *
00065  * Revision 1.2  2000/08/07 18:21:27  jpolast

00066  * change  module to 

00067  *
00068  * Revision 1.1  2000/08/02 18:02:34  jpolast

00069  * initial checkin of sax2 implementation

00070  * submitted by Simon Fell (simon@fell.com)

00071  * and Joe Polastre (jpolast@apache.org)

00072  *
00073  *
00074  */
00075 
00076 
00077 #ifndef DEFAULTHANDLER_HPP
00078 #define DEFAULTHANDLER_HPP
00079 
00080 #include <sax2/ContentHandler.hpp>
00081 #include <sax2/LexicalHandler.hpp>
00082 #include <sax/DTDHandler.hpp>
00083 #include <sax/EntityResolver.hpp>
00084 #include <sax/ErrorHandler.hpp>
00085 #include <sax/SAXParseException.hpp>
00086 
00087 class Locator;
00088 class Attributes;
00089 
00109 
00110 class  DefaultHandler :
00111 
00112     public EntityResolver, 
00113     public DTDHandler, 
00114     public ContentHandler, 
00115    public ErrorHandler,
00116    public LexicalHandler
00117 {
00118 public:
00121 
00136     virtual void characters
00137     (
00138         const   XMLCh* const    chars
00139         , const unsigned int    length
00140     );
00141 
00154     virtual void endDocument();
00155 
00171     virtual void endElement
00172     (
00173         const XMLCh* const uri, 
00174         const XMLCh* const localname, 
00175         const XMLCh* const qname
00176     );
00177 
00193     virtual void ignorableWhitespace
00194     (
00195         const   XMLCh* const    chars
00196         , const unsigned int    length
00197     );
00198 
00214     virtual void processingInstruction
00215     (
00216         const   XMLCh* const    target
00217         , const XMLCh* const    data
00218     );
00219 
00225     virtual void resetDocument();
00227 
00229 
00231 
00242     virtual void setDocumentLocator(const Locator* const locator);
00243 
00256     virtual void startDocument();
00257 
00274     virtual void startElement
00275     (
00276         const   XMLCh* const    uri,
00277         const   XMLCh* const    localname,
00278         const   XMLCh* const    qname
00279         , const Attributes& attrs
00280     );
00281 
00297     virtual void startPrefixMapping
00298     ( 
00299         const   XMLCh* const    prefix,
00300         const   XMLCh* const    uri
00301     ) ;
00302 
00317     virtual void endPrefixMapping
00318     (
00319         const   XMLCh* const    prefix
00320     ) ;
00321 
00339     virtual void skippedEntity
00340     (
00341         const   XMLCh* const    name
00342     ) ;
00343 
00345 
00347 
00349 
00368     virtual InputSource* resolveEntity
00369     (
00370         const   XMLCh* const    publicId
00371         , const XMLCh* const    systemId
00372     );
00373 
00375 
00378 
00392     virtual void error(const SAXParseException& exception);
00393 
00411     virtual void fatalError(const SAXParseException& exception);
00412 
00427     virtual void warning(const SAXParseException& exception);
00428 
00434     virtual void resetErrors();
00435 
00437 
00438 
00441 
00455     virtual void notationDecl
00456     (
00457         const   XMLCh* const    name
00458         , const XMLCh* const    publicId
00459         , const XMLCh* const    systemId
00460     );
00461 
00467     virtual void resetDocType();
00468 
00483     virtual void unparsedEntityDecl
00484     (
00485         const   XMLCh* const    name
00486         , const XMLCh* const    publicId
00487         , const XMLCh* const    systemId
00488         , const XMLCh* const    notationName
00489     );
00491 
00492 
00494 
00496 
00510     virtual void comment
00511     (
00512         const   XMLCh* const    chars
00513         , const unsigned int    length
00514     );
00515 
00525     virtual void endCDATA ();
00526 
00536     virtual void endDTD ();
00537 
00548     virtual void endEntity (const XMLCh* const name);
00549 
00559     virtual void startCDATA ();
00560 
00573     virtual void startDTD
00574     (
00575         const   XMLCh* const    name
00576         , const   XMLCh* const    publicId
00577         , const   XMLCh* const    systemId
00578     );
00579 
00590     virtual void startEntity (const XMLCh* const name);
00591 
00593 };
00594 
00595 
00596 // ---------------------------------------------------------------------------
00597 //  HandlerBase: Inline default implementations
00598 // ---------------------------------------------------------------------------
00599 inline void DefaultHandler::characters(const   XMLCh* const    chars
00600                                        ,const   unsigned int    length)

00601 {
00602 }
00603 
00604 inline void DefaultHandler::endDocument()

00605 {
00606 }
00607 
00608 inline void DefaultHandler::endElement(const    XMLCh* const uri
00609                                         , const XMLCh* const localname
00610                                         , const XMLCh* const qname)

00611 {
00612 }
00613 
00614 inline void DefaultHandler::error(const SAXParseException& exception)

00615 {
00616 }
00617 
00618 inline void DefaultHandler::fatalError(const SAXParseException& exception)

00619 {
00620     throw exception;
00621 }
00622 
00623 inline void
00624 DefaultHandler::ignorableWhitespace( const   XMLCh* const   chars
00625                                     , const unsigned int    length)

00626 {
00627 }
00628 
00629 inline void DefaultHandler::notationDecl(  const   XMLCh* const name
00630                                             , const XMLCh* const publicId
00631                                             , const XMLCh* const systemId)

00632 {
00633 }
00634 
00635 inline void
00636 DefaultHandler::processingInstruction( const   XMLCh* const target
00637                                         , const XMLCh* const data)

00638 {
00639 }
00640 
00641 inline void DefaultHandler::resetErrors()

00642 {
00643 }
00644 
00645 inline void DefaultHandler::resetDocument()

00646 {
00647 }
00648 
00649 inline void DefaultHandler::resetDocType()

00650 {
00651 }
00652 
00653 inline InputSource*
00654 DefaultHandler::resolveEntity( const   XMLCh* const publicId
00655                                 , const XMLCh* const systemId)

00656 {
00657     return 0;
00658 }
00659 
00660 inline void
00661 DefaultHandler::unparsedEntityDecl(const   XMLCh* const name
00662                                     , const XMLCh* const publicId
00663                                     , const XMLCh* const systemId
00664                                     , const XMLCh* const notationName)

00665 {
00666 }
00667 
00668 inline void DefaultHandler::setDocumentLocator(const Locator* const locator)

00669 {
00670 }
00671 
00672 inline void DefaultHandler::startDocument()

00673 {
00674 }
00675 
00676 inline void
00677 DefaultHandler::startElement(  const     XMLCh* const  uri
00678                                 , const   XMLCh* const  localname
00679                                 , const   XMLCh* const  qname
00680                                 , const   Attributes&       attrs
00681 )

00682 {
00683 }
00684 
00685 inline void DefaultHandler::warning(const SAXParseException& exception)

00686 {
00687 }
00688 
00689 inline void DefaultHandler::startPrefixMapping ( const  XMLCh* const    prefix
00690                                                 ,const  XMLCh* const    uri)

00691 {
00692 }
00693 
00694 inline void DefaultHandler::endPrefixMapping ( const    XMLCh* const    prefix )

00695 {
00696 }
00697 
00698 inline void DefaultHandler::skippedEntity ( const   XMLCh* const    name )

00699 {
00700 }
00701 
00702 inline void DefaultHandler::comment(  const   XMLCh* const    chars
00703                                        , const unsigned int    length)

00704 {
00705 }
00706 
00707 inline void DefaultHandler::endCDATA ()

00708 {
00709 }
00710 
00711 inline void DefaultHandler::endDTD ()

00712 {
00713 }
00714 
00715 inline void DefaultHandler::endEntity (const XMLCh* const name)

00716 {
00717 }
00718 
00719 inline void DefaultHandler::startCDATA ()

00720 {
00721 }
00722 
00723 inline void DefaultHandler::startDTD(  const   XMLCh* const    name
00724                                         , const   XMLCh* const publicId
00725                                         , const   XMLCh* const systemId)

00726 {
00727 }
00728 
00729 inline void DefaultHandler::startEntity (const XMLCh* const name)

00730 {
00731 }
00732 
00733 #endif // ! DEFAULTHANDLER_HPP


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