X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Fio%2FAbstractXMLObjectMarshaller.h;h=cbab2fed2a3d3a7b73e307ba8fd7a0bcf05d2283;hb=77769b2e300d1295b8a5d717d9ede50e27d70cea;hp=82d1621e1e729a521cfd8ae3e08aa146df8789e5;hpb=a039baceeda19f0e5c3269332a668763c0889e90;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/io/AbstractXMLObjectMarshaller.h b/xmltooling/io/AbstractXMLObjectMarshaller.h index 82d1621..cbab2fe 100644 --- a/xmltooling/io/AbstractXMLObjectMarshaller.h +++ b/xmltooling/io/AbstractXMLObjectMarshaller.h @@ -40,9 +40,19 @@ namespace xmltooling { public: virtual ~AbstractXMLObjectMarshaller() {} - DOMElement* marshall(DOMDocument* document=NULL, MarshallingContext* ctx=NULL) const; + DOMElement* marshall( + DOMDocument* document=NULL +#ifndef XMLTOOLING_NO_XMLSEC + ,const std::vector* sigs=NULL +#endif + ) const; - DOMElement* marshall(DOMElement* parentElement, MarshallingContext* ctx=NULL) const; + DOMElement* marshall( + DOMElement* parentElement +#ifndef XMLTOOLING_NO_XMLSEC + ,const std::vector* sigs=NULL +#endif + ) const; protected: AbstractXMLObjectMarshaller() {} @@ -57,7 +67,7 @@ namespace xmltooling { void setDocumentElement(DOMDocument* document, DOMElement* element) const { DOMElement* documentRoot = document->getDocumentElement(); if (documentRoot) - document->replaceChild(documentRoot, element); + document->replaceChild(element, documentRoot); else document->appendChild(element); } @@ -72,7 +82,12 @@ namespace xmltooling { * @throws MarshallingException thrown if there is a problem marshalling the object * @throws SignatureException thrown if a problem occurs during signature creation */ - void marshallInto(DOMElement* targetElement, MarshallingContext* ctx) const; + void marshallInto( + DOMElement* targetElement +#ifndef XMLTOOLING_NO_XMLSEC + ,const std::vector* sigs +#endif + ) const; /** * Creates an xsi:type attribute, corresponding to the given type of the XMLObject, on the DOM element. @@ -92,13 +107,13 @@ namespace xmltooling { void marshallNamespaces(DOMElement* domElement) const; /** - * Marshalls the child elements of the XMLObject. + * Marshalls the text content and/or child elements of the XMLObject. * * @param domElement the DOM element that will recieved the marshalled children * * @throws MarshallingException thrown if there is a problem marshalling a child element */ - void marshallChildElements(DOMElement* domElement) const; + void marshallContent(DOMElement* domElement) const; /** * Marshalls the attributes from the XMLObject into the given DOM element. @@ -107,14 +122,7 @@ namespace xmltooling { * * @throws MarshallingException thrown if there is a problem marshalling an attribute */ - virtual void marshallAttributes(DOMElement* domElement) const=0; - - /** - * Marshalls data from the XMLObject into content of the DOM Element. - * - * @param domElement the DOM element recieving the content - */ - virtual void marshallElementContent(DOMElement* domElement) const=0; + virtual void marshallAttributes(DOMElement* domElement) const {} }; };