org::xmlBlaster::util::parser::ParserFactory Class Reference

Abstraction for the xml handling. More...

Collaboration diagram for org::xmlBlaster::util::parser::ParserFactory:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~ParserFactory ()
std::string getLocale (org::xmlBlaster::util::Global &global)
 The locale used to initialize the parser.
void initialize (org::xmlBlaster::util::Global &global)
 Initialize the used parser.
I_ParsercreateParser (org::xmlBlaster::util::Global &global, XmlHandlerBase *handler)
 Creates a parser implementation.

Static Public Member Functions

static ParserFactorygetFactory ()
 Static access to the factory.

Friends

class Sax2Parser

Detailed Description

Abstraction for the xml handling.

You may use this as the interface to extend in your specific XML handling (example SAX2).

It is a singleton class and has for that reason private constructors, destructor and assignment operator. To get a reference to the singleton instance you must invoke getFactory(...).

Definition at line 27 of file ParserFactory.h.


Constructor & Destructor Documentation

org::xmlBlaster::util::parser::ParserFactory::~ParserFactory (  ) 

Definition at line 114 of file ParserFactory.cpp.


Member Function Documentation

ParserFactory & org::xmlBlaster::util::parser::ParserFactory::getFactory (  )  [static]

Static access to the factory.

Exceptions:
XmlBlasterException 

Definition at line 88 of file ParserFactory.cpp.

References org::xmlBlaster::util::Object_Lifetime_Manager::instance(), and org::xmlBlaster::util::Object_Lifetime_Manager::manage_object().

Referenced by org::xmlBlaster::client::XmlBlasterAccess::XmlBlasterAccess().

std::string org::xmlBlaster::util::parser::ParserFactory::getLocale ( org::xmlBlaster::util::Global global  ) 

The locale used to initialize the parser.

Xerces defaults to "en_US", configurable with for example -xmlBlaster/locale "de_DE.iso-8859-1" or "en_US.UTF-8"

Definition at line 126 of file ParserFactory.cpp.

References org::xmlBlaster::util::Global::getProperty(), and org::xmlBlaster::util::Property::getStringProperty().

Referenced by initialize().

void org::xmlBlaster::util::parser::ParserFactory::initialize ( org::xmlBlaster::util::Global global  ) 

Initialize the used parser.

The locale is set if the Initialize() is invoked for the very first time, to ensure that each and every message loaders, in the process space, share the same locale.

All subsequent invocations of Initialize(), with a different locale, have no effect on the message loaders, either instantiated, or to be instantiated.

See also:
http://xml.apache.org/xerces-c/apiDocs/classXMLPlatformUtils.html#z489_0

Definition at line 133 of file ParserFactory.cpp.

References getLocale(), org::xmlBlaster::util::INTERNAL_UNKNOWN, and org::xmlBlaster::util::parser::Sax2Parser::releaseXMLCh().

Referenced by createParser(), and org::xmlBlaster::client::XmlBlasterAccess::XmlBlasterAccess().

I_Parser * org::xmlBlaster::util::parser::ParserFactory::createParser ( org::xmlBlaster::util::Global global,
XmlHandlerBase handler 
)

Creates a parser implementation.

It is the responsibility of the user to delete the I_Parser object once it is not needed anymore.

Exceptions:
XmlBlasterException 

Definition at line 159 of file ParserFactory.cpp.

References initialize(), org::xmlBlaster::util::INTERNAL_UNKNOWN, org::xmlBlaster::util::parser::Sax2Parser::releaseXMLCh(), and Sax2Parser.


Friends And Related Function Documentation

friend class Sax2Parser [friend]

Definition at line 28 of file ParserFactory.h.

Referenced by createParser().


The documentation for this class was generated from the following files: