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$
*/
#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
ContentHandler.hpp
DTDHandler.hpp
DeclHandler.hpp
EntityResolver.hpp
ErrorHandler.hpp
LexicalHandler.hpp
SAXParseException.hpp
SAX2_EXPORT
#define SAX2_EXPORT
Definition XercesDefs.hpp:165
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLSize_t
size_t XMLSize_t
Definition Xerces_autoconf_config.hpp:112
XMLCh
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
Attributes
Interface for an element's attribute specifications.
Definition Attributes.hpp:83
ContentHandler
Receive notification of general document events.
Definition ContentHandler.hpp:61
ContentHandler::skippedEntity
virtual void skippedEntity(const XMLCh *const name)=0
Receive notification of a skipped entity.
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.
ContentHandler::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of ignorable whitespace in element content.
ContentHandler::endPrefixMapping
virtual void endPrefixMapping(const XMLCh *const prefix)=0
Receive notification of the end of an namespace prefix mapping.
ContentHandler::endDocument
virtual void endDocument()=0
Receive notification of the end of a document.
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.
ContentHandler::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
Receive notification of a processing instruction.
ContentHandler::startPrefixMapping
virtual void startPrefixMapping(const XMLCh *const prefix, const XMLCh *const uri)=0
Receive notification of the start of an namespace prefix mapping.
ContentHandler::characters
virtual void characters(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of character data.
ContentHandler::startDocument
virtual void startDocument()=0
Receive notification of the beginning of a document.
ContentHandler::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)=0
Receive an object for locating the origin of SAX document events.
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.
DeclHandler
Receive notification of DTD declaration events.
Definition DeclHandler.hpp:49
DeclHandler::externalEntityDecl
virtual void externalEntityDecl(const XMLCh *const name, const XMLCh *const publicId, const XMLCh *const systemId)=0
Report a parsed external entity declaration.
DeclHandler::elementDecl
virtual void elementDecl(const XMLCh *const name, const XMLCh *const model)=0
Report an element type declaration.
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.
DeclHandler::internalEntityDecl
virtual void internalEntityDecl(const XMLCh *const name, const XMLCh *const value)=0
Report an internal entity declaration.
DefaultHandler
Default base class for SAX2 handlers.
Definition DefaultHandler.hpp:68
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
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
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
DefaultHandler::internalEntityDecl
virtual void internalEntityDecl(const XMLCh *const name, const XMLCh *const value)
Report an internal entity declaration.
Definition DefaultHandler.hpp:799
DefaultHandler::startCDATA
virtual void startCDATA()
Receive notification of the start of a CDATA section.
Definition DefaultHandler.hpp:766
DefaultHandler::elementDecl
virtual void elementDecl(const XMLCh *const name, const XMLCh *const model)
Report an element type declaration.
Definition DefaultHandler.hpp:788
DefaultHandler::startEntity
virtual void startEntity(const XMLCh *const name)
Receive notification of the start of an entity.
Definition DefaultHandler.hpp:776
DefaultHandler::endPrefixMapping
virtual void endPrefixMapping(const XMLCh *const prefix)
Receive notification of the end of an namespace prefix mapping.
Definition DefaultHandler.hpp:741
DefaultHandler::fatalError
virtual void fatalError(const SAXParseException &exc)
Report a fatal XML parsing error.
Definition DefaultHandler.hpp:665
DefaultHandler::resetDocument
virtual void resetDocument()
Reset the Document object on its reuse.
Definition DefaultHandler.hpp:692
DefaultHandler::resolveEntity
virtual InputSource * resolveEntity(const XMLCh *const publicId, const XMLCh *const systemId)
Resolve an external entity.
Definition DefaultHandler.hpp:701
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
DefaultHandler::endDocument
virtual void endDocument()
Receive notification of the end of the document.
Definition DefaultHandler.hpp:651
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
DefaultHandler::error
virtual void error(const SAXParseException &exc)
Receive notification of a recoverable parser error.
Definition DefaultHandler.hpp:661
DefaultHandler::processingInstruction
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)
Receive notification of a processing instruction.
Definition DefaultHandler.hpp:683
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::startDocument
virtual void startDocument()
Receive notification of the beginning of the document.
Definition DefaultHandler.hpp:719
DefaultHandler::resetDocType
virtual void resetDocType()
Reset the DTD object on its reuse.
Definition DefaultHandler.hpp:696
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::DefaultHandler
DefaultHandler()
Definition DefaultHandler.hpp:631
DefaultHandler::skippedEntity
virtual void skippedEntity(const XMLCh *const name)
Receive notification of a skipped entity.
Definition DefaultHandler.hpp:745
DefaultHandler::~DefaultHandler
virtual ~DefaultHandler()
Definition DefaultHandler.hpp:632
DefaultHandler::comment
virtual void comment(const XMLCh *const chars, const XMLSize_t length)
Receive notification of comments.
Definition DefaultHandler.hpp:749
DefaultHandler::setDocumentLocator
virtual void setDocumentLocator(const Locator *const locator)
Receive a Locator object for document events.
Definition DefaultHandler.hpp:715
DefaultHandler::endDTD
virtual void endDTD()
Receive notification of the end of the DTD declarations.
Definition DefaultHandler.hpp:758
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::warning
virtual void warning(const SAXParseException &exc)
Receive notification of a parser warning.
Definition DefaultHandler.hpp:732
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
DefaultHandler::resetErrors
virtual void resetErrors()
Reset the Error handler object on its reuse.
Definition DefaultHandler.hpp:688
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
DefaultHandler::endCDATA
virtual void endCDATA()
Receive notification of the end of a CDATA section.
Definition DefaultHandler.hpp:754
DefaultHandler::endEntity
virtual void endEntity(const XMLCh *const name)
Receive notification of the end of an entity.
Definition DefaultHandler.hpp:762
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.
InputSource
A single input source for an XML entity.
Definition InputSource.hpp:63
LexicalHandler
Receive notification of lexical events.
Definition LexicalHandler.hpp:47
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::endDTD
virtual void endDTD()=0
Receive notification of the end of the DTD declarations.
LexicalHandler::endEntity
virtual void endEntity(const XMLCh *const name)=0
Receive notification of the end of an entity.
LexicalHandler::startCDATA
virtual void startCDATA()=0
Receive notification of the start of a CDATA section.
LexicalHandler::endCDATA
virtual void endCDATA()=0
Receive notification of the end of a CDATA section.
LexicalHandler::startEntity
virtual void startEntity(const XMLCh *const name)=0
Receive notification of the start of an entity.
LexicalHandler::comment
virtual void comment(const XMLCh *const chars, const XMLSize_t length)=0
Receive notification of comments.
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