3 //=============================================================================
5 * @file Element_Def_Builder.h
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
9 //=============================================================================
10 #ifndef _ACEXML_ELEMENT_DEF_BUILDER_H_
11 #define _ACEXML_ELEMENT_DEF_BUILDER_H_
13 #include /**/ "ace/pre.h"
14 #include "ACEXML/common/ACEXML_Export.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 #include "ACEXML/common/XML_Types.h"
21 #include "ACEXML/common/SAXExceptions.h"
25 * @class ACEXML_Element_Def_Builder
27 * @brief An abstract virtual class that defines the interface to define an
30 * This class defines how to define an element definition after parsing a
33 class ACEXML_Export ACEXML_Element_Def_Builder
36 typedef std::unique_ptr
<ACEXML_Element_Def_Builder
> VAR
;
53 virtual ~ACEXML_Element_Def_Builder () = 0;
56 * Define the name of the element.
58 * @retval 0 if valid, -1 otherwise.
60 virtual int setElementName (const ACEXML_Char
*namespaceURI
,
61 const ACEXML_Char
*localName
,
62 const ACEXML_Char
*qName
) = 0;
65 * Define the content type of the element.
67 * @retval 0 if valid, -1 otherwise.
69 virtual int setContentType (CONTENT_TYPE type
) = 0;
72 * Insert one more element into Mixed definition.
74 virtual int insertMixedElement (const ACEXML_Char
*namespaceURI
,
75 const ACEXML_Char
*localName
,
76 const ACEXML_Char
*qName
) = 0;
79 * Start a new group of children.
81 virtual int startChildGroup () = 0;
84 * End a new group of children.
86 * @retval 0 on success.
88 virtual int endChildGroup (CARDINALITY card
) = 0;
91 * Set the type of current child group to Choice.
93 * @retval 0 on success, -1 if the type of the child group has
94 * already been set and this action conflicts with the previous
97 virtual int setChoice () = 0;
100 * Set the type of current child group to Sequence.
102 * @retval 0 on success, -1 if the type of the child group has
103 * already been set and this action conflicts with the previous
106 virtual int setSequence () = 0;
109 * Insert an new element into the current child group.
111 * @retval 0 on success, -1 otherwise.
113 virtual int insertElement (const ACEXML_Char
*namespaceURI
,
114 const ACEXML_Char
*localName
,
115 const ACEXML_Char
*qName
) = 0;
118 * Dump the content of the attribute definition.
120 virtual void dump () = 0;
124 #include /**/ "ace/post.h"
126 #endif /* _ACEXML_ELEMENT_DEF_BUILDER_H_ */