+ \r
+ /**\r
+ * Retrieves an XMLObjectBuilder using the key it was registered with.\r
+ * \r
+ * @param key the key used to register the builder\r
+ * @return the builder\r
+ */\r
+ static XMLObjectBuilder* getBuilder(const QName& key) {\r
+ std::map<QName,XMLObjectBuilder*>::const_iterator i=m_map.find(key);\r
+ return (i==m_map.end()) ? NULL : i->second;\r
+ }\r
+ \r
+ /**\r
+ * Gets an immutable list of all the builders currently registered.\r
+ * \r
+ * @return list of all the builders currently registered\r
+ */\r
+ static const std::map<QName,XMLObjectBuilder*>& getBuilders() {\r
+ return m_map;\r
+ }\r
+ \r
+ /**\r
+ * Registers a new builder for the given key.\r
+ * \r
+ * @param builderKey the key used to retrieve this builder later\r
+ * @param builder the builder\r
+ */\r
+ static void registerBuilder(const QName& builderKey, XMLObjectBuilder* builder) {\r
+ m_map[builderKey]=builder;\r
+ }\r
+ \r
+ /**\r
+ * Deregisters a builder.\r
+ * \r
+ * @param builderKey the key for the builder to be deregistered\r
+ */\r
+ static void deregisterBuilder(const QName& builderKey) {\r
+ delete getBuilder(builderKey);\r
+ m_map.erase(builderKey);\r
+ }\r
+ \r
+ /**\r
+ * Unregisters and destroys all registered builders. \r
+ */\r
+ static void destroyBuilders();\r
+ \r
+ private:\r
+ static std::map<QName,XMLObjectBuilder*> m_map;\r