Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom metadata implementation #62

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

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.

None yet

1 participant