xmltooling  1.4.2
xmltooling::AbstractXMLObjectUnmarshaller Class Reference

A mix-in to implement object unmarshalling. More...

#include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>

Inheritance diagram for xmltooling::AbstractXMLObjectUnmarshaller:
Collaboration diagram for xmltooling::AbstractXMLObjectUnmarshaller:

List of all members.

Public Member Functions

XMLObjectunmarshall (xercesc::DOMElement *element, bool bindDocument=false)
 Unmarshalls the given W3C DOM element into the XMLObject.
- Public Member Functions inherited from xmltooling::AbstractXMLObject
void detach ()
 Specialized function for detaching a child object from its parent while disposing of the parent.
const QNamegetElementQName () const
 Gets the QName for this element.
const std::set< Namespace > & getNamespaces () const
 Gets the namespaces that are scoped to this element.
void addNamespace (const Namespace &ns) const
 Adds a namespace to the ones already scoped to this element.
void removeNamespace (const Namespace &ns)
 Removes a namespace from this element.
const QNamegetSchemaType () const
 Gets the XML schema type of this element.
const XMLCh * getXMLID () const
 Gets the value of the ID attribute set on this object, if any.
xmlconstants::xmltooling_bool_t getNil () const
 Returns the xsi:nil property as an explicit enumerated value.
void nil (xmlconstants::xmltooling_bool_t value)
 Sets the xsi:nil property using an enumerated value.
bool hasParent () const
 Checks to see if this object has a parent.
XMLObjectgetParent () const
 Gets the parent of this element or null if there is no parent.
void setParent (XMLObject *parent)
 Sets the parent of this element.
- Public Member Functions inherited from xmltooling::XMLObject
virtual XMLObjectclone () const =0
 Creates a copy of the object, along with all of its children.
bool nil () const
 Returns the xsi:nil property of the object, or false if not set.
void nil (bool value)
 Sets the xsi:nil property.
void setNil (const XMLCh *value)
 Sets the xsi:nil property using a string constant.
virtual bool hasChildren () const =0
 Checks if this XMLObject has children.
virtual const std::list
< XMLObject * > & 
getOrderedChildren () const =0
 Returns an unmodifiable list of child objects in the order that they should appear in the serialized representation.
virtual void removeChild (XMLObject *child)=0
 Used by a child's detach method to isolate the child from this parent object in preparation for destroying the parent (this object).
virtual const XMLCh * getTextContent (unsigned int position=0) const =0
 Returns the text content at the specified position relative to any child elements.
virtual void setTextContent (const XMLCh *value, unsigned int position=0)=0
 Sets (or clears) text content relative to a child element's position.
virtual xercesc::DOMElement * getDOM () const =0
 Gets the DOM representation of this XMLObject, if one exists.
virtual void setDOM (xercesc::DOMElement *dom, bool bindDocument=false) const =0
 Sets the DOM representation of this XMLObject.
virtual void setDocument (xercesc::DOMDocument *doc) const =0
 Assigns ownership of a DOM document to the XMLObject.
virtual void releaseDOM () const =0
 Releases the DOM representation of this XMLObject, if there is one.
virtual void releaseParentDOM (bool propagateRelease=true) const =0
 Releases the DOM representation of this XMLObject's parent.
virtual void releaseChildrenDOM (bool propagateRelease=true) const =0
 Releases the DOM representation of this XMLObject's children.
void releaseThisandParentDOM () const
 A convenience method that is equal to calling releaseDOM() then releaseParentDOM(true).
void releaseThisAndChildrenDOM () const
 A convenience method that is equal to calling releaseChildrenDOM(true) then releaseDOM().
virtual xercesc::DOMElement * marshall (xercesc::DOMDocument *document=0, const std::vector< xmlsignature::Signature * > *sigs=0, const Credential *credential=0) const =0
 Marshalls the XMLObject, and its children, into a DOM element.
virtual xercesc::DOMElement * marshall (xercesc::DOMElement *parentElement, const std::vector< xmlsignature::Signature * > *sigs=0, const Credential *credential=0) const =0
 Marshalls the XMLObject and appends it as a child of the given parent element.

Protected Member Functions

virtual void unmarshallAttributes (const xercesc::DOMElement *domElement)
 Unmarshalls the attributes from the given DOM Element into the XMLObject.
virtual void unmarshallContent (const xercesc::DOMElement *domElement)
 Unmarshalls a given Element's child nodes.
virtual void processChildElement (XMLObject *child, const xercesc::DOMElement *childRoot)
 Called after a child element has been unmarshalled so that it can be added to the parent XMLObject.
