Skip to content

Conversation

whitenrock
Copy link

With the third argument FNMetaImpl of Object.extend the constructor of a metadata class can be specified. Instances of that class will be used to represent metadata for the newly created class and for any subclass created from it:

sap.ui.base.Object.extend(sClassName, oClassInfo?, FNMetaImpl?) : function

With the changes of the pull request, it possible to set this metadata class with jsdoc or decorators :

Typescript

import UI5Object from "sap/ui/base/Object"
/** @metadata some.namespace.CustomMetadata */
class TestClass extends UI5Object {
   // implementation
}

Result

sap.ui.define(["some/namespace/CustomMetadata", "sap/ui/base/Object"], function(MetadataObject, Object) {
  const TestClass = UI5Object.extend("some.namespace.TestClass", {
    // implementation
  }, MetadataObject);
  return TestClass;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant