HandlerBase.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$
*/
#if !defined(XERCESC_INCLUDE_GUARD_HANDLERBASE_HPP)
#define XERCESC_INCLUDE_GUARD_HANDLERBASE_HPP
#include <xercesc/sax/DocumentHandler.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 AttributeList;
class SAX_EXPORT HandlerBase :
public EntityResolver, public DTDHandler, public DocumentHandler
, public ErrorHandler
{
public:
virtual void characters
(
const XMLCh* const chars
, const XMLSize_t length
);
virtual void endDocument();
virtual void endElement(const XMLCh* const name);
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 name
, AttributeList& attributes
);
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
);
HandlerBase() {};
virtual ~HandlerBase() {};
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
HandlerBase(const HandlerBase&);
HandlerBase& operator=(const HandlerBase&);
};
// ---------------------------------------------------------------------------
// HandlerBase: Inline default implementations
// ---------------------------------------------------------------------------
inline void HandlerBase::characters(const XMLCh* const
, const XMLSize_t)
{
}
inline void HandlerBase::endDocument()
{
}
inline void HandlerBase::endElement(const XMLCh* const)
{
}
inline void HandlerBase::error(const SAXParseException&)
{
}
inline void HandlerBase::fatalError(const SAXParseException& exc)
{
throw exc;
}
inline void
HandlerBase::ignorableWhitespace( const XMLCh* const
, const XMLSize_t)
{
}
inline void HandlerBase::notationDecl( const XMLCh* const
, const XMLCh* const
, const XMLCh* const)
{
}
inline void
HandlerBase::processingInstruction( const XMLCh* const
, const XMLCh* const)
{
}
inline void HandlerBase::resetErrors()
{
}
inline void HandlerBase::resetDocument()
{
}
inline void HandlerBase::resetDocType()
{
}
inline InputSource*
HandlerBase::resolveEntity( const XMLCh* const
, const XMLCh* const)
{
return 0;
}
inline void
HandlerBase::unparsedEntityDecl(const XMLCh* const
, const XMLCh* const
, const XMLCh* const
, const XMLCh* const)
{
}
inline void HandlerBase::setDocumentLocator(const Locator* const)
{
}
inline void HandlerBase::startDocument()
{
}
inline void
HandlerBase::startElement( const XMLCh* const
, AttributeList&)
{
}
inline void HandlerBase::warning(const SAXParseException&)
{
}
XERCES_CPP_NAMESPACE_END
#endif
DTDHandler.hpp
DocumentHandler.hpp
EntityResolver.hpp
ErrorHandler.hpp
SAXParseException.hpp
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
SAX_EXPORT
#define SAX_EXPORT
Definition: XercesDefs.hpp:164
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XMLCh
uint16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
XMLSize_t
size_t XMLSize_t
Definition: Xerces_autoconf_config.hpp:112
AttributeList
Interface for an element's attribute specifications.
Definition: AttributeList.hpp:81
DTDHandler
Receive notification of basic DTD-related events.
Definition: DTDHandler.hpp:60
DTDHandler::resetDocType
virtual void resetDocType()=0
Reset the DocType object on its reuse.
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.
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.
DocumentHandler
Receive notification of general document events.
Definition: DocumentHandler.hpp:61
DocumentHandler::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of character data.
DocumentHandler::startElement
virtual void startElement(const XMLCh *const name, AttributeList &attrs)=0
Receive notification of the beginning of an element.
DocumentHandler::startDocument
virtual void startDocument()=0
Receive notification of the beginning of a document.
DocumentHandler::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
Receive notification of a processing instruction.
DocumentHandler::endDocument
virtual void endDocument()=0
Receive notification of the end of a document.
DocumentHandler::resetDocument
virtual void resetDocument()=0
Reset the Document object on its reuse.
DocumentHandler::endElement
virtual void endElement(const XMLCh *const name)=0
Receive notification of the end of an element.
DocumentHandler::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)=0
Receive an object for locating the origin of SAX document events.
DocumentHandler::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of ignorable whitespace in element content.
EntityResolver
Basic interface for resolving entities.
Definition: EntityResolver.hpp:87
EntityResolver::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)=0
Allow the application to resolve external entities.
ErrorHandler
Basic interface for SAX error handlers.
Definition: ErrorHandler.hpp:61
ErrorHandler::warning
virtual void warning(const SAXParseException &exc)=0
Receive notification of a warning.
ErrorHandler::fatalError
virtual void fatalError(const SAXParseException &exc)=0
Receive notification of a non-recoverable error.
ErrorHandler::resetErrors
virtual void resetErrors()=0
Reset the Error handler object on its reuse.
ErrorHandler::error
virtual void error(const SAXParseException &exc)=0
Receive notification of a recoverable error.
HandlerBase
Default base class for handlers.
Definition: HandlerBase.hpp:60
HandlerBase::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)
Receive notification of ignorable whitespace in element content.
Definition: HandlerBase.hpp:402
HandlerBase::endDocument
virtual void endDocument()
Receive notification of the end of the document.
Definition: HandlerBase.hpp:384
HandlerBase::resetDocType
virtual void resetDocType()
Reset the DTD object on its reuse.
Definition: HandlerBase.hpp:427
HandlerBase::resetDocument
virtual void resetDocument()
Reset the Document object on its reuse.
Definition: HandlerBase.hpp:423
HandlerBase::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: HandlerBase.hpp:439
HandlerBase::~HandlerBase
virtual ~HandlerBase()
Definition: HandlerBase.hpp:365
HandlerBase::startElement
virtual void startElement(const XMLCh *const name, AttributeList &attributes)
Receive notification of the start of an element.
Definition: HandlerBase.hpp:455
HandlerBase::startDocument
virtual void startDocument()
Receive notification of the beginning of the document.
Definition: HandlerBase.hpp:450
HandlerBase::notationDecl
virtual void notationDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)
Receive notification of a notation declaration.
Definition: HandlerBase.hpp:407
HandlerBase::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)
Receive notification of character data inside an element.
Definition: HandlerBase.hpp:379
HandlerBase::error
virtual void error(const SAXParseException &exc)
Receive notification of a recoverable parser error.
Definition: HandlerBase.hpp:392
HandlerBase::fatalError
virtual void fatalError(const SAXParseException &exc)
Report a fatal XML parsing error.
Definition: HandlerBase.hpp:396
HandlerBase::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)
Receive notification of a processing instruction.
Definition: HandlerBase.hpp:414
HandlerBase::HandlerBase
HandlerBase()
Definition: HandlerBase.hpp:364
HandlerBase::endElement
virtual void endElement(const XMLCh *const name)
Receive notification of the end of an element.
Definition: HandlerBase.hpp:388
HandlerBase::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)
Resolve an external entity.
Definition: HandlerBase.hpp:432
HandlerBase::resetErrors
virtual void resetErrors()
Reset the Error handler object on its reuse.
Definition: HandlerBase.hpp:419
HandlerBase::warning
virtual void warning(const SAXParseException &exc)
Receive notification of a parser warning.
Definition: HandlerBase.hpp:460
HandlerBase::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)
Receive a Locator object for document events.
Definition: HandlerBase.hpp:446
InputSource
A single input source for an XML entity.
Definition: InputSource.hpp:63
Locator
Interface for associating a SAX event with a document location.
Definition: Locator.hpp:55
SAXParseException
Encapsulate an XML parse error or warning.
Definition: SAXParseException.hpp:49