docs: function validate(entity) {
    expect(arguments).to.have.length(
      1,
      'Invalid argument length when validating an attribute of an entity (it ' +
      'has to be passed 1 argument)'
    );
  
    expect(entity).to.be.instanceof(
      models.Entity,
      'Invalid argument "entity" when validating an attribute of an entity (it ' +
      'has to be an Entity)'
    );
  
    var attributeValue = null;
  
    if (entity.hasOwnProperty(this.name)) {
      attributeValue = entity[this.name];
    }
  
    if (
      (
        this.multiplicity === '1' ||
        this.multiplicity === '1..*'
      ) &&
      attributeValue === null
    ) {
      throw new ValidationError(
        'this attribute is required',
        entity.Entity.specification.name,
        this.name
      );
    } else if (
      this.multiplicity === '0..1' && attributeValue !== null ||
      this.multiplicity === '1'
    ) {
      try {
        this.validateValue(attributeValue);
      } catch (e) {
        if (e instanceof ValidationError) {
          throw new ValidationError(
            e.validationMessage,
            entity.Entity.specification.name,
            this.name
          );
        } else {
          throw e;
        }
      }
    } else if (
      this.multiplicity === '*' && attributeValue !== null ||
      this.multiplicity === '1..*'
    ) {
      if (!(attributeValue instanceof Array)) {
        throw new ValidationError(
          'this attribute\'s value should be an Array',
          entity.Entity.specification.name,
          this.name
        );
      } else {
        var found = false;
  
        for (var i = 0; i < attributeValue.length; i++) {
          if (attributeValue[i] !== null) {
            try {
              this.validateValue(attributeValue[i]);
            } catch (e) {
              if (e instanceof ValidationError) {
                throw new ValidationError(
                  e.validationMessage,
                  entity.Entity.specification.name,
                  this.name,
                  i
                );
              } else {
                throw e;
              }
            }
            found = true;
          }
        }
  
        if (
          this.multiplicity === '1..*' &&
          !found
        ) {
          throw new ValidationError(
            'this attribute\'s value should be a non empty Array',
            entity.Entity.specification.name,
            this.name
          );
        }
      }
    }
  }