code: function (Class, descriptors, staticDescriptors) {
      var properties = {};
      each(descriptors, function (descriptor, name) {
        var property = {};
        properties[name] = property;
        each(descriptor, function (value, key) {
          if (key === 'rules') {
            property.rules = value.map(function (item) {
              var name;
              if (Array.isArray(item)) {
                name = item[0];
                item = item[1] || {};
                item.name = name;
                return item;
              }
              else {
                return item;
              }
            });
          }
          else if (!isBuiltinDescriptorKey(key)) {
            property[key] = value;
          }
        });
      });
      var toJSON = function () {
        return {
          '@context': this['@context'],
          '@id': this['@id'],
          '@type': this['@type'],
          name: this.name,
          properties: properties
        };
      };
  
      toJSON.isAutoGenerated = true;
      return toJSON;
    }
docs: Create a function which can return a representation
  of the **class**, which can be encoded as JSON.
  
  @param  {Function} Class             The class.
  @param  {Object}   descriptors       The property descriptors.
  @param  {Object}   staticDescriptors The static property descriptors.
  
  @return {Function} The generated function.