docs: function (interfaceOrClasspath, classPrototype) {
                  var itf = Aria.getClassRef(interfaceOrClasspath);
                  if (!itf.interfaceDefinition) {
                      this.$logError(this.WRONG_INTERFACE, [interfaceOrClasspath, classPrototype.$classpath]);
                      return false;
                  }
                  var interfaceClasspath = itf.interfaceDefinition.$classpath;
                  var interfaces = classPrototype.$interfaces;
                  if (interfaces && interfaces[interfaceClasspath]) {
                      // the interface was already applied
                      return true;
                  }
                  if (itf.superInterface) {
                      // apply the parent interface before this interface
                      if (!this.applyInterface(itf.interfaceDefinition.$extends, classPrototype)) {
                          return false;
                      }
                      // by calling this function, interfaces may have changed, update the variable:
                      interfaces = classPrototype.$interfaces;
                  }
                  if (!classPrototype.hasOwnProperty("$interfaces")) {
                      // copies the parent map of interfaces before adding this one
                      interfaces = __copyMap(interfaces);
                      classPrototype.$interfaces = interfaces;
                  }
                  // set on the prototype that the interface is supported:
                  interfaces[interfaceClasspath] = itf;
                  // copies the events:
                  __mergeEvents(classPrototype.$events, itf.interfaceDefinition.$events, classPrototype.$classpath);
                  // check that methods of the interface are correctly implemented in the class prototype:
                  var itfMembers = itf.interfaceDefinition.$interface;
                  for (var member in itfMembers) {
                      if (itfMembers.hasOwnProperty(member) && itfMembers[member].$type == "Function"
                              && !typeUtils.isFunction(classPrototype[member])) {
                          this.$logError(this.METHOD_NOT_IMPLEMENTED, [classPrototype.$classpath, member,
                                  interfaceClasspath]);
                          return false;
                      }
                  }
                  return true;
              }