xmltooling  3.2.0
xmltooling::AttributeExtensibleXMLObject Class Referenceabstract

An XMLObject that supports arbitrary attributes. More...

#include <xmltooling/AttributeExtensibleXMLObject.h>

Inheritance diagram for xmltooling::AttributeExtensibleXMLObject:
Collaboration diagram for xmltooling::AttributeExtensibleXMLObject:

Public Member Functions

virtual const XMLCh * getAttribute (const QName &qualifiedName) const =0
 Gets the value of an XML attribute of the object. More...
 
virtual void setAttribute (const QName &qualifiedName, const XMLCh *value, bool ID=false)=0
 Sets (or clears) an XML attribute of the object. More...
 
virtual void setAttribute (const QName &qualifiedName, const QName &value)
 Sets a QName-valued XML attribute of the object. More...
 
virtual const std::map< QName, XMLCh * > & getExtensionAttributes () const =0
 Gets an immutable map of the extended XML attributes of the object. More...
 
- Public Member Functions inherited from xmltooling::XMLObject
virtual XMLObjectclone () 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 QNamegetElementQName () 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 QNamegetSchemaType () 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 XMLObjectgetParent () 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 XMLObjectunmarshall (xercesc::DOMElement *element, bool bindDocument=false)=0
 Unmarshalls the given W3C DOM element into the XMLObject. More...
 

Static Public Member Functions

static const std::set< QName > & getRegisteredIDAttributes ()
 Gets an immutable list of all the ID attributes currently registered. More...
 
static bool isRegisteredIDAttribute (const QName &name)
 Tests whether an XML attribute is registered as an XML ID. More...
 
static void registerIDAttribute (const QName &name)
 Registers a new attribute as being of XML ID type. More...
 
static void deregisterIDAttribute (const QName &name)
 Deregisters an ID attribute. More...
 
static void deregisterIDAttributes ()
 Deregisters all ID attributes.
 

Detailed Description

An XMLObject that supports arbitrary attributes.

Member Function Documentation

◆ deregisterIDAttribute()

static void xmltooling::AttributeExtensibleXMLObject::deregisterIDAttribute ( const QName name)
static

Deregisters an ID attribute.

Parameters
namethe qualified attribute name

◆ getAttribute()

virtual const XMLCh* xmltooling::AttributeExtensibleXMLObject::getAttribute ( const QName qualifiedName) const
pure virtual

Gets the value of an XML attribute of the object.

Parameters
qualifiedNamequalified name of the attribute
Returns
the attribute value, or nullptr

Implemented in xmltooling::AbstractAttributeExtensibleXMLObject.

◆ getExtensionAttributes()

virtual const std::map<QName,XMLCh*>& xmltooling::AttributeExtensibleXMLObject::getExtensionAttributes ( ) const
pure 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".

Implemented in xmltooling::AbstractAttributeExtensibleXMLObject.

◆ getRegisteredIDAttributes()

static const std::set<QName>& xmltooling::AttributeExtensibleXMLObject::getRegisteredIDAttributes ( )
static

Gets an immutable list of all the ID attributes currently registered.

Returns
list of all the ID attributes currently registered

◆ isRegisteredIDAttribute()

static bool xmltooling::AttributeExtensibleXMLObject::isRegisteredIDAttribute ( const QName name)
static

Tests whether an XML attribute is registered as an XML ID.

Returns
true iff the attribute name matches a registered XML ID attribute

◆ registerIDAttribute()

static void xmltooling::AttributeExtensibleXMLObject::registerIDAttribute ( const QName name)
static

Registers a new attribute as being of XML ID type.

Parameters
namethe qualified attribute name

◆ setAttribute() [1/2]

virtual void xmltooling::AttributeExtensibleXMLObject::setAttribute ( const QName qualifiedName,
const XMLCh *  value,
bool  ID = false 
)
pure virtual

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

Parameters
qualifiedNamequalified name of the attribute
valuevalue to set, or nullptr to clear
IDtrue iff the attribute is an XML ID

Implemented in xmltooling::AbstractAttributeExtensibleXMLObject.

◆ setAttribute() [2/2]

virtual void xmltooling::AttributeExtensibleXMLObject::setAttribute ( const QName qualifiedName,
const QName value 
)
virtual

Sets a QName-valued XML attribute of the object.

Parameters
qualifiedNamequalified name of the attribute
valuevalue to set

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