1 /*------------------------------------------------------------------------------
2 Name: AddressFactory.h
3 Project: xmlBlaster.org
4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
5 Comment: Factory Object for parsing org::xmlBlaster::util::qos::address::Address objects.
6 Author: laghi
7 ------------------------------------------------------------------------------*/
8
9 /**
10 * Factory for the creation (SAX parsing from std::string) of org::xmlBlaster::util::qos::address::AddressBase objects.
11 * The created org::xmlBlaster::util::qos::address::AddressBase objects can easely be converted to org::xmlBlaster::util::qos::address::Address and
12 * org::xmlBlaster::util::qos::address::CallbackAddress objects.
13 * See classes of the object it creates.
14 * @see org::xmlBlaster::util::qos::address::AddressBase
15 * @see org::xmlBlaster::util::qos::address::Address
16 * @see org::xmlBlaster::util::qos::address::CallbackAddress
17 */
18 #ifndef _UTIL_CFG_ADDRESSFACTORY_H
19 #define _UTIL_CFG_ADDRESSFACTORY_H
20
21 #include <util/parser/XmlHandlerBase.h>
22 #include <util/qos/address/AddressBase.h>
23
24 namespace org { namespace xmlBlaster { namespace util { namespace qos { namespace address {
25
26 class Dll_Export AddressFactory : public parser::XmlHandlerBase
27 {
28 private:
29 const std::string ME;
30 org::xmlBlaster::util::qos::address::AddressBaseRef address_;
31 std::string attributeKey_;
32 bool inAttribute_;
33 ClientProperty* attribute_;
34
35 /**
36 * Copy constructor
37 */
38 AddressFactory(const AddressFactory& rhs);
39
40 /**
41 * Assignment constructor
42 */
43 AddressFactory& operator=(const AddressFactory& rhs);
44
45 public:
46 AddressFactory(org::xmlBlaster::util::Global& global);
47
48 ~AddressFactory();
49
50 void reset(const AddressBaseRef& address);
51
52 org::xmlBlaster::util::qos::address::AddressBaseRef getAddress();
53
54 /**
55 * Called for SAX callback start tag
56 */
57 // void startElement(const std::string& uri, const std::string& localName, const std::string& name, const std::string& character, Attributes attrs)
58 void startElement(const std::string &name, const parser::AttributeMap& attrs);
59
60 /** End element. */
61 // public final void endElement(String uri, String localName, String name, StringBuffer character) {
62 void endElement(const std::string &name);
63
64 org::xmlBlaster::util::qos::address::AddressBaseRef readAddress(const std::string& litteral, const org::xmlBlaster::util::qos::address::AddressBaseRef& address);
65 };
66
67 }}}}} // namespaces
68
69 #endif
syntax highlighted by Code2HTML, v. 0.9.1