src/sap.ui.core/src/sap/ui/model/odata/_AnnotationHelperBasics.js
function (oResult, bExpression, bWithType) {
			var vValue = oResult.value;

			function binding(bAddType) {
				var sConstraints, sResult;

				bAddType = bAddType && !oResult.ignoreTypeInPath && oResult.type;
				if (bAddType || rBadChars.test(vValue)) {
					sResult = "{path:" + Basics.toJSON(vValue);
					if (bAddType) {
						sResult += ",type:'" + mUi5TypeForEdmType[oResult.type] + "'";
						sConstraints = Basics.toJSON(oResult.constraints);
						if (sConstraints && sConstraints !== "{}") {
							sResult += ",constraints:" + sConstraints;
						}
					}
					return sResult + "}";
				}
				return "{" + vValue + "}";
			}

			function constant(oResult) {
				switch (oResult.type) {
					case "Edm.Boolean":
					case "Edm.Double":
					case "Edm.Int32":
						return String(oResult.value);
					default:
						return Basics.toJSON(oResult.value);
				}
			}

			switch (oResult.result) {
			case "binding":
				return (bExpression ?  "$" : "") + binding(bWithType);

			case "composite":
				if (bExpression) {
					throw new Error(
						"Trying to embed a composite binding into an expression binding");
				}
				return vValue; // Note: it's already a composite binding string

			case "constant":
				if (oResult.type === "edm:Null") {
					return bExpression ? "null" : null;
				}
				if (bExpression) {
					return constant(oResult);
				}
				return typeof vValue === "string"
					? BindingParser.complexParser.escape(vValue)
					: String(vValue);

			case "expression":
				return bExpression ? vValue : "{=" + vValue + "}";

			// no default
			}
		}
function (oResult, bExpression, bWithType) {
			var vValue = oResult.value;

			function binding(bAddType) {
				var sConstraints, sResult;

				bAddType = bAddType && !oResult.ignoreTypeInPath && oResult.type;
				if (bAddType || rBadChars.test(vValue)) {
					sResult = "{path:" + Basics.toJSON(vValue);
					if (bAddType) {
						sResult += ",type:'" + mUi5TypeForEdmType[oResult.type] + "'";
						sConstraints = Basics.toJSON(oResult.constraints);
						if (sConstraints && sConstraints !== "{}") {
							sResult += ",constraints:" + sConstraints;
						}
					}
					return sResult + "}";
				}
				return "{" + vValue + "}";
			}

			function constant(oResult) {
				switch (oResult.type) {
					case "Edm.Boolean":
					case "Edm.Double":
					case "Edm.Int32":
						return String(oResult.value);
					default:
						return Basics.toJSON(oResult.value);
				}
			}

			switch (oResult.result) {
			case "binding":
				return (bExpression ?  "$" : "") + binding(bWithType);

			case "composite":
				if (bExpression) {
					throw new Error(
						"Trying to embed a composite binding into an expression binding");
				}
				return vValue; // Note: it's already a composite binding string

			case "constant":
				if (oResult.type === "edm:Null") {
					return bExpression ? "null" : null;
				}
				if (bExpression) {
					return constant(oResult);
				}
				return typeof vValue === "string"
					? BindingParser.complexParser.escape(vValue)
					: String(vValue);

			case "expression":
				return bExpression ? vValue : "{=" + vValue + "}";

			// no default
			}
		}
function ( oResult , bExpression , bWithType ) { var vValue = oResult . value ; function binding ( bAddType ) { var sConstraints , sResult ; bAddType = bAddType && ! oResult . ignoreTypeInPath && oResult . type ; if ( bAddType || rBadChars . test ( vValue ) ) { sResult = "{path:" + Basics . toJSON ( vValue ) ; if ( bAddType ) { sResult += ",type:'" + mUi5TypeForEdmType [ oResult . type ] + "'" ; sConstraints = Basics . toJSON ( oResult . constraints ) ; if ( sConstraints && sConstraints !== "{}" ) { sResult += ",constraints:" + sConstraints ; } } return sResult + "}" ; } return "{" + vValue + "}" ; } function constant ( oResult ) { switch ( oResult . type ) { case "Edm.Boolean" : case "Edm.Double" : case "Edm.Int32" : return String ( oResult . value ) ; default : return Basics . toJSON ( oResult . value ) ; } } switch ( oResult . result ) { case "binding" : return ( bExpression ? "$" : "" ) + binding ( bWithType ) ; case "composite" : if ( bExpression ) { throw new Error ( "Trying to embed a composite binding into an expression binding" ) ; } return vValue ; // Note: it's already a composite binding string case "constant" : if ( oResult . type === "edm:Null" ) { return bExpression ? "null" : null ; } if ( bExpression ) { return constant ( oResult ) ; } return typeof vValue === "string" ? BindingParser . complexParser . escape ( vValue ) : String ( vValue ) ; case "expression" : return bExpression ? vValue : "{=" + vValue + "}" ; // no default } }
Converts the result's value to a string.

@param {object} oResult
an object with the following properties:
result: "constant", "binding", "composite" or "expression"
value: {any} the value to write into the resulting string depending on result:
when "constant": the constant value as a string (from the annotation)
when "binding": the binding path
when "expression": a binding expression not wrapped (no "{=" and "}")
when "composite": a composite binding string
type: an EDM data type (like "Edm.String")
constraints: {object} optional type constraints when result is "binding"
@param {boolean} bExpression
if true the value is to be embedded into a binding expression, otherwise in a
composite binding
@param {boolean} [bWithType=false]
if <code>true</code> and <code>oResult.result</code> is "binding", type and constraint
information is written to the resulting binding string
@returns {string}
the resulting string to embed into a composite binding or a binding expression
Converts the result s value to a string .