Attributes_Def_Builder.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Attributes_Def_Builder.h
00006  *
00007  *  Attributes_Def_Builder.h,v 1.10 2003/07/19 19:04:10 dhinton Exp
00008  *
00009  *  @author Nanbor Wang <nanbor@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 #ifndef _ACEXML_ATTRIBUTES_DEF_BUILDER_H_
00013 #define _ACEXML_ATTRIBUTES_DEF_BUILDER_H_
00014 
00015 #include /**/ "ace/pre.h"
00016 #include "ACEXML/common/ACEXML_Export.h"
00017 
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 #pragma once
00020 #endif /* ACE_LACKS_PRAGMA_ONCE */
00021 
00022 #include "ACEXML/common/XML_Types.h"
00023 #include "ACEXML/common/Env.h"
00024 #include "ACEXML/common/SAXExceptions.h"
00025 #include "ace/Auto_Ptr.h"
00026 
00027 /**
00028  * @class ACEXML_Attribute_Def_Builder Attributes_Def_Builder.h "common/Attributes_Def_Builder.h"
00029  *
00030  * @brief An abstract virtual class defining an interface for building an
00031  *        attribute definition from DTD.
00032  *
00033  * This class should be invisible to application programmers and is only
00034  * used for validator implementors.
00035  */
00036 class ACEXML_Export ACEXML_Attribute_Def_Builder
00037 {
00038 public:
00039 
00040   typedef auto_ptr<ACEXML_Attribute_Def_Builder> VAR;
00041 
00042   enum ATT_TYPE {
00043     CDATA,
00044     ID,
00045     IDREF,
00046     IDREFS,
00047     ENTITY,
00048     ENTITIES,
00049     NMTOKEN,
00050     NMTOKENS,
00051     NOTATION,
00052     ENUMERATION,
00053     ERROR_TYPE
00054   };
00055 
00056   enum DEFAULT_DECL {
00057     REQUIRED,
00058     IMPLIED,
00059     FIXED,
00060     INVALID
00061   };
00062 
00063   virtual ~ACEXML_Attribute_Def_Builder () = 0;
00064 
00065   /**
00066    * Specify the name of the attribute.
00067    */
00068   virtual int setName (const ACEXML_Char *n) = 0;
00069 
00070   /**
00071    * Get the name of the attribute.
00072    */
00073   virtual const ACEXML_Char *getName (void) = 0;
00074 
00075   /**
00076    * Set the attribute type.
00077    */
00078   virtual int setAttType (const ATT_TYPE type ACEXML_ENV_ARG_DECL)
00079      ACE_THROW_SPEC ((ACEXML_SAXException)) = 0;
00080 
00081   /**
00082    * Insert an element for NOTATION or ENUMERATION type attribute.
00083    */
00084   virtual int insertList (const ACEXML_Char *Name ACEXML_ENV_ARG_DECL)
00085      ACE_THROW_SPEC ((ACEXML_SAXException)) = 0;
00086 
00087   /**
00088    * Set default attribute declaration.
00089    */
00090   virtual int setDefault (const DEFAULT_DECL def,
00091                           const ACEXML_Char *value ACEXML_ENV_ARG_DECL)
00092      ACE_THROW_SPEC ((ACEXML_SAXException)) = 0;
00093 
00094   /**
00095    * Check validity of the current attribute definition being built.
00096    *
00097    * @retval 0 if the attribute is not a valid combo.
00098    */
00099   virtual int validAttr (void) = 0;
00100 
00101   /**
00102    * Dump the content of the attribute definition.
00103    */
00104   virtual void dump (void) = 0;
00105 };
00106 
00107 /**
00108  * @ class ACEXML_Attributes_Def_Builder Attributes_Def_Builder.h "common/Attributes_Def_Builder.h"
00109  *
00110  * @ brief An abstract virtual class defining an interface for building
00111  *         attribute definitions from DTD.
00112  *
00113  * This class should be invisible to application programmers and
00114  * is only used for validator implementors.
00115  */
00116 class ACEXML_Export ACEXML_Attributes_Def_Builder
00117 {
00118 public:
00119 
00120   typedef auto_ptr<ACEXML_Attributes_Def_Builder> VAR;
00121 
00122   virtual ~ACEXML_Attributes_Def_Builder () = 0;
00123 
00124   /**
00125    * Set the element name that the attribute builder applies.
00126    *
00127    * @retval 0 if valid, -1 otherwise.
00128    */
00129   virtual int setElement (const ACEXML_Char *namespaceURI,
00130                           const ACEXML_Char *localName,
00131                           const ACEXML_Char *qName ACEXML_ENV_ARG_DECL)
00132         ACE_THROW_SPEC ((ACEXML_SAXException)) = 0;
00133 
00134   /**
00135    * Acquire an Attribute_Builder.
00136    */
00137   virtual ACEXML_Attribute_Def_Builder *getAttribute_Def_Builder () = 0;
00138 
00139   /**
00140    * Add a definition for one attribute.
00141    */
00142   virtual int insertAttribute (ACEXML_Attribute_Def_Builder *def ACEXML_ENV_ARG_DECL) = 0;
00143 
00144 
00145   /**
00146    * Dump the content of the attribute definition.
00147    */
00148   virtual void dump (void) = 0;
00149 };
00150 
00151 #include /**/ "ace/post.h"
00152 
00153 #endif /* _ACEXML_ATTRIBUTES_DEF_BUILDER_H_ */

Generated on Thu Nov 9 11:45:34 2006 for ACEXML by doxygen 1.3.6