#include <Cascadable_DocHandler.h>
Inheritance diagram for CIAO::XMLHelpers::Cascadable_DocHandler:
Public Member Functions | |
Cascadable_DocHandler (ACEXML_XMLReader *parser, Cascadable_DocHandler *parent, const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName, ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) throw (ACEXML_SAXException) | |
virtual | ~Cascadable_DocHandler (void) |
virtual void | destroy () |
void | push_handler (Cascadable_DocHandler *new_handler, ACEXML_Attributes *atts ACEXML_ENV_ARG_DECL) throw (ACEXML_SAXException) |
void | pop_handler (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) throw (ACEXML_SAXException) |
const ACEXML_Char * | namespaceURI (void) const |
const ACEXML_Char * | localName (void) const |
const ACEXML_Char * | qName (void) const |
virtual void | setDocumentLocator (ACEXML_Locator *locator) |
virtual void | error (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) throw (ACEXML_SAXException) |
virtual void | fatalError (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) throw (ACEXML_SAXException) |
virtual void | warning (ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) throw (ACEXML_SAXException) |
Protected Member Functions | |
virtual void | print_warning (const ACEXML_Char *level, ACEXML_SAXParseException &exception ACEXML_ENV_ARG_DECL) throw (ACEXML_SAXException) |
Protected Attributes | |
ACEXML_Char * | namespaceURI_ |
ACEXML_Char * | localName_ |
ACEXML_Char * | qName_ |
ACEXML_XMLReader * | parser_ |
Pointer to the parser that send us events. | |
Cascadable_DocHandler * | parent_ |
Cascadable_DocHandler * | child_ |
Pointer to the child event handler that handles a sub-element. | |
Private Member Functions | |
Cascadable_DocHandler () | |
No implement. | |
Private Attributes | |
ACEXML_Locator * | locator_ |
Pointer to Locator. |
This class is available as a convenience base class for writing cascadable XML Document DefaultHandler. This class implement the basic functionality for DocHandlers that can be cascaded together to handling nested XML tags. Users can write specific handlers to handle specific XML elements so they can be composed together to handle complex XML definitions. This class utilize the "Interpreter" design pattern as described in GoF.
Application writers should extend this class to implement a handler that interpret a specific XML element. There are just a few rules to use the Cascadable_DocHandler.
1. A Cascadable_DocHandler determines whether a new Cascadable_DocHandler should be used to handle a subelement in its startElement method. When it encounter a subelement that requires a different implementation of Cascadable_DocHandler, it should create the new Cascadable_DocHandler, and then invoke the push_handler
method to inform the parser
to use the new handler (this in effect switches all four handlers the parse uses to the new handler.)
2. A Cascadable_DocHandler determines whether it has done handling an element structure in endElement method, it invoke the pop_handler method of its parent handler. The pop_handler in turn invokes the endElement eventhandler of the parent handler so it has a chance to harvest the parse result from the child handler.
See the Handler-Interaction.png for how handlers interact with each other.
DocHandler_Context
|
Constructor. |
|
destructor. |
|
No implement.
|
|
Destroy method. |
|
Receive notification of a recoverable error. Reimplemented from ACEXML_DefaultHandler. Reimplemented in Svcconf_Handler. |
|
Receive notification of a non-recoverable error. Reimplemented from ACEXML_DefaultHandler. Reimplemented in Svcconf_Handler. |
|
|
|
Accessors for the element Context we are in. Make copy if you need to store the return strings for later use. |
|
This function should be called at the end of |
|
Print out an error/warning message |
|
THIS function should be called by the @ I haven't figured out what should happen if an exception occurs in push_handler. It can either restore the original handler, or let the user decide what to do. |
|
|
|
Receive an object for locating the origin of SAX document events. Reimplemented from ACEXML_DefaultHandler. Reimplemented in Svcconf_Handler. |
|
Receive notification of a warning. Reimplemented from ACEXML_DefaultHandler. Reimplemented in Svcconf_Handler. |
|
Pointer to the child event handler that handles a sub-element.
|
|
|
|
Pointer to Locator.
|
|
Element tag information. |
|
Pointer to the parent event handler that handles the parent element. |
|
Pointer to the parser that send us events.
|
|
|