A factory interface for obtaining an XMLObject.
More...
#include <xmltooling/XMLObjectBuilder.h>
A factory interface for obtaining an XMLObject.
◆ buildFromDocument()
| XMLObject * xmltooling::XMLObjectBuilder::buildFromDocument |
( |
xercesc::DOMDocument * | doc, |
|
|
bool | bindDocument = true ) const |
Creates an unmarshalled XMLObject from the root of a DOM Document.
The caller is responsible for freeing the resulting object.
- Parameters
-
| doc | the unmarshalling source |
| bindDocument | true iff the XMLObject should take ownership of the DOM Document |
- Returns
- the unmarshalled XMLObject
◆ buildFromElement()
| XMLObject * xmltooling::XMLObjectBuilder::buildFromElement |
( |
xercesc::DOMElement * | element, |
|
|
bool | bindDocument = false ) const |
Creates an unmarshalled XMLObject from a DOM Element.
The caller is responsible for freeing the resulting object.
- Parameters
-
| element | the unmarshalling source |
| bindDocument | true iff the XMLObject should take ownership of the DOM Document |
- Returns
- the unmarshalled XMLObject
◆ buildFromQName()
| XMLObject * xmltooling::XMLObjectBuilder::buildFromQName |
( |
const QName & | q | ) |
const |
Creates an empty XMLObject with a particular element name.
The caller is responsible for freeing the resulting object.
- Parameters
-
| q | QName of element for object |
- Returns
- the empty XMLObject
◆ buildObject()
| virtual XMLObject * xmltooling::XMLObjectBuilder::buildObject |
( |
const XMLCh * | nsURI, |
|
|
const XMLCh * | localName, |
|
|
const XMLCh * | prefix = 0, |
|
|
const QName * | schemaType = 0 ) const |
|
pure virtual |
◆ buildOneFromElement()
| XMLObject * xmltooling::XMLObjectBuilder::buildOneFromElement |
( |
xercesc::DOMElement * | element, |
|
|
bool | bindDocument = false ) |
|
static |
Creates an unmarshalled XMLObject using the default build method, if a builder can be found.
The caller is responsible for freeing the resulting object.
- Parameters
-
| element | the unmarshalling source |
| bindDocument | true iff the new XMLObject should take ownership of the DOM Document |
- Returns
- the unmarshalled object or nullptr if no builder is available
◆ deregisterBuilder()
| void xmltooling::XMLObjectBuilder::deregisterBuilder |
( |
const QName & | builderKey | ) |
|
|
static |
Deregisters a builder.
- Parameters
-
| builderKey | the key for the builder to be deregistered |
◆ getBuilder() [1/2]
Retrieves an XMLObjectBuilder using the key it was registered with.
- Parameters
-
| key | the key used to register the builder |
- Returns
- the builder or nullptr
◆ getBuilder() [2/2]
| const XMLObjectBuilder * xmltooling::XMLObjectBuilder::getBuilder |
( |
const xercesc::DOMElement * | element | ) |
|
|
static |
Retrieves an XMLObjectBuilder for a given DOM element.
If no match is found, the default builder is returned, if any.
- Parameters
-
| element | the element for which to locate a builder |
- Returns
- the builder or nullptr
◆ getBuilders()
Gets an immutable list of all the builders currently registered.
- Returns
- list of all the builders currently registered
◆ getDefaultBuilder()
Retrieves the default XMLObjectBuilder for DOM elements.
- Returns
- the default builder or nullptr
◆ registerBuilder()
| void xmltooling::XMLObjectBuilder::registerBuilder |
( |
const QName & | builderKey, |
|
|
XMLObjectBuilder * | builder ) |
|
static |
Registers a new builder for the given key.
- Parameters
-
| builderKey | the key used to retrieve this builder later |
| builder | the builder |
◆ registerDefaultBuilder()
| void xmltooling::XMLObjectBuilder::registerDefaultBuilder |
( |
XMLObjectBuilder * | builder | ) |
|
|
static |
Registers a default builder.
- Parameters
-
| builder | the default builder |
The documentation for this class was generated from the following file: