Public Member Functions | Private Attributes

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)
virtual int insertList (const ACEXML_Char *Name ACEXML_ENV_ARG_DECL)
virtual int setDefault (const DEFAULT_DECL def, const ACEXML_Char *value ACEXML_ENV_ARG_DECL)
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.

ACEXML_Debug_Attribute_Builder::ACEXML_Debug_Attribute_Builder ( const ACEXML_Debug_Attribute_Builder rhs  ) 
ACEXML_Debug_Attribute_Builder::~ACEXML_Debug_Attribute_Builder (  )  [virtual]

Definition at line 21 of file Debug_Attributes_Builder.cpp.

{
}


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 79 of file Debug_Attributes_Builder.cpp.

{
  cout << this->name_ << " ";

  switch (this->type_)
    {
    case CDATA:
      cout << "CDATA ";
      break;
    case ID:
      cout << "ID ";
      break;
    case IDREF:
      cout << "IDREF ";
      break;
    case IDREFS:
      cout << "IDREFS ";
      break;
    case ENTITY:
      cout << "ENTITY ";
      break;
    case ENTITIES:
      cout << "ENTITIES ";
      break;
    case NMTOKEN:
      cout << "NMTOKEN ";
      break;
    case NMTOKENS:
      cout << "NMTOKENS ";
      break;
    case NOTATION:
      cout << "NOTATION ";
      // Fall thru
    case ENUMERATION:
      {
        cout << "(";
        ACEXML_STRING_QUEUE_ITERATOR iter (this->att_value_queue_);
        ACEXML_String *n = 0;

        while (iter.advance () != 0)
          {
            if (n == 0)
              cout << " | ";
            iter.next (n);
            cout << *n;
          }
        cout << ") ";
      }
      break;
    default:
      cout << "*** UNKNOWN TYPE ***";
      break;
    }

  switch (this->default_decl_)
    {
    case REQUIRED:
      cout << "#REQUIRED";
      break;
    case IMPLIED:
      cout << "#IMPLIED";
      break;
    case FIXED:
      cout << "#FIXED " << this->default_value_;
      break;
    default:
      cout << "**** UNDEFINED DEFAULT DECL ****";
      break;
    }
}

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.

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

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.

Definition at line 39 of file Debug_Attributes_Builder.cpp.

{
  if (this->type_ == ERROR_TYPE)
    {
      this->type_ = type;
      return 0;
    }
  ACEXML_THROW_RETURN (ACEXML_SAXParseException (ACE_TEXT("Attribute type redefinition in Debug Validator")), -1);

}

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 62 of file Debug_Attributes_Builder.cpp.

{
  this->default_decl_ = def;
  this->default_value_.set (value, 0);
  return 0;
}

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.

{
  this->name_.set (n, 0);
  return 0;
}

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 72 of file Debug_Attributes_Builder.cpp.

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


Member Data Documentation

Holds a queue of enumerated attribute values.

Definition at line 93 of file Debug_Attributes_Builder.h.

Default value type.

Definition at line 87 of file Debug_Attributes_Builder.h.

Default attribute value.

Definition at line 90 of file Debug_Attributes_Builder.h.

Attribute name.

Definition at line 81 of file Debug_Attributes_Builder.h.

Type of attribute.

Definition at line 84 of file Debug_Attributes_Builder.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines