xmltooling 1.6.2

xmltooling::XMLObjectBuilder Class Reference

A factory interface for obtaining an XMLObject. More...

#include <xmltooling/XMLObjectBuilder.h>

Inheritance diagram for xmltooling::XMLObjectBuilder:
xmltooling::ConcreteXMLObjectBuilder xmltooling::UnknownElementBuilder xmlsignature::SignatureBuilder

List of all members.

Public Member Functions

virtual XMLObjectbuildObject (const XMLCh *nsURI, const XMLCh *localName, const XMLCh *prefix=nullptr, const QName *schemaType=nullptr) const =0
 Creates an empty XMLObject with a particular element name.
XMLObjectbuildFromQName (const QName &q) const
 Creates an empty XMLObject with a particular element name.
XMLObjectbuildFromElement (xercesc::DOMElement *element, bool bindDocument=false) const
 Creates an unmarshalled XMLObject from a DOM Element.
XMLObjectbuildFromDocument (xercesc::DOMDocument *doc, bool bindDocument=true) const
 Creates an unmarshalled XMLObject from the root of a DOM Document.

Static Public Member Functions

static XMLObjectbuildOneFromElement (xercesc::DOMElement *element, bool bindDocument=false)
 Creates an unmarshalled XMLObject using the default build method, if a builder can be found.
static const XMLObjectBuildergetBuilder (const QName &key)
 Retrieves an XMLObjectBuilder using the key it was registered with.
static const XMLObjectBuildergetBuilder (const xercesc::DOMElement *element)
 Retrieves an XMLObjectBuilder for a given DOM element.
static const XMLObjectBuildergetDefaultBuilder ()
 Retrieves the default XMLObjectBuilder for DOM elements.
static const std::map< QName,
XMLObjectBuilder * > & 
getBuilders ()
 Gets an immutable list of all the builders currently registered.
static void registerBuilder (const QName &builderKey, XMLObjectBuilder *builder)
 Registers a new builder for the given key.
static void registerDefaultBuilder (XMLObjectBuilder *builder)
 Registers a default builder.
static void deregisterBuilder (const QName &builderKey)
 Deregisters a builder.
static void deregisterDefaultBuilder ()
 Deregisters default builder.
static void destroyBuilders ()
 Unregisters and destroys all registered builders.

Detailed Description

A factory interface for obtaining an XMLObject.


Member Function Documentation

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:
docthe unmarshalling source
bindDocumenttrue iff the XMLObject should take ownership of the DOM Document
Returns:
the unmarshalled XMLObject
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:
elementthe unmarshalling source
bindDocumenttrue iff the XMLObject should take ownership of the DOM Document
Returns:
the unmarshalled XMLObject
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:
qQName of element for object
Returns:
the empty XMLObject
virtual XMLObject* xmltooling::XMLObjectBuilder::buildObject ( const XMLCh *  nsURI,
const XMLCh *  localName,
const XMLCh *  prefix = nullptr,
const QName schemaType = nullptr 
) const [pure virtual]

Creates an empty XMLObject with a particular element name.

The results are undefined if localName is nullptr or empty.

The caller is responsible for freeing the resulting object.

Parameters:
nsURInamespace URI for element
localNamelocal name of element
prefixprefix of element name
schemaTypexsi:type of the object
Returns:
the empty XMLObject

Implemented in xmltooling::UnknownElementBuilder, and xmlsignature::SignatureBuilder.

static 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:
elementthe unmarshalling source
bindDocumenttrue iff the new XMLObject should take ownership of the DOM Document
Returns:
the unmarshalled object or nullptr if no builder is available
static void xmltooling::XMLObjectBuilder::deregisterBuilder ( const QName builderKey) [static]

Deregisters a builder.

Parameters:
builderKeythe key for the builder to be deregistered
static 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:
elementthe element for which to locate a builder
Returns:
the builder or nullptr
static const XMLObjectBuilder* xmltooling::XMLObjectBuilder::getBuilder ( const QName key) [static]

Retrieves an XMLObjectBuilder using the key it was registered with.

Parameters:
keythe key used to register the builder
Returns:
the builder or nullptr
static const std::map<QName,XMLObjectBuilder*>& xmltooling::XMLObjectBuilder::getBuilders ( ) [static]

Gets an immutable list of all the builders currently registered.

Returns:
list of all the builders currently registered
static const XMLObjectBuilder* xmltooling::XMLObjectBuilder::getDefaultBuilder ( ) [static]

Retrieves the default XMLObjectBuilder for DOM elements.

Returns:
the default builder or nullptr
static void xmltooling::XMLObjectBuilder::registerBuilder ( const QName builderKey,
XMLObjectBuilder builder 
) [static]

Registers a new builder for the given key.

Parameters:
builderKeythe key used to retrieve this builder later
builderthe builder
static void xmltooling::XMLObjectBuilder::registerDefaultBuilder ( XMLObjectBuilder builder) [static]

Registers a default builder.

Parameters:
builderthe default builder

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