This class represents the OData primitive type Edm.String
.
In both sap.ui.model.odata.v2.ODataModel and sap.ui.model.odata.v4.ODataModel this type is represented as a string
.
Constructor for an OData primitive type Edm.String
.
new sap.ui.model.odata.type.String(oFormatOptions?, oConstraints?)
Param | Type | Default Value | Description |
---|---|---|---|
oFormatOptions? | object | format options as defined in the interface of sap.ui.model.SimpleType |
|
parseKeepsEmptyString? | boolean | false | if |
oConstraints? | object | constraints; validateValue throws an error if any constraint is violated |
|
isDigitSequence? | boolean string | false | if To make this type behave as ABAP type NUMC, use A type with |
maxLength? | int string | the maximal allowed length of the string; unlimited if not defined |
|
nullable? | boolean string | true | if |
Method | Description |
---|---|
sap.ui.model.odata.type.String.extend |
Creates a new subclass of class sap.ui.model.odata.type.String with name
|
formatValue |
Formats the given value to the given target type. If the |
sap.ui.model.odata.type.String.getMetadata |
Returns a metadata object for class sap.ui.model.odata.type.String. |
getName |
Returns the type's name. |
parseValue |
Parses the given value which is expected to be of the given type to a string. If Note: Depending on the format option |
validateValue |
Validates whether the given value in model representation is valid and meets the defined constraints. |
Creates a new subclass of class sap.ui.model.odata.type.String 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.odata.type.ODataType.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Formats the given value to the given target type. If the isDigitSequence
constraint of this type is set to true
, the target type is 'any' or 'string', and the given value contains only digits, the leading zeros are truncated. If the isDigitSequence
constraint of this type is set to true
and the maxLength
constraint is set, this type behaves as an ABAP type NUMC; in this case, the value '0' is formatted to '', provided the target type is 'string'.
Param | Type | DefaultValue | Description |
---|---|---|---|
sValue | string |
the value to be formatted |
|
sTargetType | string |
the target type; may be "any", "boolean", "float", "int" or "string". See sap.ui.model.odata.type for more information. |
Returns a metadata object for class sap.ui.model.odata.type.String.
Parses the given value which is expected to be of the given type to a string. If isDigitSequence
constraint of this type is set to true
and the parsed string is a sequence of digits, then the parsed string is either enhanced with leading zeros, if maxLength
constraint is given, or leading zeros are removed from parsed string.
Note: Depending on the format option parseKeepsEmptyString
, an empty input string (""
) is either parsed to ""
or null
. If the constraint nullable
is false
, a null
value is rejected with a ValidateException raised in the #validateValue method.
Param | Type | DefaultValue | Description |
---|---|---|---|
vValue | string number boolean |
the value to be parsed |
|
sSourceType | string |
the source type (the expected type of |