virtual void processAttribute (const xercesc::DOMAttr *attribute)
 Called after an attribute has been unmarshalled so that it can be added to the XMLObject.
- Protected Member Functions inherited from xmltooling::AbstractXMLObject
 AbstractXMLObject (const XMLCh *nsURI=0, const XMLCh *localName=0, const XMLCh *prefix=0, const QName *schemaType=0)
 Constructor.
 AbstractXMLObject (const AbstractXMLObject &src)
 Copy constructor.
XMLCh * prepareForAssignment (XMLCh *oldValue, const XMLCh *newValue)
 A helper function for derived classes, for assignment of strings.
DateTimeprepareForAssignment (DateTime *oldValue, const DateTime *newValue)
 A helper function for derived classes, for assignment of date/time data.
DateTimeprepareForAssignment (DateTime *oldValue, time_t newValue, bool duration=false)
 A helper function for derived classes, for assignment of date/time data.
DateTimeprepareForAssignment (DateTime *oldValue, const XMLCh *newValue, bool duration=false)
 A helper function for derived classes, for assignment of date/time data.
QNameprepareForAssignment (QName *oldValue, const QName *newValue)
 A helper function for derived classes, for assignment of QName data.
XMLObjectprepareForAssignment (XMLObject *oldValue, XMLObject *newValue)
 A helper function for derived classes, for assignment of (singleton) XML objects.

Additional Inherited Members

- Protected Attributes inherited from xmltooling::AbstractXMLObject
std::set< Namespacem_namespaces
 Set of namespaces associated with the object.
logging::Category & m_log
 Logging object.
XMLCh * m_schemaLocation
 Stores off xsi:schemaLocation attribute.
XMLCh * m_noNamespaceSchemaLocation
 Stores off xsi:noNamespaceSchemaLocation attribute.
xmlconstants::xmltooling_bool_t m_nil
 Stores off xsi:nil attribute.

Detailed Description

A mix-in to implement object unmarshalling.


Member Function Documentation

virtual void xmltooling::AbstractXMLObjectUnmarshaller::processAttribute ( const xercesc::DOMAttr *  attribute)
protectedvirtual

Called after an attribute has been unmarshalled so that it can be added to the XMLObject.

Parameters:
attributethe attribute being unmarshalled
Exceptions:
UnmarshallingExceptionthrown if there is a problem adding the attribute to the XMLObject
virtual void xmltooling::AbstractXMLObjectUnmarshaller::processChildElement ( XMLObject child,
const xercesc::DOMElement *  childRoot 
)
protectedvirtual

Called after a child element has been unmarshalled so that it can be added to the parent XMLObject.

Parameters:
childpointer to the child XMLObject
childRootroot element of the child (must not be stored, just a hint)
Exceptions:
UnmarshallingExceptionthrown if there is a problem adding the child to the parent
XMLObject* xmltooling::AbstractXMLObjectUnmarshaller::unmarshall ( xercesc::DOMElement *  element,
bool  bindDocument = false 
)
virtual

Unmarshalls the given W3C DOM element into the XMLObject.

The root of a given XML construct should be unmarshalled with the bindDocument parameter set to true.

Parameters:
elementthe DOM element to unmarshall
bindDocumenttrue iff the resulting XMLObject should take ownership of the DOM's Document
Returns:
the unmarshalled XMLObject
Exceptions:
UnmarshallingExceptionthrown if an error occurs unmarshalling the DOM element into the XMLObject

Implements xmltooling::XMLObject.

virtual void xmltooling::AbstractXMLObjectUnmarshaller::unmarshallAttributes ( const xercesc::DOMElement *  domElement)
protectedvirtual

Unmarshalls the attributes from the given DOM Element into the XMLObject.

If the attribute is an XML namespace declaration the namespace is added via XMLObject::addNamespace(). If it is a schema type (xsi:type) the schema type is added via XMLObject::setSchemaType(). All other attributes are passed to the processAttribute hook.

Parameters:
domElementthe DOM Element whose attributes will be unmarshalled
Exceptions:
UnmarshallingExceptionthrown if there is a problem unmarshalling an attribute
virtual void xmltooling::AbstractXMLObjectUnmarshaller::unmarshallContent ( const xercesc::DOMElement *  domElement)
protectedvirtual

Unmarshalls a given Element's child nodes.

The resulting XMLObject children and content are passed to processChildElement() or processText() for further processing.

Parameters:
domElementthe DOM Element whose children will be unmarshalled
Exceptions:
UnmarshallingExceptionthrown if an error occurs unmarshalling the child elements

The documentation for this class was generated from the following file: