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: HandlerBase.hpp 932889 2010-04-11 13:10:10Z borisk $
*/
#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::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.
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
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::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)
Receive a Locator object for document events.
Definition: HandlerBase.hpp:446
DocumentHandler.hpp
XMLCh
char16_t XMLCh
Definition: Xerces_autoconf_config.hpp:120
HandlerBase::startDocument
virtual void startDocument()
Receive notification of the beginning of the document.
Definition: HandlerBase.hpp:450
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::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::HandlerBase
HandlerBase()
Definition: HandlerBase.hpp:364
Locator
Interface for associating a SAX event with a document location.
Definition: Locator.hpp:54
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
DocumentHandler::endDocument
virtual void endDocument()=0
Receive notification of the end of a document.
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
DocumentHandler
Receive notification of general document events.
Definition: DocumentHandler.hpp:60
DTDHandler.hpp
HandlerBase::~HandlerBase
virtual ~HandlerBase()
Definition: HandlerBase.hpp:365
EntityResolver.hpp
HandlerBase::endElement
virtual void endElement(const XMLCh *const name)
Receive notification of the end of an element.
Definition: HandlerBase.hpp:388
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.
DTDHandler
Receive notification of basic DTD-related events.
Definition: DTDHandler.hpp:59
AttributeList
Interface for an element's attribute specifications.
Definition: AttributeList.hpp:80
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::startDocument
virtual void startDocument()=0
Receive notification of the beginning of a document.
XMLSize_t
size_t XMLSize_t
Definition: Xerces_autoconf_config.hpp:112
DocumentHandler::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of character data.
ErrorHandler.hpp
HandlerBase::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)
Resolve an external entity.
Definition: HandlerBase.hpp:432
HandlerBase
Default base class for handlers.
Definition: HandlerBase.hpp:56
HandlerBase::error
virtual void error(const SAXParseException &exc)
Receive notification of a recoverable parser error.
Definition: HandlerBase.hpp:392
ErrorHandler::resetErrors
virtual void resetErrors()=0
Reset the Error handler object on its reuse.
EntityResolver::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)=0
Allow the application to resolve external entities.
SAXParseException
Encapsulate an XML parse error or warning.
Definition: SAXParseException.hpp:48
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
SAX_EXPORT
#define SAX_EXPORT
Definition: XercesDefs.hpp:164
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:86
DocumentHandler::startElement
virtual void startElement(const XMLCh *const name, AttributeList &attrs)=0
Receive notification of the beginning of an element.
ErrorHandler::warning
virtual void warning(const SAXParseException &exc)=0
Receive notification of a warning.
HandlerBase::startElement
virtual void startElement(const XMLCh *const name, AttributeList &attributes)
Receive notification of the start of an element.
Definition: HandlerBase.hpp:455
HandlerBase::resetDocType
virtual void resetDocType()
Reset the DTD object on its reuse.
Definition: HandlerBase.hpp:427
ErrorHandler::fatalError
virtual void fatalError(const SAXParseException &exc)=0
Receive notification of a non-recoverable error.
InputSource
A single input source for an XML entity.
Definition: InputSource.hpp:62
DocumentHandler::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
Receive notification of a processing instruction.
SAXParseException.hpp
HandlerBase::fatalError
virtual void fatalError(const SAXParseException &exc)
Report a fatal XML parsing error.
Definition: HandlerBase.hpp:396
ErrorHandler::error
virtual void error(const SAXParseException &exc)=0
Receive notification of a recoverable error.
HandlerBase::resetDocument
virtual void resetDocument()
Reset the Document object on its reuse.
Definition: HandlerBase.hpp:423
HandlerBase::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)
Receive notification of a processing instruction.
Definition: HandlerBase.hpp:414
HandlerBase::endDocument
virtual void endDocument()
Receive notification of the end of the document.
Definition: HandlerBase.hpp:384
ErrorHandler
Basic interface for SAX error handlers.
Definition: ErrorHandler.hpp:60