Class sap.ui.model.resource.ResourceModelModule: sap/ui/model/resource/ResourceModel
Model implementation for resource bundles
Constructor Summary
Events borrowed from class sap.ui.model.Model
Method Summary
sap.ui.model.resource.ResourceModel.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.model.resource.ResourceModel with name
sClassName
and enriches it with the information contained in oClassInfo
.sap.ui.model.resource.ResourceModel.getMetadata()Returns a metadata object for class sap.ui.model.resource.ResourceModel.
Methods borrowed from class sap.ui.model.Model
attachParseError, attachRequestCompleted, attachRequestFailed, attachRequestSent, bindContext, bindList, bindTree, createBindingContext, destroy, destroyBindingContext, detachParseError, detachRequestCompleted, detachRequestFailed, detachRequestSent, fireParseError, fireRequestCompleted, fireRequestFailed, fireRequestSent, getDefaultBindingMode, getMessagesByPath, getMetaModel, getObject, getOriginalProperty, isBindingModeSupported, isLegacySyntax, refresh, setDefaultBindingMode, setLegacySyntax, setMessages, setSizeLimit
Methods borrowed from class sap.ui.core.message.MessageProcessor
Methods borrowed from class sap.ui.base.EventProvider
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.model.resource.ResourceModel(oData)
Constructor for a new ResourceModel.
Parameters:
{object} | oData | parameters used to initialize the ResourceModel; at least either bundleUrl or bundleName must be set on this object; if both are set, bundleName wins |
{string} | oData.bundleUrl? | the URL to the base .properties file of a bundle (.properties file without any locale information, e.g. "mybundle.properties") |
{string} | oData.bundleName? | the UI5 module name of the .properties file; this name will be resolved to a path like the paths of normal UI5 modules and ".properties" will then be appended (e.g. a name like "myBundle" can be given) |
{string} | oData.bundleLocale? | an optional locale; when not given, the default is the active locale from the UI5 configuration |
{boolean} | oData.async? | whether the language bundle should be loaded asynchronously |
Method Detail
sap.ui.model.resource.ResourceModel.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.model.resource.ResourceModel 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.model.Model.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.model.resource.ResourceModel.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.model.resource.ResourceModel.
Returns:
{sap.ui.base.Metadata} | Metadata object describing this class |
enhance(oData): Promise
Enhances the resource model with a custom resource bundle. The resource model can be enhanced with multiple resource bundles. The last enhanced resource bundle wins against the previous ones and the original ones. This function can be called several times.
Parameters:
{object|jQuery.sap.util.ResourceBundle} | oData | parameters used to initialize the ResourceModel; at least either bundleUrl or bundleName must be set on this object; if both are set, bundleName wins - or an instance of an existing jQuery.sap.util.ResourceBundle |
{string} | oData.bundleUrl? | the URL to the base .properties file of a bundle (.properties file without any locale information, e.g. "mybundle.properties") |
{string} | oData.bundleName? | the UI5 module name of the .properties file; this name will be resolved to a path like the paths of normal UI5 modules and ".properties" will then be appended (e.g. a name like "myBundle" can be given) |
{string} | oData.bundleLocale? | an optional locale; when not given, the default is the active locale from the UI5 configuration |
- Since:
- 1.16.1
Returns:
{Promise} | Promise in async case (async ResourceModel) which is resolved when the the enhancement is finished |
getProperty(sPath): string
Returns the value for the property with the given
sPropertyName
Parameters:
{string} | sPath | the path to the property |
Returns:
{string} | the value of the property |
getResourceBundle(): jQuery.sap.util.ResourceBundle|Promise
Returns the resource bundle of this model
Returns:
{jQuery.sap.util.ResourceBundle|Promise} | loaded resource bundle or ECMA Script 6 Promise in asynchronous case |