IllegalArgumentException Class Reference

This class is used to manage an Illegal Argument Exception This exception is thrown when a bad object argument type is done to a function NOT YET IMPLEMENTED !!! More...

#include <IllegalArgumentException.h>

Inherits Exception.

Inheritance diagram for IllegalArgumentException:

Inheritance graph
[legend]
Collaboration diagram for IllegalArgumentException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 IllegalArgumentException () throw ()
 Default constructor.
virtual ~IllegalArgumentException () throw ()
 Destructor.
virtual std::string makeDescription ()
 The message provides by the index out of Bound exception.
virtual std::string makeReason ()
 The reason message provides by the index out of Bound exception.
virtual std::string makeOrigin (std::string sOrigin)
 The origin message provides by the index out of Bound exception.
 IllegalArgumentException (std::string sElementName, std::string sOrigin, std::string sFileName, unsigned int iLineNumber, double dIndex, long iNumberOfArguments,...)
 This constructor requires 7 parameters :
  • the name of the element which is an illegal argument
  • the method which throw the exception
  • the name of the file where the exception was thrown
  • the line number in the file where the exception was thrown
  • the bad argument entered
  • the number of rights arguments
  • the list of the rights arguments.


Private Attributes

std::string _sElementName
double _dIndex
long _iNbArguments
std::vector< double > _vArgumentsList

Detailed Description

This class is used to manage an Illegal Argument Exception This exception is thrown when a bad object argument type is done to a function NOT YET IMPLEMENTED !!!

Definition at line 20 of file IllegalArgumentException.h.


Constructor & Destructor Documentation

IllegalArgumentException::IllegalArgumentException  )  throw ()
 

Default constructor.

Definition at line 16 of file IllegalArgumentException.cpp.

00017 {
00018 
00019 }

IllegalArgumentException::~IllegalArgumentException  )  throw () [virtual]
 

Destructor.

Definition at line 22 of file IllegalArgumentException.cpp.

00023 {
00024 
00025 }

IllegalArgumentException::IllegalArgumentException std::string  sElementName,
std::string  sOrigin,
std::string  sFileName,
unsigned int  iLineNumber,
double  dIndex,
long  iNumberOfArguments,
  ...
 

This constructor requires 7 parameters :

  • the name of the element which is an illegal argument
  • the method which throw the exception
  • the name of the file where the exception was thrown
  • the line number in the file where the exception was thrown
  • the bad argument entered
  • the number of rights arguments
  • the list of the rights arguments.

Definition at line 53 of file IllegalArgumentException.cpp.

References _iNbArguments, _vArgumentsList, makeDescription(), makeOrigin(), makeReason(), Exception::setDescription(), Exception::setFileName(), Exception::setLineNumber(), Exception::setOrigin(), Exception::setReason(), and Exception::setType().

00059                                                                                                          : 
00060 _sElementName(sElementName),_dIndex(dIndex),_iNbArguments(iNumberOfArguments)
00061 {               
00062 
00063                 va_list arg_list;
00064                 va_start (arg_list,iNumberOfArguments);
00065                 
00066                 for (int i=0;i<=_iNbArguments;i++) 
00067                 {       
00068                         double dVal = va_arg(arg_list,double);
00069                         _vArgumentsList.push_back(dVal);
00070                 }
00071                 va_end (arg_list);
00072 
00073                 setLineNumber(iLineNumber);
00074                 setFileName(sFileName);
00075                 setType("IllegalArgumentException");
00076 
00077                 setDescription(makeDescription());
00078                 setReason(makeReason());
00079                 setOrigin(makeOrigin(sOrigin));
00080 }

Here is the call graph for this function:


Member Function Documentation

std::string IllegalArgumentException::makeDescription  )  [virtual]
 

The message provides by the index out of Bound exception.

Implements Exception.

Definition at line 84 of file IllegalArgumentException.cpp.

References _dIndex, _iNbArguments, _sElementName, _vArgumentsList, and dtos().

Referenced by IllegalArgumentException().

00085 { 
00086         std::string     sExceptionMessage       =       "The value entered ";
00087                                 sExceptionMessage       +=      dtos(_dIndex);
00088                                 sExceptionMessage       +=  " of the ";
00089                                 sExceptionMessage       +=  _sElementName;
00090                                 sExceptionMessage       +=      " variable must be one of the following values [" ;
00091                         
00092                                 for (int i=0;i<_iNbArguments-1;i++) 
00093                                 {       
00094                                         sExceptionMessage       += dtos(_vArgumentsList[i]);
00095                                         sExceptionMessage       += ";";
00096                                 }
00097                                 
00098                                 sExceptionMessage       += dtos(_vArgumentsList[_iNbArguments-1]);
00099                                 sExceptionMessage       +=      "]";
00100         
00101         return sExceptionMessage;
00102 }

Here is the call graph for this function:

std::string IllegalArgumentException::makeOrigin std::string  sOrigin  )  [virtual]
 

The origin message provides by the index out of Bound exception.

Implements Exception.

Definition at line 114 of file IllegalArgumentException.cpp.

References Exception::getFileName(), Exception::getLineNumber(), and ltos().

Referenced by IllegalArgumentException().

00115 {
00116         std::string     sOriginMessage = getFileName();
00117                                 sOriginMessage+= " (l:";
00118                                 sOriginMessage+= ltos(getLineNumber());
00119                                 sOriginMessage+= ") ";
00120                                 sOriginMessage+= sOrigin;
00121                         
00122         return sOriginMessage;
00123 }

Here is the call graph for this function:

std::string IllegalArgumentException::makeReason  )  [virtual]
 

The reason message provides by the index out of Bound exception.

Implements Exception.

Definition at line 105 of file IllegalArgumentException.cpp.

References Exception::getType().

Referenced by IllegalArgumentException().

00106 {
00107         std::string     sReasonMessage = "ILLEGAL_ARGUMENT --> ";
00108                                 sReasonMessage+= getType();
00109                         
00110         return sReasonMessage;
00111 }

Here is the call graph for this function:


Member Data Documentation

double IllegalArgumentException::_dIndex [private]
 

Definition at line 46 of file IllegalArgumentException.h.

Referenced by makeDescription().

long IllegalArgumentException::_iNbArguments [private]
 

Definition at line 47 of file IllegalArgumentException.h.

Referenced by IllegalArgumentException(), and makeDescription().

std::string IllegalArgumentException::_sElementName [private]
 

Definition at line 45 of file IllegalArgumentException.h.

Referenced by makeDescription().

std::vector<double> IllegalArgumentException::_vArgumentsList [private]
 

Definition at line 48 of file IllegalArgumentException.h.

Referenced by IllegalArgumentException(), and makeDescription().


The documentation for this class was generated from the following files:
Generated on Fri Jul 10 10:32:21 2009 for Utils Library by  doxygen 1.4.5