Class sap.ui.core.ManifestModule: sap/ui/core/Manifest

extends Object

The Manifest class.


Since: 1.33.0.
Constructor Summary
new sap.ui.core.Manifest(oManifest, mOptions?)Creates and initializes a manifest wrapper which provides API access to the content of the manifest.
Method Summary
sap.ui.core.Manifest.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.Manifest with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.Manifest.getMetadata()Returns a metadata object for class sap.ui.core.Manifest.
sap.ui.core.Manifest.load(mOptions)Function to load the manifest by URL
getComponentName()Returns the Component name which is defined in the manifest as sap.ui5/componentName or sap.app/id
getEntry(sKey)Returns the configuration of a manifest section or the value for a specific path.
getJson()Returns the manifest defined in the metadata of the component.
getRawJson()Returns the raw manifest defined in the metadata of the component.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.core.Manifest(oManifest, mOptions?)
Creates and initializes a manifest wrapper which provides API access to the content of the manifest.
Parameters:
{object}oManifest the manifest object
{object}mOptions? (optional) the configuration options
{string}mOptions.componentName? (optional) the name of the component
{string}mOptions.baseUrl? (optional) the base URL which is used to resolve relative URLs against
{boolean}mOptions.process?, Default: true (optional) Flag whether the manifest object should be processed or not which means that the placeholders will be replaced with resource bundle values
Method Detail
sap.ui.core.Manifest.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.Manifest with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.core.Manifest.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.Manifest.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
sap.ui.core.Manifest.load(mOptions): sap.ui.core.Manifest|Promise
Function to load the manifest by URL
Parameters:
{object}mOptions the configuration options
{string}mOptions.manifestUrl URL of the manifest
{string}mOptions.componentName? name of the component
{boolean}mOptions.async? Flag whether to load the manifest async or not (defaults to false)
{boolean}mOptions.failOnError? Flag whether to fail if an error occurs or not (defaults to true)
Returns:
{sap.ui.core.Manifest|Promise} Manifest object or for asynchronous calls an ECMA Script 6 Promise object will be returned.
getComponentName(): string
Returns the Component name which is defined in the manifest as sap.ui5/componentName or sap.app/id
Returns:
{string} the component name
getEntry(sKey): any|null
Returns the configuration of a manifest section or the value for a specific path. If no key is specified, the return value is null.

Example: { "sap.ui5": { "dependencies": { "libs": { "sap.m": {} }, "components": { "my.component.a": {} } } });

The configuration above can be accessed in the following ways:

  • By section/namespace: oManifest.getEntry("sap.ui5")
  • By path: oManifest.getEntry("/sap.ui5/dependencies/libs")

By section/namespace returns the configuration for the specified manifest section and by path allows to specify a concrete path to a dedicated entry inside the manifest. The path syntax always starts with a slash (/).

Parameters:
{string}sKey Either the manifest section name (namespace) or a concrete path
Returns:
{any|null} Value of the key (could be any kind of value)
getJson(): Object
Returns the manifest defined in the metadata of the component. If not specified, the return value is null.
Returns:
{Object} manifest.
getRawJson(): Object
Returns the raw manifest defined in the metadata of the component. If not specified, the return value is null.
Returns:
{Object} manifest