namespace sap/base/util/ObjectPath

Visiblity: public
Available since: N/A
Module: sap/base/util/ObjectPath
Application Component:

Manages an object path.

The object path can be just created with #.create, then an empty nested object path will be created from the provided string. If a value is set for an object path #.set it is also created if it not already exists. Values can be retrieved from the objectpath with #get.


Nodes Overview

Node Description

Methods Overview

Method Description
module:sap/base/util/ObjectPath.create

Creates a object path from the provided path in the provided root context.

The provided path is used to navigate through the nested objects, starting with the root context.

module:sap/base/util/ObjectPath.get

Returns a value located in the provided path. If the provided path cannot be resolved completely, undefined is returned.

The provided object path is used to navigate through the nested objects, starting with the root context. If no root context is provided, the object path begins with window.

module:sap/base/util/ObjectPath.set

Sets a value located in the provided path.

The provided path is used to navigate through the nested objects, starting with the root context.

Note: Ensures that the object path exists.

module:sap/base/util/ObjectPath.create

Creates a object path from the provided path in the provided root context.

The provided path is used to navigate through the nested objects, starting with the root context.

Param Type DefaultValue Description
vObjectPath string string[]

Path as string where each name is separated by '.'. Can also be an array of names.

oRootContext Object window

Root context where the path starts

module:sap/base/util/ObjectPath.get

Returns a value located in the provided path. If the provided path cannot be resolved completely, undefined is returned.

The provided object path is used to navigate through the nested objects, starting with the root context. If no root context is provided, the object path begins with window.

Param Type DefaultValue Description
vObjectPath string string[]

Path as string where each name is separated by '.'. Can also be an array of names.

oRootContext Object window

Root context where the path starts

module:sap/base/util/ObjectPath.set

Sets a value located in the provided path.

The provided path is used to navigate through the nested objects, starting with the root context.

Note: Ensures that the object path exists.

Param Type DefaultValue Description
vObjectPath string string[]

vObjectPath Path as string where each name is separated by '.'. Can also be an array of names.

vValue any

The value to be set in the root context's object path

oRootContext Object window

Root context where the path starts