Abstract unmarshaller minus signatures.
[shibboleth/cpp-xmltooling.git] / xmltooling / io / AbstractXMLObjectUnmarshaller.h
index 0bc665a..fb45191 100644 (file)
 #if !defined(__xmltooling_xmlunmarshaller_h__)\r
 #define __xmltooling_xmlunmarshaller_h__\r
 \r
-#include <xmltooling/DOMCachingXMLObject.h>\r
-#include <xmltooling/exceptions.h>\r
-#include <xmltooling/XMLObjectBuilder.h>\r
+#include <xmltooling/XMLObject.h>\r
 #include <xmltooling/io/Unmarshaller.h>\r
-#include <xmltooling/util/XMLConstants.h>\r
-#include <xmltooling/util/XMLHelper.h>\r
 \r
 namespace xmltooling {\r
 \r
@@ -55,11 +51,7 @@ namespace xmltooling {
          * @param targetLocalName the local name of either the schema type QName or element QName of the elements this\r
          *            unmarshaller operates on\r
          */\r
-        AbstractXMLObjectUnmarshaller(const XMLCh* targetNamespaceURI, const XMLCh* targetLocalName)\r
-                : m_targetQName(targetNamespaceURI, targetLocalName) {\r
-            if (!targetLocalName || !*targetLocalName)\r
-                throw UnmarshallerException("targetLocalName cannot be null or empty");\r
-        }\r
+        AbstractXMLObjectUnmarshaller(const XMLCh* targetNamespaceURI, const XMLCh* targetLocalName);\r
 \r
         /**\r
          * Checks that the given DOM Element's XSI type or namespace qualified element name matches the target QName of this\r
@@ -69,7 +61,7 @@ namespace xmltooling {
          * \r
          * @throws UnmarshallingException thrown if the DOM Element does not match the target of this unmarshaller\r
          */\r
-        void checkElementIsTarget(DOMElement* domElement) const;\r
+        void checkElementIsTarget(const DOMElement* domElement) const;\r
         \r
         /**\r
          * Constructs the XMLObject that the given DOM Element will be unmarshalled into. If the DOM element has an XML\r
@@ -84,7 +76,7 @@ namespace xmltooling {
          * \r
          * @throws UnmarshallingException thrown if there is now XMLObjectBuilder registered for the given DOM Element\r
          */\r
-        virtual XMLObject* buildXMLObject(DOMElement* domElement) const;\r
+        virtual XMLObject* buildXMLObject(const DOMElement* domElement) const;\r
         \r
         /**\r
          * Unmarshalls the attributes from the given DOM Element into the given XMLObject. If the attribute is an XML\r
@@ -97,7 +89,7 @@ namespace xmltooling {
          * \r
          * @throws UnmarshallingException thrown if there is a problem unmarshalling an attribute\r
          */\r
-        virtual void unmarshallAttributes(DOMElement* domElement, XMLObject* xmlObject) const;\r
+        virtual void unmarshallAttributes(const DOMElement* domElement, XMLObject* xmlObject) const;\r
 \r
         /**\r
          * Unmarshalls a given Element's children. For each child an unmarshaller is retrieved using\r
@@ -109,19 +101,7 @@ namespace xmltooling {
          * \r
          * @throws UnmarshallingException thrown if an error occurs unmarshalling the child elements\r
          */\r
-        virtual void unmarshallChildElements(DOMElement* domElement, XMLObject* xmlObject) const;\r
-\r
-        /**\r
-         * Gets the Unmarshaller for the given Element. If the child element has an explicit XML Schema type,\r
-         * that is used to get the unmarshaller. If there is no unmarshaller registered for the schema type,\r
-         * or the element does not have an explicit schema type, the element's QName is used.\r
-         * \r
-         * @param domElement the DOM Element to get the Unmarshaller for\r
-         * @return the Unmarshaller for the given DOM Element\r
-         * \r
-         * @throws UnmarshallingException thrown if no unmarshaller is available for the given DOM Element\r
-         */\r
-        const Unmarshaller* getUnmarshaller(DOMElement* domElement) const;\r
+        virtual void unmarshallChildElements(const DOMElement* domElement, XMLObject* xmlObject) const;\r
 \r
         /**\r
          * Called after a child element has been unmarshalled so that it can be added to the parent XMLObject.\r
@@ -137,12 +117,11 @@ namespace xmltooling {
          * Called after an attribute has been unmarshalled so that it can be added to the XMLObject.\r
          * \r
          * @param xmlObject the XMLObject\r
-         * @param name the attribute's name\r
-         * @param value the attribute's value\r
+         * @param attribute the attribute being unmarshalled\r
          * \r
          * @throws UnmarshallingException thrown if there is a problem adding the attribute to the XMLObject\r
          */\r
-        virtual void processAttribute(XMLObject* xmlObject, const XMLCh* name, const XMLCh* value) const=0;\r
+        virtual void processAttribute(XMLObject* xmlObject, const DOMAttr* attribute) const=0;\r
     \r
         /**\r
          * Called if the element being unmarshalled contained textual content so that it can be added to the XMLObject.\r
@@ -152,6 +131,7 @@ namespace xmltooling {
          */\r
         virtual void processElementContent(XMLObject* xmlObject, const XMLCh* elementContent) const=0;\r
 \r
+        void* m_log;\r
     private:\r
         QName m_targetQName;\r
     };\r