DefaultHandler.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: DefaultHandler.hpp 932889 2010-04-11 13:10:10Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_DEFAULTHANDLER_HPP)
#define XERCESC_INCLUDE_GUARD_DEFAULTHANDLER_HPP
#include <xercesc/sax2/ContentHandler.hpp>
#include <xercesc/sax2/LexicalHandler.hpp>
#include <xercesc/sax2/DeclHandler.hpp>
#include <xercesc/sax/DTDHandler.hpp>
#include <xercesc/sax/EntityResolver.hpp>
#include <xercesc/sax/ErrorHandler.hpp>
#include <xercesc/sax/SAXParseException.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class Locator;
class Attributes;
class SAX2_EXPORT DefaultHandler :
public EntityResolver,
public DTDHandler,
public ContentHandler,
public ErrorHandler,
public LexicalHandler,
public DeclHandler
{
public:
virtual void characters
(
const XMLCh* const chars
, const XMLSize_t length
);
virtual void endDocument();
virtual void endElement
(
const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname
);
virtual void ignorableWhitespace
(
const XMLCh* const chars
, const XMLSize_t length
);
virtual void processingInstruction
(
const XMLCh* const target
, const XMLCh* const data
);
virtual void resetDocument();
virtual void setDocumentLocator(const Locator* const locator);
virtual void startDocument();
virtual void startElement
(
const XMLCh* const uri,
const XMLCh* const localname,
const XMLCh* const qname
, const Attributes& attrs
);
virtual void startPrefixMapping
(
const XMLCh* const prefix,
const XMLCh* const uri
) ;
virtual void endPrefixMapping
(
const XMLCh* const prefix
) ;
virtual void skippedEntity
(
const XMLCh* const name
) ;
virtual InputSource* resolveEntity
(
const XMLCh* const publicId
, const XMLCh* const systemId
);
virtual void error(const SAXParseException& exc);
virtual void fatalError(const SAXParseException& exc);
virtual void warning(const SAXParseException& exc);
virtual void resetErrors();
virtual void notationDecl
(
const XMLCh* const name
, const XMLCh* const publicId
, const XMLCh* const systemId
);
virtual void resetDocType();
virtual void unparsedEntityDecl
(
const XMLCh* const name
, const XMLCh* const publicId
, const XMLCh* const systemId
, const XMLCh* const notationName
);
virtual void comment
(
const XMLCh* const chars
, const XMLSize_t length
);
virtual void endCDATA ();
virtual void endDTD ();
virtual void endEntity (const XMLCh* const name);
virtual void startCDATA ();
virtual void startDTD
(
const XMLCh* const name
, const XMLCh* const publicId
, const XMLCh* const systemId
);
virtual void startEntity (const XMLCh* const name);
virtual void elementDecl
(
const XMLCh* const name
, const XMLCh* const model
);
virtual void attributeDecl
(
const XMLCh* const eName
, const XMLCh* const aName
, const XMLCh* const type
, const XMLCh* const mode
, const XMLCh* const value
);
virtual void internalEntityDecl
(
const XMLCh* const name
, const XMLCh* const value
);
virtual void externalEntityDecl
(
const XMLCh* const name
, const XMLCh* const publicId
, const XMLCh* const systemId
);
DefaultHandler() {};
virtual ~DefaultHandler() {};
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
DefaultHandler(const DefaultHandler&);
DefaultHandler& operator=(const DefaultHandler&);
};
// ---------------------------------------------------------------------------
// HandlerBase: Inline default implementations
// ---------------------------------------------------------------------------
inline void DefaultHandler::characters(const XMLCh* const
,const XMLSize_t)
{
}
inline void DefaultHandler::endDocument()
{
}
inline void DefaultHandler::endElement(const XMLCh* const
, const XMLCh* const
, const XMLCh* const)
{
}
inline void DefaultHandler::error(const SAXParseException&)
{
}
inline void DefaultHandler::fatalError(const SAXParseException& exc)
{
throw exc;
}
inline void
DefaultHandler::ignorableWhitespace( const XMLCh* const
, const XMLSize_t)
{
}
inline void DefaultHandler::notationDecl( const XMLCh* const
, const XMLCh* const
, const XMLCh* const)
{
}
inline void
DefaultHandler::processingInstruction( const XMLCh* const
, const XMLCh* const)
{
}
inline void DefaultHandler::resetErrors()
{
}
inline void DefaultHandler::resetDocument()
{
}
inline void DefaultHandler::resetDocType()
{
}
inline InputSource*
DefaultHandler::resolveEntity( const XMLCh* const
, const XMLCh* const)
{
return 0;
}
inline void
DefaultHandler::unparsedEntityDecl(const XMLCh* const
, const XMLCh* const
, const XMLCh* const
, const XMLCh* const)
{
}
inline void DefaultHandler::setDocumentLocator(const Locator* const)
{
}
inline void DefaultHandler::startDocument()
{
}
inline void
DefaultHandler::startElement( const XMLCh* const
, const XMLCh* const
, const XMLCh* const
, const Attributes&
)
{
}
inline void DefaultHandler::warning(const SAXParseException&)
{
}
inline void DefaultHandler::startPrefixMapping ( const XMLCh* const
,const XMLCh* const)
{
}
inline void DefaultHandler::endPrefixMapping ( const XMLCh* const)
{
}
inline void DefaultHandler::skippedEntity ( const XMLCh* const)
{
}
inline void DefaultHandler::comment( const XMLCh* const
, const XMLSize_t)
{
}
inline void DefaultHandler::endCDATA ()
{
}
inline void DefaultHandler::endDTD ()
{
}
inline void DefaultHandler::endEntity (const XMLCh* const)
{
}
inline void DefaultHandler::startCDATA ()
{
}
inline void DefaultHandler::startDTD( const XMLCh* const
, const XMLCh* const
, const XMLCh* const)
{
}
inline void DefaultHandler::startEntity (const XMLCh* const)
{
}
inline void DefaultHandler::attributeDecl(const XMLCh* const,
const XMLCh* const,
const XMLCh* const,
const XMLCh* const,
const XMLCh* const)
{
}
inline void DefaultHandler::elementDecl(const XMLCh* const,
const XMLCh* const)
{
}
inline void DefaultHandler::externalEntityDecl(const XMLCh* const,
const XMLCh* const,
const XMLCh* const)
{
}
inline void DefaultHandler::internalEntityDecl(const XMLCh* const,
const XMLCh* const)
{
}
XERCES_CPP_NAMESPACE_END
#endif // ! DEFAULTHANDLER_HPP
DefaultHandler::resetErrors
virtual void resetErrors()
Reset the Error handler object on its reuse.
Definition: DefaultHandler.hpp:688
LexicalHandler::startEntity
virtual void startEntity(const XMLCh *const name)=0
Receive notification of the start of an entity.
ContentHandler::startPrefixMapping
virtual void startPrefixMapping(const XMLCh *const prefix, const XMLCh *const uri)=0
Receive notification of the start of an namespace prefix mapping.
DefaultHandler::internalEntityDecl
virtual void internalEntityDecl(const XMLCh *const name, const XMLCh *const value)
Report an internal entity declaration.
Definition: DefaultHandler.hpp:799
ErrorHandler::fatalError
virtual void fatalError(const SAXParseException &exc)=0
Receive notification of a non-recoverable error.
ErrorHandler::error
virtual void error(const SAXParseException &exc)=0
Receive notification of a recoverable error.
DefaultHandler::endEntity
virtual void endEntity(const XMLCh *const name)
Receive notification of the end of an entity.
Definition: DefaultHandler.hpp:762
DTDHandler.hpp
ContentHandler::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)=0
Receive an object for locating the origin of SAX document events.
ContentHandler::skippedEntity
virtual void skippedEntity(const XMLCh *const name)=0
Receive notification of a skipped entity.
DefaultHandler::attributeDecl
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
DTDHandler
Receive notification of basic DTD-related events.
Definition: DTDHandler.hpp:59
DefaultHandler::startDocument
virtual void startDocument()
Receive notification of the beginning of the document.
Definition: DefaultHandler.hpp:719
DefaultHandler::fatalError
virtual void fatalError(const SAXParseException &exc)
Report a fatal XML parsing error.
Definition: DefaultHandler.hpp:665
ErrorHandler::resetErrors
virtual void resetErrors()=0
Reset the Error handler object on its reuse.
LexicalHandler::endCDATA
virtual void endCDATA()=0
Receive notification of the end of a CDATA section.
DTDHandler::unparsedEntityDecl
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.
DefaultHandler::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)
Receive notification of character data inside an element.
Definition: DefaultHandler.hpp:646
LexicalHandler::comment
virtual void comment(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of comments.
DeclHandler::externalEntityDecl
virtual void externalEntityDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
Report a parsed external entity declaration.
DefaultHandler::startCDATA
virtual void startCDATA()
Receive notification of the start of a CDATA section.
Definition: DefaultHandler.hpp:766
DeclHandler::attributeDecl
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.
EntityResolver
Basic interface for resolving entities.
Definition: EntityResolver.hpp:86
ContentHandler::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of ignorable whitespace in element content.
DTDHandler::resetDocType
virtual void resetDocType()=0
Reset the DocType object on its reuse.
DeclHandler.hpp
DefaultHandler
Default base class for SAX2 handlers.
Definition: DefaultHandler.hpp:60
DefaultHandler::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)
Resolve an external entity.
Definition: DefaultHandler.hpp:701
ErrorHandler
Basic interface for SAX error handlers.
Definition: ErrorHandler.hpp:60
DefaultHandler::externalEntityDecl
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
ContentHandler::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
Receive notification of a processing instruction.
DefaultHandler::endPrefixMapping
virtual void endPrefixMapping(const XMLCh *const prefix)
Receive notification of the end of an namespace prefix mapping.
Definition: DefaultHandler.hpp:741
DeclHandler::elementDecl
virtual void elementDecl(const XMLCh *const name, const XMLCh *const model)=0
Report an element type declaration.
SAX2_EXPORT
#define SAX2_EXPORT
Definition: XercesDefs.hpp:165
LexicalHandler::endDTD
virtual void endDTD()=0
Receive notification of the end of the DTD declarations.
DefaultHandler::unparsedEntityDecl
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
Locator
Interface for associating a SAX event with a document location.
Definition: Locator.hpp:54
Attributes
Interface for an element&#39;s attribute specifications.
Definition: Attributes.hpp:82
DefaultHandler::comment
virtual void comment(const XMLCh *const chars, const XMLSize_t length)
Receive notification of comments.
Definition: DefaultHandler.hpp:749
DefaultHandler::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)
Receive notification of a processing instruction.
Definition: DefaultHandler.hpp:683
DefaultHandler::endDocument
virtual void endDocument()
Receive notification of the end of the document.
Definition: DefaultHandler.hpp:651
DTDHandler::notationDecl
virtual void notationDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
Receive notification of a notation declaration event.
DefaultHandler::endCDATA
virtual void endCDATA()
Receive notification of the end of a CDATA section.
Definition: DefaultHandler.hpp:754
DefaultHandler::warning
virtual void warning(const SAXParseException &exc)
Receive notification of a parser warning.
Definition: DefaultHandler.hpp:732
DefaultHandler::endDTD
virtual void endDTD()
Receive notification of the end of the DTD declarations.
Definition: DefaultHandler.hpp:758
DefaultHandler::startPrefixMapping
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
DefaultHandler::resetDocType
virtual void resetDocType()
Reset the DTD object on its reuse.
Definition: DefaultHandler.hpp:696
DefaultHandler::error
virtual void error(const SAXParseException &exc)
Receive notification of a recoverable parser error.
Definition: DefaultHandler.hpp:661
DeclHandler::internalEntityDecl
virtual void internalEntityDecl(const XMLCh *const name, const XMLCh *const value)=0
Report an internal entity declaration.
DefaultHandler::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)
Receive notification of ignorable whitespace in element content.
Definition: DefaultHandler.hpp:671
ErrorHandler::warning
virtual void warning(const SAXParseException &exc)=0
Receive notification of a warning.
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
ContentHandler
Receive notification of general document events.
Definition: ContentHandler.hpp:60
DeclHandler
Receive notification of DTD declaration events.
Definition: DeclHandler.hpp:48
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
ContentHandler.hpp
LexicalHandler::startDTD
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.
LexicalHandler.hpp
DefaultHandler::DefaultHandler
DefaultHandler()
Definition: DefaultHandler.hpp:631
LexicalHandler::startCDATA
virtual void startCDATA()=0
Receive notification of the start of a CDATA section.
DefaultHandler::startEntity
virtual void startEntity(const XMLCh *const name)
Receive notification of the start of an entity.
Definition: DefaultHandler.hpp:776
DefaultHandler::skippedEntity
virtual void skippedEntity(const XMLCh *const name)
Receive notification of a skipped entity.
Definition: DefaultHandler.hpp:745
ContentHandler::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of character data.
XMLSize_t
size_t XMLSize_t
Definition: Xerces_autoconf_config.hpp:112
DefaultHandler::~DefaultHandler
virtual ~DefaultHandler()
Definition: DefaultHandler.hpp:632
ContentHandler::startElement
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.
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
LexicalHandler::endEntity
virtual void endEntity(const XMLCh *const name)=0
Receive notification of the end of an entity.
EntityResolver::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)=0
Allow the application to resolve external entities.
ContentHandler::endPrefixMapping
virtual void endPrefixMapping(const XMLCh *const prefix)=0
Receive notification of the end of an namespace prefix mapping.
ContentHandler::endElement
virtual void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)=0
Receive notification of the end of an element.
DefaultHandler::resetDocument
virtual void resetDocument()
Reset the Document object on its reuse.
Definition: DefaultHandler.hpp:692
SAXParseException.hpp
ContentHandler::startDocument
virtual void startDocument()=0
Receive notification of the beginning of a document.
DefaultHandler::startElement
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
DefaultHandler::elementDecl
virtual void elementDecl(const XMLCh *const name, const XMLCh *const model)
Report an element type declaration.
Definition: DefaultHandler.hpp:788
EntityResolver.hpp
ContentHandler::endDocument
virtual void endDocument()=0
Receive notification of the end of a document.
DefaultHandler::startDTD
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
ErrorHandler.hpp
SAXParseException
Encapsulate an XML parse error or warning.
Definition: SAXParseException.hpp:48
DefaultHandler::notationDecl
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
DefaultHandler::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)
Receive a Locator object for document events.
Definition: DefaultHandler.hpp:715
LexicalHandler
Receive notification of lexical events.
Definition: LexicalHandler.hpp:46
InputSource
A single input source for an XML entity.
Definition: InputSource.hpp:62
DefaultHandler::endElement
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