xmltooling 3.2.4

Public Member Functions | Protected Member Functions | List of all members
xmltooling::AbstractAttributeExtensibleXMLObject Class Reference

AbstractXMLObject mixin that implements AttributeExtensibleXMLObject. More...

`#include <xmltooling/AbstractAttributeExtensibleXMLObject.h>`

Inheritance diagram for xmltooling::AbstractAttributeExtensibleXMLObject:
[legend]
Collaboration diagram for xmltooling::AbstractAttributeExtensibleXMLObject:
[legend]

## Public Member Functions
const XMLCh * | getAttribute (const QName &qualifiedName) const
| Gets the value of an XML attribute of the object.
void | setAttribute (const QName &qualifiedName, const XMLCh *value, bool ID=false)
| Sets (or clears) an XML attribute of the object.
const std::map< QName, XMLCh * > & | getExtensionAttributes () const
| Gets an immutable map of the extended XML attributes of the object.
const XMLCh * | getXMLID () const
| Gets the value of the ID attribute set on this object, if any.
const XMLCh * | getLang () const
| Returns the xml:lang property of the object, if any.
Public Member Functions inherited from xmltooling::AttributeExtensibleXMLObject
virtual void | setAttribute (const QName &qualifiedName, const QName &value)
| Sets a QName-valued XML attribute of the object.
Public Member Functions inherited from xmltooling::XMLObject
virtual XMLObject * | clone () 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.
virtual XMLObject * | unmarshall (xercesc::DOMElement *element, bool bindDocument=false)=0
| 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 QName & | getElementQName () 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 QName * | getSchemaType () 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.
XMLObject * | getParent () const
| Gets the parent of this element or null if there is no parent.
void | setParent (XMLObject *parent)
| Sets the parent of this element.

## Protected Member Functions
| AbstractAttributeExtensibleXMLObject (const AbstractAttributeExtensibleXMLObject &src)
| Copy constructor.
void | unmarshallExtensionAttribute (const xercesc::DOMAttr *attribute)
| Assists in the unmarshalling of extension attributes.
void | marshallExtensionAttributes (xercesc::DOMElement *domElement) const
| Assists in the marshalling of extension attributes.
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.
xercesc::XMLDateTime * | prepareForAssignment (xercesc::XMLDateTime *oldValue, const xercesc::XMLDateTime *newValue)
| A helper function for derived classes, for assignment of date/time data.
xercesc::XMLDateTime * | prepareForAssignment (xercesc::XMLDateTime *oldValue, time_t newValue, bool duration=false)
| A helper function for derived classes, for assignment of date/time data.
xercesc::XMLDateTime * | prepareForAssignment (xercesc::XMLDateTime *oldValue, const XMLCh *newValue, bool duration=false)
| A helper function for derived classes, for assignment of date/time data.
QName * | prepareForAssignment (QName *oldValue, const QName *newValue)
| A helper function for derived classes, for assignment of QName data.
XMLObject * | prepareForAssignment (XMLObject *oldValue, XMLObject *newValue)
| A helper function for derived classes, for assignment of (singleton) XML objects.

## Additional Inherited Members
Static Public Member Functions inherited from xmltooling::AttributeExtensibleXMLObject
static const std::set< QName > & | getRegisteredIDAttributes ()
| Gets an immutable list of all the ID attributes currently registered.
static bool | isRegisteredIDAttribute (const QName &name)
| Tests whether an XML attribute is registered as an XML ID.
static void | registerIDAttribute (const QName &name)
| Registers a new attribute as being of XML ID type.
static void | deregisterIDAttribute (const QName &name)
| Deregisters an ID attribute.
static void | deregisterIDAttributes ()
| Deregisters all ID attributes.
Protected Attributes inherited from xmltooling::AbstractXMLObject
std::set< Namespace > | m_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

AbstractXMLObject mixin that implements AttributeExtensibleXMLObject.

Inherit from this class to add support for attribute wildcarding.

## Member Function Documentation

## ◆ getAttribute()

const XMLCh * xmltooling::AbstractAttributeExtensibleXMLObject::getAttribute | ( | const QName & | qualifiedName | ) | const
| virtual

Gets the value of an XML attribute of the object.

Parameters

  qualifiedName | qualified name of the attribute

Returns
  the attribute value, or nullptr

Implements xmltooling::AttributeExtensibleXMLObject.

## ◆ getExtensionAttributes()

const std::map< QName, XMLCh * > & xmltooling::AbstractAttributeExtensibleXMLObject::getExtensionAttributes | ( |  | ) | const
| virtual

Gets an immutable map of the extended XML attributes of the object.

This set is not guaranteed to (and generally will not) include attributes defined directly on the object's "type".

Implements xmltooling::AttributeExtensibleXMLObject.

## ◆ getLang()

const XMLCh * xmltooling::AbstractAttributeExtensibleXMLObject::getLang | ( |  | ) | const
| virtual

Returns the xml:lang property of the object, if any.

Returns
  an xml:lang value, or nullptr

Reimplemented from xmltooling::XMLObject.

## ◆ getXMLID()

const XMLCh * xmltooling::AbstractAttributeExtensibleXMLObject::getXMLID | ( |  | ) | const
| virtual

Gets the value of the ID attribute set on this object, if any.

Returns
  an ID value or nullptr

Implements xmltooling::XMLObject.

## ◆ marshallExtensionAttributes()

void xmltooling::AbstractAttributeExtensibleXMLObject::marshallExtensionAttributes | ( | xercesc::DOMElement * | domElement | ) | const
| protected

Assists in the marshalling of extension attributes.

Parameters

  domElement | the DOM element against which to marshall the attributes

## ◆ setAttribute()

void xmltooling::AbstractAttributeExtensibleXMLObject::setAttribute | ( | const QName & | qualifiedName,
|  | const XMLCh * | value,
|  | bool | ID = false )
| virtual

Sets (or clears) an XML attribute of the object.

Parameters

  qualifiedName | qualified name of the attribute
  value | value to set, or nullptr to clear
  ID | true iff the attribute is an XML ID

Implements xmltooling::AttributeExtensibleXMLObject.

## ◆ unmarshallExtensionAttribute()

void xmltooling::AbstractAttributeExtensibleXMLObject::unmarshallExtensionAttribute | ( | const xercesc::DOMAttr * | attribute | ) |
| protected

Assists in the unmarshalling of extension attributes.

Parameters

  attribute | the DOM attribute node being unmarshalled

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

- xmltooling/AbstractAttributeExtensibleXMLObject.h