#include <parser/debug_validator/Debug_Element_Builder.h>
Public Member Functions | |
ACEXML_Debug_Element_Builder () | |
virtual | ~ACEXML_Debug_Element_Builder () |
virtual int | setElementName (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) |
virtual int | setContentType (CONTENT_TYPE type ACEXML_ENV_ARG_DECL) |
virtual int | insertMixedElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) |
virtual int | startChildGroup () |
virtual int | endChildGroup (CARDINALITY card ACEXML_ENV_ARG_DECL) |
virtual int | setChoice () |
virtual int | setSequence () |
virtual int | insertElement (const ACEXML_Char *namespaceURI, const ACEXML_Char *localName, const ACEXML_Char *qName ACEXML_ENV_ARG_DECL) |
virtual void | dump (void) |
Private Attributes | |
CONTENT_TYPE | type_ |
ACEXML_String | element_ |
ACEXML_Element_Tree_List_Node * | root_ |
ACEXML_Element_Tree_List_Stack | active_list_ |
This class prints out the element definition for debugging purpose.
Definition at line 32 of file Debug_Element_Builder.h.
ACEXML_Debug_Element_Builder::ACEXML_Debug_Element_Builder | ( | ) |
Definition at line 6 of file Debug_Element_Builder.cpp.
ACEXML_Debug_Element_Builder::~ACEXML_Debug_Element_Builder | ( | ) | [virtual] |
Definition at line 12 of file Debug_Element_Builder.cpp.
{ delete this->root_; }
void ACEXML_Debug_Element_Builder::dump | ( | void | ) | [virtual] |
Dump the content of the attribute definition.
Implements ACEXML_Element_Def_Builder.
Definition at line 120 of file Debug_Element_Builder.cpp.
{ cout << "<!ELEMENT " << this->element_; // @@ Also dump element contentspec here. switch (this->type_) { case EMPTY: cout << "EMPTY"; break; case ANY: cout << "ANY"; break; case MIXED: case CHILDREN: // @@ Dump the content of this->root_ cout << "*** not implemented ***"; break; default: cout << "*** Unidentified element type ***"; break; } cout << ">" << endl; }
virtual int ACEXML_Debug_Element_Builder::endChildGroup | ( | CARDINALITY card | ACEXML_ENV_ARG_DECL | ) | [virtual] |
int ACEXML_Debug_Element_Builder::insertElement | ( | const ACEXML_Char * | namespaceURI, | |
const ACEXML_Char * | localName, | |||
const ACEXML_Char *qName | ACEXML_ENV_ARG_DECL | |||
) | [virtual] |
Insert an new element into the current child group.
0 | on success, -1 otherwise. |
Implements ACEXML_Element_Def_Builder.
Definition at line 105 of file Debug_Element_Builder.cpp.
{ ACEXML_Element_Tree_Name_Node *node; // @@ We should "throw" an exception here instead of returning -1. ACE_NEW_RETURN (node, ACEXML_Element_Tree_Name_Node (qName), -1); return this->active_list_.top ()->insert (node); }
int ACEXML_Debug_Element_Builder::insertMixedElement | ( | const ACEXML_Char * | namespaceURI, | |
const ACEXML_Char * | localName, | |||
const ACEXML_Char *qName | ACEXML_ENV_ARG_DECL | |||
) | [virtual] |
Insert one more element into Mixed definition.
Implements ACEXML_Element_Def_Builder.
Definition at line 39 of file Debug_Element_Builder.cpp.
{ ACEXML_Element_Tree_Name_Node *node; // @@ We should "throw" an exception here instead of returning -1. ACE_NEW_RETURN (node, ACEXML_Element_Tree_Name_Node (qName), -1); if (this->root_ == 0) // @@ Memory leak if fail? ACE_NEW_RETURN (this->root_, ACEXML_Element_Tree_List_Node (), -1); return this->root_->insert (node); }
int ACEXML_Debug_Element_Builder::setChoice | ( | ) | [virtual] |
Set the type of current child group to Choice.
0 | on success, -1 if the type of the child group has already been set and this action conflicts with the previous setting. |
Implements ACEXML_Element_Def_Builder.
Definition at line 91 of file Debug_Element_Builder.cpp.
{ this->active_list_.top ()->set (ACEXML_Element_Tree_List_Node::CHOICE); return 0; }
int ACEXML_Debug_Element_Builder::setContentType | ( | CONTENT_TYPE type | ACEXML_ENV_ARG_DECL | ) | [virtual] |
Define the content type of the element.
0 | if valid, -1 otherwise. |
Implements ACEXML_Element_Def_Builder.
Definition at line 27 of file Debug_Element_Builder.cpp.
{ if (this->type_ == UNDEFINED) { this->type_ = type; return 0; } ACEXML_THROW_RETURN (ACEXML_SAXParseException (ACE_TEXT("Element type redefinition in Debug_Validator.")), -1); }
int ACEXML_Debug_Element_Builder::setElementName | ( | const ACEXML_Char * | namespaceURI, | |
const ACEXML_Char * | localName, | |||
const ACEXML_Char *qName | ACEXML_ENV_ARG_DECL | |||
) | [virtual] |
Define the name of the element.
0 | if valid, -1 otherwise. |
Implements ACEXML_Element_Def_Builder.
Definition at line 18 of file Debug_Element_Builder.cpp.
int ACEXML_Debug_Element_Builder::setSequence | ( | ) | [virtual] |
Set the type of current child group to Sequence.
0 | on success, -1 if the type of the child group has already been set and this action conflicts with the previous setting. |
Implements ACEXML_Element_Def_Builder.
Definition at line 98 of file Debug_Element_Builder.cpp.
{ this->active_list_.top ()->set (ACEXML_Element_Tree_List_Node::SEQUENCE); return 0; }
int ACEXML_Debug_Element_Builder::startChildGroup | ( | ) | [virtual] |
Start a new group of children.
Implements ACEXML_Element_Def_Builder.
Definition at line 61 of file Debug_Element_Builder.cpp.
{ ACEXML_Element_Tree_List_Node *lnode; ACE_NEW_RETURN (lnode, ACEXML_Element_Tree_List_Node (), -1); if (this->root_ == 0) { this->root_ = lnode; } else { // @@ check error? this->root_->insert (lnode); } this->active_list_.push (lnode); return 0; }
Definition at line 117 of file Debug_Element_Builder.h.
Definition at line 113 of file Debug_Element_Builder.h.
Definition at line 115 of file Debug_Element_Builder.h.
Definition at line 111 of file Debug_Element_Builder.h.