xmltooling::AbstractDOMCachingXMLObject Class Reference

AbstractXMLObject mixin that implements DOM caching. More...

#include <xmltooling/AbstractDOMCachingXMLObject.h>

Inheritance diagram for xmltooling::AbstractDOMCachingXMLObject:
xmltooling::AbstractXMLObject xmltooling::XMLObject

List of all members.

Public Member Functions

xercesc::DOMElement * getDOM () const
 Gets the DOM representation of this XMLObject, if one exists.
void setDOM (xercesc::DOMElement *dom, bool bindDocument=false) const
 Sets the DOM representation of this XMLObject.
void setDocument (xercesc::DOMDocument *doc) const
 Assigns ownership of a DOM document to the XMLObject.
void releaseDOM () const
 Releases the DOM representation of this XMLObject, if there is one.
void releaseParentDOM (bool propagateRelease=true) const
 Releases the DOM representation of this XMLObject's parent.
void releaseChildrenDOM (bool propagateRelease=true) const
 Releases the DOM representation of this XMLObject's children.
XMLObjectclone () const
 Creates a copy of the object, along with all of its children.
void detach ()
 Specialized function for detaching a child object from its parent while disposing of the parent.

Protected Member Functions

 AbstractDOMCachingXMLObject (const AbstractDOMCachingXMLObject &src)
 Copy constructor.
xercesc::DOMElement * cloneDOM (xercesc::DOMDocument *doc=nullptr) const
 If a DOM representation exists, this clones it into a new document.

Detailed Description

AbstractXMLObject mixin that implements DOM caching.

Inherit from this class to implement standard DOM caching behavior.


Constructor & Destructor Documentation

xmltooling::AbstractDOMCachingXMLObject::AbstractDOMCachingXMLObject ( const AbstractDOMCachingXMLObject src  )  [protected]

Copy constructor.


Member Function Documentation

XMLObject* xmltooling::AbstractDOMCachingXMLObject::clone (  )  const [virtual]

Creates a copy of the object, along with all of its children.

The new object tree will be completely distinct and independent of the original in all respects.

Implements xmltooling::XMLObject.

xercesc::DOMElement* xmltooling::AbstractDOMCachingXMLObject::cloneDOM ( xercesc::DOMDocument *  doc = nullptr  )  const [protected]

If a DOM representation exists, this clones it into a new document.

Parameters:
doc the document to clone into, or nullptr, in which case a new document is created
Returns:
the cloned DOM
void xmltooling::AbstractDOMCachingXMLObject::detach (  )  [virtual]

Specialized function for detaching a child object from its parent while disposing of the parent.

This is not a generic way of detaching any child object, but only of pruning a single child from the root of an XMLObject tree. If the detached XMLObject's parent is itself a child, an exception will be thrown. It's mainly useful for turning a child into the new root of the tree without having to clone the child.

Reimplemented from xmltooling::AbstractXMLObject.

xercesc::DOMElement* xmltooling::AbstractDOMCachingXMLObject::getDOM (  )  const [virtual]

Gets the DOM representation of this XMLObject, if one exists.

Returns:
the DOM representation of this XMLObject

Implements xmltooling::XMLObject.

void xmltooling::AbstractDOMCachingXMLObject::releaseChildrenDOM ( bool  propagateRelease = true  )  const [virtual]

Releases the DOM representation of this XMLObject's children.

Parameters:
propagateRelease true if all descendants of this element should release their DOM

Implements xmltooling::XMLObject.

void xmltooling::AbstractDOMCachingXMLObject::releaseParentDOM ( bool  propagateRelease = true  )  const [virtual]

Releases the DOM representation of this XMLObject's parent.

Parameters:
propagateRelease true if all ancestors of this element should release their DOM

Implements xmltooling::XMLObject.

void xmltooling::AbstractDOMCachingXMLObject::setDocument ( xercesc::DOMDocument *  doc  )  const [virtual]

Assigns ownership of a DOM document to the XMLObject.

This binds the lifetime of the document to the lifetime of the object.

Parameters:
doc DOM document bound to this object

Implements xmltooling::XMLObject.

void xmltooling::AbstractDOMCachingXMLObject::setDOM ( xercesc::DOMElement *  dom,
bool  bindDocument = false 
) const [virtual]

Sets the DOM representation of this XMLObject.

Parameters:
dom DOM representation of this XMLObject
bindDocument true if the object should take ownership of the associated Document

Implements xmltooling::XMLObject.


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

Generated on 24 Jan 2020 for xmltooling by  doxygen 1.6.1