Merged marshalling/unmarshalling methods into core interface.
[shibboleth/cpp-xmltooling.git] / xmltooling / impl / UnknownElement.h
index 1afb6e1..7ac3103 100644 (file)
@@ -15,7 +15,7 @@
  */\r
 \r
 /**\r
- * @file UnknownElement.h\r
+ * UnknownElement.h\r
  * \r
  * Basic implementations suitable for use as defaults for unrecognized content\r
  */\r
 #define __xmltooling_unkelement_h__\r
 \r
 #include "internal.h"\r
-#include "AbstractDOMCachingXMLObject.h"\r
 #include "XMLObjectBuilder.h"\r
-#include "io/Marshaller.h"\r
-#include "io/Unmarshaller.h"\r
+#include "io/AbstractXMLObjectMarshaller.h"\r
+#include "io/AbstractXMLObjectUnmarshaller.h"\r
 \r
 #include <string>\r
 \r
 \r
 namespace xmltooling {\r
 \r
-    /**\r
-     * Implementation class for unrecognized DOM elements.\r
-     * Purpose is to wrap the DOM and do any necessary caching/reconstruction\r
-     * when a DOM has to cross into a new document.\r
-     */\r
     class XMLTOOL_DLLLOCAL UnknownElementImpl : public AbstractDOMCachingXMLObject\r
     {\r
     public:\r
         UnknownElementImpl(const XMLCh* namespaceURI=NULL, const XMLCh* elementLocalName=NULL, const XMLCh* namespacePrefix=NULL)\r
             : AbstractDOMCachingXMLObject(namespaceURI, elementLocalName, namespacePrefix) {}\r
     \r
-        /**\r
-         * Overridden to ensure XML content of DOM isn't lost.\r
-         * \r
-         * @see DOMCachingXMLObject::releaseDOM()\r
-         */\r
         void releaseDOM();\r
 \r
-        /**\r
-          * @see XMLObject::clone()\r
-          */\r
         XMLObject* clone() const;\r
 \r
-    protected:\r
-        /**\r
-         * When needed, we can serialize the DOM into XML form and preserve it here.\r
-         */\r
-        std::string m_xml;\r
-\r
-        void serialize(std::string& s) const;\r
-    private:\r
-        friend class XMLTOOL_DLLLOCAL UnknownElementMarshaller;\r
-    };\r
-\r
-    /**\r
-     * Factory for UnknownElementImpl objects\r
-     */\r
-    class XMLTOOL_DLLLOCAL UnknownElementBuilder : public virtual XMLObjectBuilder\r
-    {\r
-    public:\r
-        /**\r
-         * @see XMLObjectBuilder::buildObject()\r
-         */\r
-        XMLObject* buildObject() const {\r
-            return new UnknownElementImpl();\r
-        }\r
-    };\r
-\r
-    /**\r
-     * Marshaller for UnknownElementImpl objects\r
-     */\r
-    class XMLTOOL_DLLLOCAL UnknownElementMarshaller : public virtual Marshaller\r
-    {\r
-    public:\r
-        /**\r
-         * @see Marshaller::marshall(XMLObject*,DOMDocument*, const MarshallingContext*)\r
-         */\r
-        DOMElement* marshall(XMLObject* xmlObject, DOMDocument* document=NULL, MarshallingContext* ctx=NULL) const;\r
-\r
-        /**\r
-         * @see Marshaller::marshall(XMLObject*,DOMElement*, const MarshallingContext* ctx)\r
-         */\r
-        DOMElement* marshall(XMLObject* xmlObject, DOMElement* parentElement, MarshallingContext* ctx=NULL) const;\r
+        DOMElement* marshall(DOMDocument* document=NULL, MarshallingContext* ctx=NULL) const;\r
+        DOMElement* marshall(DOMElement* parentElement, MarshallingContext* ctx=NULL) const;\r
+        XMLObject* unmarshall(DOMElement* element, bool bindDocument=false);\r
         \r
     protected:\r
         void setDocumentElement(DOMDocument* document, DOMElement* element) const {\r
@@ -110,19 +59,20 @@ namespace xmltooling {
             else\r
                 document->appendChild(element);\r
         }\r
+\r
+        mutable std::string m_xml;\r
+\r
+        void serialize(std::string& s) const;\r
     };\r
 \r
-    /**\r
-     * Unmarshaller for UnknownElementImpl objects\r
-     */\r
-    class XMLTOOL_DLLLOCAL UnknownElementUnmarshaller : public virtual Unmarshaller\r
+    class XMLTOOL_DLLLOCAL UnknownElementBuilder : public XMLObjectBuilder\r
     {\r
     public:\r
-        /**\r
-         * @see Unmarshaller::unmarshall()\r
-         */\r
-        XMLObject* unmarshall(DOMElement* element, bool bindDocument=false) const;\r
+        XMLObject* buildObject(const DOMElement* e=NULL) const {\r
+            return new UnknownElementImpl();\r
+        }\r
     };\r
+\r
 };\r
 \r
 #if defined (_MSC_VER)\r