#include <parser/debug_validator/Debug_Element_Builder.h>
Inheritance diagram for ACEXML_Debug_Element_Builder:


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_ |
Definition at line 32 of file Debug_Element_Builder.h.
|
|
Definition at line 6 of file Debug_Element_Builder.cpp.
|
|
|
Definition at line 12 of file Debug_Element_Builder.cpp.
00013 {
00014 delete this->root_;
00015 }
|
|
|
Dump the content of the attribute definition. Implements ACEXML_Element_Def_Builder. Definition at line 120 of file Debug_Element_Builder.cpp. References element_.
00121 {
00122 cout << "<!ELEMENT " << this->element_;
00123
00124 // @@ Also dump element contentspec here.
00125 switch (this->type_)
00126 {
00127 case EMPTY:
00128 cout << "EMPTY";
00129 break;
00130 case ANY:
00131 cout << "ANY";
00132 break;
00133 case MIXED:
00134 case CHILDREN:
00135 // @@ Dump the content of this->root_
00136 cout << "*** not implemented ***";
00137 break;
00138 default:
00139 cout << "*** Unidentified element type ***";
00140 break;
00141 }
00142
00143 cout << ">" << endl;
00144 }
|
|
|
End a new group of children.
Implements ACEXML_Element_Def_Builder. |
|
||||||||||||||||
|
Insert an new element into the current child group.
Implements ACEXML_Element_Def_Builder. Definition at line 105 of file Debug_Element_Builder.cpp. References ACE_NEW_RETURN, ACEXML_Char, active_list_, ACEXML_Element_Tree_List_Node::insert(), and ACEXML_Element_Tree_List_Stack::top().
00108 {
00109 ACEXML_Element_Tree_Name_Node *node;
00110
00111 // @@ We should "throw" an exception here instead of returning -1.
00112 ACE_NEW_RETURN (node,
00113 ACEXML_Element_Tree_Name_Node (qName),
00114 -1);
00115
00116 return this->active_list_.top ()->insert (node);
00117 }
|
|
||||||||||||||||
|
Insert one more element into Mixed definition. Implements ACEXML_Element_Def_Builder. Definition at line 39 of file Debug_Element_Builder.cpp. References ACE_NEW_RETURN, ACEXML_Char, and ACEXML_Element_Tree_List_Node::insert().
00042 {
00043 ACEXML_Element_Tree_Name_Node *node;
00044
00045 // @@ We should "throw" an exception here instead of returning -1.
00046 ACE_NEW_RETURN (node,
00047 ACEXML_Element_Tree_Name_Node (qName),
00048 -1);
00049
00050 if (this->root_ == 0)
00051 // @@ Memory leak if fail?
00052 ACE_NEW_RETURN (this->root_,
00053 ACEXML_Element_Tree_List_Node (),
00054 -1);
00055
00056
00057 return this->root_->insert (node);
00058 }
|
|
|
Set the type of current child group to Choice.
Implements ACEXML_Element_Def_Builder. Definition at line 91 of file Debug_Element_Builder.cpp. References active_list_, ACEXML_Element_Tree_List_Node::set(), and ACEXML_Element_Tree_List_Stack::top().
00092 {
00093 this->active_list_.top ()->set (ACEXML_Element_Tree_List_Node::CHOICE);
00094 return 0;
00095 }
|
|
|
Define the content type of the element.
Implements ACEXML_Element_Def_Builder. Definition at line 27 of file Debug_Element_Builder.cpp. References ACE_TEXT, and ACEXML_THROW_RETURN.
00028 {
00029 if (this->type_ == UNDEFINED)
00030 {
00031 this->type_ = type;
00032 return 0;
00033 }
00034
00035 ACEXML_THROW_RETURN (ACEXML_SAXParseException (ACE_TEXT("Element type redefinition in Debug_Validator.")), -1);
00036 }
|
|
||||||||||||||||
|
Define the name of the element.
Implements ACEXML_Element_Def_Builder. Definition at line 18 of file Debug_Element_Builder.cpp. References ACEXML_Char, and element_.
00021 {
00022 this->element_.set (qName, 0);
00023 return 0;
00024 }
|
|
|
Set the type of current child group to Sequence.
Implements ACEXML_Element_Def_Builder. Definition at line 98 of file Debug_Element_Builder.cpp. References active_list_, ACEXML_Element_Tree_List_Node::set(), and ACEXML_Element_Tree_List_Stack::top().
00099 {
00100 this->active_list_.top ()->set (ACEXML_Element_Tree_List_Node::SEQUENCE);
00101 return 0;
00102 }
|
|
|
Start a new group of children. Implements ACEXML_Element_Def_Builder. Definition at line 61 of file Debug_Element_Builder.cpp. References ACE_NEW_RETURN, active_list_, ACEXML_Element_Tree_List_Node::insert(), and ACEXML_Element_Tree_List_Stack::push().
00062 {
00063 ACEXML_Element_Tree_List_Node *lnode;
00064
00065 ACE_NEW_RETURN (lnode,
00066 ACEXML_Element_Tree_List_Node (),
00067 -1);
00068
00069 if (this->root_ == 0)
00070 {
00071 this->root_ = lnode;
00072 }
00073 else
00074 {
00075 // @@ check error?
00076 this->root_->insert (lnode);
00077 }
00078
00079 this->active_list_.push (lnode);
00080 return 0;
00081 }
|
|
|
Definition at line 117 of file Debug_Element_Builder.h. Referenced by insertElement(), setChoice(), setSequence(), and startChildGroup(). |
|
|
Definition at line 113 of file Debug_Element_Builder.h. Referenced by dump(), and setElementName(). |
|
|
Definition at line 115 of file Debug_Element_Builder.h. |
|
|
Definition at line 111 of file Debug_Element_Builder.h. |
1.3.6