# eric7.Utilities.ClassBrowsers.ClbrBaseClasses

Module implementing base classes used by the various class browsers.

### Global Attributes

None

### Classes

Attribute | Class to represent an attribute.
Class | Class to represent a class.
ClbrBase | Class implementing the base of all complex class browser objects.
ClbrVisibilityMixinBase | Class implementing the base class of all visibility mixins.
Coding | Class to represent a source coding.
Enum | Class to represent an enum definition.
Function | Class to represent a function or method.
Module | Class to represent a module.
_ClbrBase | Class implementing the base of all class browser objects.

### Functions

None

## Attribute

Class to represent an attribute.

### Derived from

_ClbrBase

### Class Attributes

None

### Class Methods

None

### Methods

Attribute | Constructor
addAssignment | Public method to add another assignment line number.

### Static Methods

None

#### Attribute (Constructor)

Attribute(module, name, file, lineno)

Constructor

module (str)
  name of the module containing this attribute
name (str)
  name of this attribute
file (str)
  filename containing this attribute
lineno (int)
  line number of the attribute definition

#### Attribute.addAssignment

addAssignment(lineno)

Public method to add another assignment line number.

lineno (int)
  line number of the additional attribute assignment

Up

## Class

Class to represent a class.

### Derived from

ClbrBase

### Class Attributes

None

### Class Methods

None

### Methods

Class | Constructor

### Static Methods

None

#### Class (Constructor)

Class(module, name, superClasses, file, lineno)

Constructor

module (str)
  name of the module containing this class
name (str)
  name of this class
superClasses (list of str)
  list of class names this class is inherited from
file (str)
  filename containing this class
lineno (int)
  line number of the class definition

Up

## ClbrBase

Class implementing the base of all complex class browser objects.

### Derived from

_ClbrBase

### Class Attributes

None

### Class Methods

None

### Methods

ClbrBase | Constructor
_addattribute | Protected method to add information about attributes.
_addclass | Protected method method to add a nested class to this class.
_addglobal | Protected method to add information about global variables.
_addmethod | Protected method to add information about a method.
_getattribute | Protected method to retrieve an attribute by name.
_getglobal | Protected method to retrieve a global variable by name.
_getmethod | Protected method to retrieve a method by name.

### Static Methods

None

#### ClbrBase (Constructor)

ClbrBase(module, name, file, lineno)

Constructor

module (str)
  name of the module containing this object
name (str)
  name of this object
file (str)
  filename containing this object
lineno (int)
  linenumber of the object definition

#### ClbrBase._addattribute

_addattribute(attr)

Protected method to add information about attributes.

attr (Attribute)
  Attribute object to be added

#### ClbrBase._addclass

_addclass(name, _class)

Protected method method to add a nested class to this class.

name (str)
  name of the class
_class (Class)
  Class object to be added

#### ClbrBase._addglobal

_addglobal(attr)

Protected method to add information about global variables.

attr (Attribute)
  Attribute object to be added

#### ClbrBase._addmethod

_addmethod(name, function)

Protected method to add information about a method.

name (str)
  name of method to be added
function (Function)
  Function object to be added

#### ClbrBase._getattribute

_getattribute(name)

Protected method to retrieve an attribute by name.

name (str)
  name of the attribute

Return:
  the named attribute

Return Type:
  Attribute or None

#### ClbrBase._getglobal

_getglobal(name)

Protected method to retrieve a global variable by name.

name (str)
  name of the global variable

Return:
  the named global variable

Return Type:
  Attribute or None

#### ClbrBase._getmethod

_getmethod(name)

Protected method to retrieve a method by name.

name (str)
  name of the method (string)

Return:
  the named method

Return Type:
  Function or None

Up

## ClbrVisibilityMixinBase

Class implementing the base class of all visibility mixins.

### Derived from

None

### Class Attributes

None

### Class Methods

None

### Methods

isPrivate | Public method to check, if the visibility is Private.
isProtected | Public method to check, if the visibility is Protected.
isPublic | Public method to check, if the visibility is Public.
setPrivate | Public method to set the visibility to Private.
setProtected | Public method to set the visibility to Protected.
setPublic | Public method to set the visibility to Public.

### Static Methods

None

#### ClbrVisibilityMixinBase.isPrivate

isPrivate()

Public method to check, if the visibility is Private.

Return:
  flag indicating Private visibility

Return Type:
  bool

#### ClbrVisibilityMixinBase.isProtected

isProtected()

Public method to check, if the visibility is Protected.

Return:
  flag indicating Protected visibility

Return Type:
  bool

#### ClbrVisibilityMixinBase.isPublic

isPublic()

Public method to check, if the visibility is Public.

Return:
  flag indicating Public visibility

Return Type:
  bool

#### ClbrVisibilityMixinBase.setPrivate

setPrivate()

Public method to set the visibility to Private.

#### ClbrVisibilityMixinBase.setProtected

setProtected()

Public method to set the visibility to Protected.

#### ClbrVisibilityMixinBase.setPublic

setPublic()

Public method to set the visibility to Public.

Up

## Coding

Class to represent a source coding.

### Derived from

ClbrBase

### Class Attributes

None

### Class Methods

None

### Methods

Coding | Constructor

### Static Methods

None

#### Coding (Constructor)

Coding(module, file, lineno, coding)

Constructor

module (str)
  name of the module containing this coding statement
file (str)
  filename containing this coding statement
lineno (int)
  line number of the coding definition
coding (str)
  character coding of the source file

Up

## Enum

Class to represent an enum definition.

### Derived from

ClbrBase

### Class Attributes

None

### Class Methods

None

### Methods

Enum | Constructor

### Static Methods

None

#### Enum (Constructor)

Enum(module, name, file, lineno)

Constructor

module (str)
  name of the module containing this enum
name (str)
  name of this enum
file (str)
  filename containing this enum
lineno (int)
  line number of the enum definition

Up

## Function

Class to represent a function or method.

### Derived from

ClbrBase

### Class Attributes

Class
General
Static

### Class Methods

None

### Methods

Function | Constructor

### Static Methods

None

#### Function (Constructor)

Function(module, name, file, lineno, signature='', separator=', ', modifierType=General, annotation="")

Constructor

module (str)
  name of the module containing this function
name (str)
  name of this function
file (str)
  filename containing this function
lineno (int)
  line number of the function definition
signature (str)
  parameter list of the function
separator (str)
  string separating the parameters of the function
modifierType (int)
  type of the function
annotation (str)
  function return annotation

Up

## Module

Class to represent a module.

### Derived from

ClbrBase

### Class Attributes

None

### Class Methods

None

### Methods

Module | Constructor

### Static Methods

None

#### Module (Constructor)

Module(module, name, file, lineno)

Constructor

module (str)
  name of the module containing this module
name (str)
  name of this module
file (str)
  filename containing this module
lineno (int)
  line number of the module definition

Up

## _ClbrBase

Class implementing the base of all class browser objects.

### Derived from

None

### Class Attributes

None

### Class Methods

None

### Methods

_ClbrBase | Constructor
setEndLine | Public method to set the ending line number.

### Static Methods

None

#### _ClbrBase (Constructor)

_ClbrBase(module, name, file, lineno)

Constructor

module (str)
  name of the module containing this object
name (str)
  name of this object
file (str)
  filename containing this object
lineno (int)
  linenumber of the object definition

#### _ClbrBase.setEndLine

setEndLine(endLineNo)

Public method to set the ending line number.

endLineNo (int)
  number of the last line

Up