Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACEXML_Debug_Attribute_Builder Class Reference

#include "parser/debug_validator/Debug_Attributes_Builder.h"

Inheritance diagram for ACEXML_Debug_Attribute_Builder:

Inheritance graph
[legend]
Collaboration diagram for ACEXML_Debug_Attribute_Builder:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACEXML_Debug_Attribute_Builder ()
 ACEXML_Debug_Attribute_Builder (const ACEXML_Debug_Attribute_Builder &rhs)
virtual ~ACEXML_Debug_Attribute_Builder ()
virtual int setName (const ACEXML_Char *n)
virtual const ACEXML_ChargetName (void)
virtual int setAttType (const ATT_TYPE type ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual int insertList (const ACEXML_Char *Name ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual int setDefault (const DEFAULT_DECL def, const ACEXML_Char *value ACEXML_ENV_ARG_DECL) ACE_THROW_SPEC((ACEXML_SAXException))
virtual int validAttr (void)
virtual void dump (void)

Private Attributes

ACEXML_String name_
 Attribute name. More...

ATT_TYPE type_
 Type of attribute. More...

DEFAULT_DECL default_decl_
 Default value type. More...

ACEXML_String default_value_
 Default attribute value. More...

ACEXML_STRING_QUEUE att_value_queue_
 Holds a queue of enumerated attribute values. More...


Detailed Description

This class prints out the Attribute definition for debugging purpose.

Definition at line 34 of file Debug_Attributes_Builder.h.


Constructor & Destructor Documentation

ACEXML_Debug_Attribute_Builder::ACEXML_Debug_Attribute_Builder  
 

Definition at line 6 of file Debug_Attributes_Builder.cpp.

00007   : type_ (ERROR_TYPE),
00008     default_decl_ (INVALID)
00009 {
00010 }

ACEXML_Debug_Attribute_Builder::ACEXML_Debug_Attribute_Builder const ACEXML_Debug_Attribute_Builder &    rhs
 

Definition at line 12 of file Debug_Attributes_Builder.cpp.

00013   : name_ (rhs.name_),
00014     type_ (rhs.type_),
00015     default_decl_ (rhs.default_decl_),
00016     default_value_ (rhs.default_value_),
00017     att_value_queue_ (rhs.att_value_queue_)
00018 {
00019 }

ACEXML_Debug_Attribute_Builder::~ACEXML_Debug_Attribute_Builder   [virtual]
 

Definition at line 21 of file Debug_Attributes_Builder.cpp.

00022 {
00023 }


Member Function Documentation

void ACEXML_Debug_Attribute_Builder::dump void    [virtual]
 

Dump the content of the attribute definition.

Implements ACEXML_Attribute_Def_Builder.

Definition at line 82 of file Debug_Attributes_Builder.cpp.

References ACEXML_String, ACE_Unbounded_Queue_Iterator< ACEXML_String >::advance, ACEXML_Attribute_Def_Builder::CDATA, default_decl_, default_value_, ACEXML_Attribute_Def_Builder::ENTITIES, ACEXML_Attribute_Def_Builder::ENTITY, ACEXML_Attribute_Def_Builder::ENUMERATION, ACEXML_Attribute_Def_Builder::FIXED, ACEXML_Attribute_Def_Builder::ID, ACEXML_Attribute_Def_Builder::IDREF, ACEXML_Attribute_Def_Builder::IDREFS, ACEXML_Attribute_Def_Builder::IMPLIED, name_, ACE_Unbounded_Queue_Iterator< ACEXML_String >::next, ACEXML_Attribute_Def_Builder::NMTOKEN, ACEXML_Attribute_Def_Builder::NMTOKENS, ACEXML_Attribute_Def_Builder::NOTATION, ACEXML_Attribute_Def_Builder::REQUIRED, and type_.

Referenced by ACEXML_Debug_Attributes_Builder::dump.

00083 {
00084   cout << this->name_ << " ";
00085 
00086   switch (this->type_)
00087     {
00088     case CDATA:
00089       cout << "CDATA ";
00090       break;
00091     case ID:
00092       cout << "ID ";
00093       break;
00094     case IDREF:
00095       cout << "IDREF ";
00096       break;
00097     case IDREFS:
00098       cout << "IDREFS ";
00099       break;
00100     case ENTITY:
00101       cout << "ENTITY ";
00102       break;
00103     case ENTITIES:
00104       cout << "ENTITIES ";
00105       break;
00106     case NMTOKEN:
00107       cout << "NMTOKEN ";
00108       break;
00109     case NMTOKENS:
00110       cout << "NMTOKENS ";
00111       break;
00112     case NOTATION:
00113       cout << "NOTATION ";
00114       // Fall thru
00115     case ENUMERATION:
00116       {
00117         cout << "(";
00118         ACEXML_STRING_QUEUE_ITERATOR iter (this->att_value_queue_);
00119         ACEXML_String *n = 0;
00120 
00121         while (iter.advance () != 0)
00122           {
00123             if (n == 0)
00124               cout << " | ";
00125             iter.next (n);
00126             cout << *n;
00127           }
00128         cout << ") ";
00129       }
00130       break;
00131     default:
00132       cout << "*** UNKNOWN TYPE ***";
00133       break;
00134     }
00135 
00136   switch (this->default_decl_)
00137     {
00138     case REQUIRED:
00139       cout << "#REQUIRED";
00140       break;
00141     case IMPLIED:
00142       cout << "#IMPLIED";
00143       break;
00144     case FIXED:
00145       cout << "#FIXED " << this->default_value_;
00146       break;
00147     default:
00148       cout << "**** UNDEFINED DEFAULT DECL ****";
00149       break;
00150     }
00151 }

const ACEXML_Char * ACEXML_Debug_Attribute_Builder::getName void    [virtual]
 

Get the name of the attribute.

Implements ACEXML_Attribute_Def_Builder.

Definition at line 33 of file Debug_Attributes_Builder.cpp.

References name_.

00034 {
00035   return this->name_.fast_rep ();
00036 }

virtual int ACEXML_Debug_Attribute_Builder::insertList const ACEXML_Char *Name    ACEXML_ENV_ARG_DECL [virtual]
 

Insert an element for NOTATION or ENUMERATION type attribute.

Implements ACEXML_Attribute_Def_Builder.

int ACEXML_Debug_Attribute_Builder::setAttType const ATT_TYPE type    ACEXML_ENV_ARG_DECL [virtual]
 

Set the attribute type.

Implements ACEXML_Attribute_Def_Builder.

Definition at line 39 of file Debug_Attributes_Builder.cpp.

References ACE_TEXT, ACEXML_ENV_ARG_DECL, and ACEXML_THROW_RETURN.

00042 {
00043   if (this->type_ == ERROR_TYPE)
00044     {
00045       this->type_ = type;
00046       return 0;
00047     }
00048   ACEXML_THROW_RETURN (ACEXML_SAXParseException (ACE_TEXT("Attribute type redefinition in Debug Validator")), -1);
00049 
00050 }

int ACEXML_Debug_Attribute_Builder::setDefault const DEFAULT_DECL    def,
const ACEXML_Char *value    ACEXML_ENV_ARG_DECL
[virtual]
 

Set default attribute declaration.

Implements ACEXML_Attribute_Def_Builder.

Definition at line 64 of file Debug_Attributes_Builder.cpp.

References ACEXML_Char, and ACEXML_ENV_ARG_DECL_NOT_USED.

00068 {
00069   this->default_decl_ = def;
00070   this->default_value_.set (value, 0);
00071   return 0;
00072 }

int ACEXML_Debug_Attribute_Builder::setName const ACEXML_Char   n [virtual]
 

Specify the name of the attribute.

Implements ACEXML_Attribute_Def_Builder.

Definition at line 26 of file Debug_Attributes_Builder.cpp.

References ACEXML_Char, and name_.

00027 {
00028   this->name_.set (n, 0);
00029   return 0;
00030 }

int ACEXML_Debug_Attribute_Builder::validAttr void    [virtual]
 

Check validity of the current attribute definition being built.

Return values:
0  if the attribute is not a valid combo.

Implements ACEXML_Attribute_Def_Builder.

Definition at line 75 of file Debug_Attributes_Builder.cpp.

00076 {
00077   // @@ Not implemented.  Always return 1 (true) for now.
00078   return 1;
00079 }


Member Data Documentation

ACEXML_STRING_QUEUE ACEXML_Debug_Attribute_Builder::att_value_queue_ [private]
 

Holds a queue of enumerated attribute values.

Definition at line 96 of file Debug_Attributes_Builder.h.

DEFAULT_DECL ACEXML_Debug_Attribute_Builder::default_decl_ [private]
 

Default value type.

Definition at line 90 of file Debug_Attributes_Builder.h.

Referenced by dump.

ACEXML_String ACEXML_Debug_Attribute_Builder::default_value_ [private]
 

Default attribute value.

Definition at line 93 of file Debug_Attributes_Builder.h.

Referenced by dump.

ACEXML_String ACEXML_Debug_Attribute_Builder::name_ [private]
 

Attribute name.

Definition at line 84 of file Debug_Attributes_Builder.h.

Referenced by dump, getName, and setName.

ATT_TYPE ACEXML_Debug_Attribute_Builder::type_ [private]
 

Type of attribute.

Definition at line 87 of file Debug_Attributes_Builder.h.

Referenced by dump.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 13:26:37 2003 for ACEXML by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002