Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
#include <berryExpressionConverter.h>
Public Member Functions | |
ExpressionConverter (const QList< SmartPointer< ElementHandler > > &handlers) | |
SmartPointer< Expression > | Perform (const SmartPointer< IConfigurationElement > &root) |
SmartPointer< Expression > | Perform (Poco::XML::Element *root) |
void | ProcessChildren (const SmartPointer< IConfigurationElement > &element, const SmartPointer< CompositeExpression > &result) |
QString | GetDebugPath (const SmartPointer< IConfigurationElement > &configurationElement) |
void | ProcessChildren (Poco::XML::Element *element, const SmartPointer< CompositeExpression > &result) |
Static Public Member Functions | |
static ExpressionConverter * | GetDefault () |
An expression converter converts an XML expression represented by an IConfigurationElement or Element (DOM) subtree into a corresponding expression tree.
An expression converter manages a list of ElementHandlers. Element handlers are responsible to do the actual conversion. The element handlers build a chain of responsibility.
Definition at line 49 of file berryExpressionConverter.h.
berry::ExpressionConverter::ExpressionConverter | ( | const QList< SmartPointer< ElementHandler > > & | handlers | ) |
Creates a new expression converter with the given list of element handlers. The element handlers build a chain of responsibility meaning that the first handler in the list is first used to convert the configuration element. If this handler isn't able to convert the configuration element the next handler in the array is used.
handlers | the array of element handlers |
Definition at line 48 of file berryExpressionConverter.cpp.
References us::handler, berry::SmartPointer< TObjectType >::IsNull(), and Perform().
Referenced by GetDefault().
QString berry::ExpressionConverter::GetDebugPath | ( | const SmartPointer< IConfigurationElement > & | configurationElement | ) |
Definition at line 100 of file berryExpressionConverter.cpp.
References BERRY_STATUS_LOC, berry::SmartPointer< TObjectType >::Cast(), berry::IStatus::ERROR_TYPE, berry::SmartPointer< TObjectType >::IsNull(), Perform(), and ProcessChildren().
Referenced by Perform().
|
static |
Returns the default expression converter. The default expression converter can cope with all expression elements defined by the common expression language.
Definition at line 37 of file berryExpressionConverter.cpp.
References ExpressionConverter(), and berry::ElementHandler::GetDefault().
SmartPointer<Expression> berry::ExpressionConverter::Perform | ( | const SmartPointer< IConfigurationElement > & | root | ) |
Converts the tree of configuration elements represented by the given root element and returns a corresponding expression tree.
root | the configuration element to be converted |
null
if the configuration element cannot be convertedCoreException | if the configuration element can't be converted. Reasons include: (a) no handler is available to cope with a certain configuration element or (b) the XML expression tree is malformed. |
Referenced by ExpressionConverter(), GetDebugPath(), and Perform().
Expression::Pointer berry::ExpressionConverter::Perform | ( | Poco::XML::Element * | root | ) |
Converts the tree of DOM elements represented by the given root element and returns a corresponding expression tree.
root | the element to be converted |
null
if the element cannot be convertedCoreException | if the element can't be converted. Reasons include: (a) no handler is available to cope with a certain element or (b) the XML expression tree is malformed. |
Definition at line 66 of file berryExpressionConverter.cpp.
References BERRY_STATUS_LOC, berry::IStatus::ERROR_TYPE, GetDebugPath(), us::handler, berry::SmartPointer< TObjectType >::IsNull(), Perform(), and ProcessChildren().
void berry::ExpressionConverter::ProcessChildren | ( | const SmartPointer< IConfigurationElement > & | element, |
const SmartPointer< CompositeExpression > & | result | ||
) |
Referenced by berry::ElementHandler::Create(), GetDebugPath(), and Perform().
void berry::ExpressionConverter::ProcessChildren | ( | Poco::XML::Element * | element, |
const SmartPointer< CompositeExpression > & | result | ||
) |