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 Member Functions

 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.

ATT_TYPE type_
 Type of attribute.

DEFAULT_DECL default_decl_
 Default value type.

ACEXML_String default_value_
 Default attribute value.

ACEXML_STRING_QUEUE att_value_queue_
 Holds a queue of enumerated attribute values.


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, ACEXML_STRING_QUEUE_ITERATOR, ACE_Unbounded_Queue_Iterator< ACEXML_String >::advance(), default_decl_, default_value_, and ACE_Unbounded_Queue_Iterator< ACEXML_String >::next().

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.

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, 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.

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.

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.

ATT_TYPE ACEXML_Debug_Attribute_Builder::type_ [private]
 

Type of attribute.

Definition at line 87 of file Debug_Attributes_Builder.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:47:46 2006 for ACEXML by doxygen 1.3.6