3 //=============================================================================
5 * @file Attributes_Def_Builder.h
7 * @author Nanbor Wang <nanbor@cs.wustl.edu>
9 //=============================================================================
10 #ifndef _ACEXML_ATTRIBUTES_DEF_BUILDER_H_
11 #define _ACEXML_ATTRIBUTES_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_Attribute_Def_Builder
27 * @brief An abstract virtual class defining an interface for building an
28 * attribute definition from DTD.
30 * This class should be invisible to application programmers and is only
31 * used for validator implementors.
33 class ACEXML_Export ACEXML_Attribute_Def_Builder
36 typedef std::unique_ptr
<ACEXML_Attribute_Def_Builder
> VAR
;
59 virtual ~ACEXML_Attribute_Def_Builder () = 0;
62 * Specify the name of the attribute.
64 virtual int setName (const ACEXML_Char
*n
) = 0;
67 * Get the name of the attribute.
69 virtual const ACEXML_Char
*getName () = 0;
72 * Set the attribute type.
74 virtual int setAttType (const ATT_TYPE type
) = 0;
77 * Insert an element for NOTATION or ENUMERATION type attribute.
79 virtual int insertList (const ACEXML_Char
*Name
) = 0;
82 * Set default attribute declaration.
84 virtual int setDefault (const DEFAULT_DECL def
,
85 const ACEXML_Char
*value
) = 0;
88 * Check validity of the current attribute definition being built.
90 * @retval 0 if the attribute is not a valid combo.
92 virtual int validAttr () = 0;
95 * Dump the content of the attribute definition.
97 virtual void dump () = 0;
101 * @ class ACEXML_Attributes_Def_Builder Attributes_Def_Builder.h "common/Attributes_Def_Builder.h"
103 * @ brief An abstract virtual class defining an interface for building
104 * attribute definitions from DTD.
106 * This class should be invisible to application programmers and
107 * is only used for validator implementors.
109 class ACEXML_Export ACEXML_Attributes_Def_Builder
112 typedef std::unique_ptr
<ACEXML_Attributes_Def_Builder
> VAR
;
114 virtual ~ACEXML_Attributes_Def_Builder () = 0;
117 * Set the element name that the attribute builder applies.
119 * @retval 0 if valid, -1 otherwise.
121 virtual int setElement (const ACEXML_Char
*namespaceURI
,
122 const ACEXML_Char
*localName
,
123 const ACEXML_Char
*qName
) = 0;
126 * Acquire an Attribute_Builder.
128 virtual ACEXML_Attribute_Def_Builder
*getAttribute_Def_Builder () = 0;
131 * Add a definition for one attribute.
133 virtual int insertAttribute (ACEXML_Attribute_Def_Builder
*def
) = 0;
137 * Dump the content of the attribute definition.
139 virtual void dump () = 0;
142 #include /**/ "ace/post.h"
144 #endif /* _ACEXML_ATTRIBUTES_DEF_BUILDER_H_ */