Abstract Class sap.ui.model.CompositeTypeModule: sap/ui/model/CompositeType
This is an abstract base class for composite types. Composite types have multiple input values and know how to merge/split them upon formatting/parsing the value. Typical use case a currency or amount values.
Subclasses of CompositeTypes can define boolean properties in the constructor: - bUseRawValues: the format and parse method will handle raw model values, types of embedded bindings are ignored - bParseWithValues: the parse method call will include the current binding values as a third parameter
Constructor Summary
Method Summary
sap.ui.model.CompositeType.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.model.CompositeType with name
sClassName
and enriches it with the information contained in oClassInfo
.sap.ui.model.CompositeType.getMetadata()Returns a metadata object for class sap.ui.model.CompositeType.
formatValue(aValues, sInternalType)Format the given set of values in model representation to an output value in the given internal type.
parseValue(oValue, sInternalType, aCurrentValues)Parse a value of an internal type to the expected set of values of the model type.
validateValue(aValues)Validate whether a given value in model representation is valid and meets the defined constraints (if any).
Methods borrowed from class sap.ui.model.Type
Methods borrowed from class sap.ui.base.Object
Constructor Detail
Method Detail
sap.ui.model.CompositeType.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.model.CompositeType 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.SimpleType.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.CompositeType.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.model.CompositeType.
Returns:
{sap.ui.base.Metadata} | Metadata object describing this class |
formatValue(aValues, sInternalType): any
Format the given set of values in model representation to an output value in the given internal type. This happens according to the format options, if target type is 'string'. If aValues is not defined or null, null will be returned.
Parameters:
{array} | aValues | the values to be formatted |
{string} | sInternalType | the target type |
Returns:
{any} | the formatted output value |
parseValue(oValue, sInternalType, aCurrentValues): array
Parse a value of an internal type to the expected set of values of the model type.
Parameters:
{any} | oValue | the value to be parsed |
{string} | sInternalType | the source type |
{array} | aCurrentValues | the current values of all binding parts |
Returns:
{array} | the parse result array |