xmltooling
3.0.1
|
Object that represents an XML Element that has been unmarshalled into this C++ object. More...
#include <xmltooling/XMLObject.h>
Public Member Functions | |
virtual XMLObject * | clone () const =0 |
Creates a copy of the object, along with all of its children. More... | |
virtual void | detach ()=0 |
Specialized function for detaching a child object from its parent while disposing of the parent. More... | |
virtual const QName & | getElementQName () const =0 |
Gets the QName for this element. More... | |
virtual const std::set < Namespace > & | getNamespaces () const =0 |
Gets the namespaces that are scoped to this element. More... | |
virtual void | addNamespace (const Namespace &ns) const =0 |
Adds a namespace to the ones already scoped to this element. More... | |
virtual void | removeNamespace (const Namespace &ns)=0 |
Removes a namespace from this element. More... | |
virtual const QName * | getSchemaType () const =0 |
Gets the XML schema type of this element. More... | |
virtual const XMLCh * | getXMLID () const =0 |
Gets the value of the ID attribute set on this object, if any. More... | |
virtual const XMLCh * | getLang () const |
Returns the xml:lang property of the object, if any. More... | |
bool | nil () const |
Returns the xsi:nil property of the object, or false if not set. More... | |
virtual xmlconstants::xmltooling_bool_t | getNil () const =0 |
Returns the xsi:nil property as an explicit enumerated value. More... | |
virtual void | nil (xmlconstants::xmltooling_bool_t value)=0 |
Sets the xsi:nil property using an enumerated value. More... | |
void | nil (bool value) |
Sets the xsi:nil property. More... | |
void | setNil (const XMLCh *value) |
Sets the xsi:nil property using a string constant. More... | |
virtual bool | hasParent () const =0 |
Checks to see if this object has a parent. More... | |
virtual XMLObject * | getParent () const =0 |
Gets the parent of this element or null if there is no parent. More... | |
virtual void | setParent (XMLObject *parent)=0 |
Sets the parent of this element. More... | |
virtual bool | hasChildren () const =0 |
Checks if this XMLObject has children. More... | |
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. More... | |
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). More... | |
virtual const XMLCh * | getTextContent (unsigned int position=0) const =0 |
Returns the text content at the specified position relative to any child elements. More... | |
virtual void | setTextContent (const XMLCh *value, unsigned int position=0)=0 |
Sets (or clears) text content relative to a child element's position. More... | |
virtual xercesc::DOMElement * | getDOM () const =0 |
Gets the DOM representation of this XMLObject, if one exists. More... | |
virtual void | setDOM (xercesc::DOMElement *dom, bool bindDocument=false) const =0 |
Sets the DOM representation of this XMLObject. More... | |
virtual void | setDocument (xercesc::DOMDocument *doc) const =0 |
Assigns ownership of a DOM document to the XMLObject. More... | |
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. More... | |
virtual void | releaseChildrenDOM (bool propagateRelease=true) const =0 |
Releases the DOM representation of this XMLObject's children. More... | |
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. More... | |
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. More... | |
virtual XMLObject * | unmarshall (xercesc::DOMElement *element, bool bindDocument=false)=0 |
Unmarshalls the given W3C DOM element into the XMLObject. More... | |
Object that represents an XML Element that has been unmarshalled into this C++ object.
|
pure virtual |
Adds a namespace to the ones already scoped to this element.
ns | the namespace to add |
Implemented in xmltooling::AbstractXMLObject.
|
pure 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.
Implemented in xmltooling::AbstractDOMCachingXMLObject.
|
pure 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.
Implemented in xmltooling::AbstractXMLObject, and xmltooling::AbstractDOMCachingXMLObject.
|
pure virtual |
Gets the DOM representation of this XMLObject, if one exists.
Implemented in xmltooling::AbstractDOMCachingXMLObject.
|
pure virtual |
Gets the QName for this element.
This QName MUST contain the namespace URI, namespace prefix, and local element name.
Implemented in xmltooling::AbstractXMLObject.
|
virtual |
Returns the xml:lang property of the object, if any.
Reimplemented in xmltooling::AbstractAttributeExtensibleXMLObject.
|
pure virtual |
Gets the namespaces that are scoped to this element.
The caller MUST NOT modify the set returned, but may use any non-modifying operations or algorithms on it. Iterators will remain valid unless the set member referenced is removed using the removeNamespace method.
Implemented in xmltooling::AbstractXMLObject.
|
pure virtual |
Returns the xsi:nil property as an explicit enumerated value.
Implemented in xmltooling::AbstractXMLObject.
|
pure virtual |
Returns an unmodifiable list of child objects in the order that they should appear in the serialized representation.
The validity of the returned list is not maintained if any non-const operations are performed on the parent object.
Implemented in xmltooling::AbstractComplexElement, and xmltooling::AbstractSimpleElement.
|
pure virtual |
Gets the parent of this element or null if there is no parent.
Implemented in xmltooling::AbstractXMLObject.
|
pure virtual |
Gets the XML schema type of this element.
This translates to contents the xsi:type attribute for the element.
Implemented in xmltooling::AbstractXMLObject.
|
pure virtual |
Returns the text content at the specified position relative to any child elements.
A zero represents leading text, 1 comes after the first child, and so forth.
position | the relative child element position of the text |
Implemented in xmltooling::AbstractComplexElement, and xmltooling::AbstractSimpleElement.
|
pure virtual |
Gets the value of the ID attribute set on this object, if any.
Implemented in xmltooling::AbstractXMLObject, and xmltooling::AbstractAttributeExtensibleXMLObject.
|
pure virtual |
Checks if this XMLObject has children.
Implemented in xmltooling::AbstractComplexElement, and xmltooling::AbstractSimpleElement.
|
pure virtual |
Checks to see if this object has a parent.
Implemented in xmltooling::AbstractXMLObject.
|
pure virtual |
Marshalls the XMLObject, and its children, into a DOM element.
If a document is supplied, then it will be used to create the resulting elements. If the document does not have a Document Element set, then the resulting element will be set as the Document Element. If no document is supplied, then a new document will be created and bound to the lifetime of the root object being marshalled, unless an existing DOM can be reused without creating a new document.
document | the DOM document the marshalled element will be placed in, or nullptr |
sigs | ordered array of signatures to create after marshalling is complete |
credential | optional credential to supply signing key and related info |
MarshallingException | thrown if there is a problem marshalling the given object |
SignatureException | thrown if a problem occurs during signature creation |
Implemented in xmltooling::AbstractXMLObjectMarshaller.
|
pure virtual |
Marshalls the XMLObject and appends it as a child of the given parent element.
NOTE: The given Element must be within a DOM tree rooted in the Document owning the given Element.
parentElement | the parent element to append the resulting DOM tree |
sigs | ordered array of signatures to create after marshalling is complete |
credential | optional credential to supply signing key and related info |
MarshallingException | thrown if the given XMLObject can not be marshalled. |
SignatureException | thrown if a problem occurs during signature creation |
Implemented in xmltooling::AbstractXMLObjectMarshaller.
|
inline |
Returns the xsi:nil property of the object, or false if not set.
|
pure virtual |
Sets the xsi:nil property using an enumerated value.
value | value to set |
Implemented in xmltooling::AbstractXMLObject.
|
inline |
Sets the xsi:nil property.
value | value to set |
|
pure virtual |
Releases the DOM representation of this XMLObject's children.
propagateRelease | true if all descendants of this element should release their DOM |
Implemented in xmltooling::AbstractDOMCachingXMLObject.
|
pure virtual |
Releases the DOM representation of this XMLObject's parent.
propagateRelease | true if all ancestors of this element should release their DOM |
Implemented in xmltooling::AbstractDOMCachingXMLObject.
|
pure virtual |
Used by a child's detach method to isolate the child from this parent object in preparation for destroying the parent (this object).
child | the child object to remove |
Implemented in xmltooling::AbstractComplexElement, and xmltooling::AbstractSimpleElement.
|
pure virtual |
Removes a namespace from this element.
ns | the namespace to remove |
Implemented in xmltooling::AbstractXMLObject.
|
pure virtual |
Assigns ownership of a DOM document to the XMLObject.
This binds the lifetime of the document to the lifetime of the object.
doc | DOM document bound to this object |
Implemented in xmltooling::AbstractDOMCachingXMLObject.
|
pure virtual |
Sets the DOM representation of this XMLObject.
dom | DOM representation of this XMLObject |
bindDocument | true if the object should take ownership of the associated Document |
Implemented in xmltooling::AbstractDOMCachingXMLObject.
void xmltooling::XMLObject::setNil | ( | const XMLCh * | value | ) |
Sets the xsi:nil property using a string constant.
value | value to set |
|
pure virtual |
Sets the parent of this element.
parent | the parent of this element |
Implemented in xmltooling::AbstractXMLObject.
|
pure virtual |
Sets (or clears) text content relative to a child element's position.
value | value to set, or nullptr to clear |
position | position relative to child element |
Implemented in xmltooling::AbstractComplexElement, and xmltooling::AbstractSimpleElement.
|
pure 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.
element | the DOM element to unmarshall |
bindDocument | true iff the resulting XMLObject should take ownership of the DOM's Document |
UnmarshallingException | thrown if an error occurs unmarshalling the DOM element into the XMLObject |
Implemented in xmltooling::AbstractXMLObjectUnmarshaller.