DataPath
open class DataPath: PropertyPath
Used together with DataQuery
to represent a select, expand or sort item which is a single-part or multi-part path expression.
For example, a path whose OData URL representation is Address/City
might be used to access the City
property in a complex-typed Address
property.
Also used to represent paths in OData CSDL.
-
Sets the item index to address an element of a collection typed property.
Declaration
Swift
open func atIndex(_ itemIndex: Int) -> DataPath
Parameters
itemIndex
Zero-based index of the element in the collection.
Return Value
This data path.
-
Data type with a
DataType.code
ofDataType.PATH
,DataType.PATH_EXPRESSION
,DataType.ANNOTATION_PATH
,DataType.NAVIGATION_PATH
,DataType.STRUCTURAL_PATH
, orDataType.DYNAMIC_PATH
.Declaration
Swift
override open var dataType: DataType
-
The defined property for a single-part path or the terminating defined property for a multi-part path.
See also
of
,path
.Declaration
Swift
open var definedProperty: Property?
-
Construct a new multi-part path, with this path as the
parentPath
.Declaration
Swift
open func dynamicPath(_ child: String) -> DataPath
Parameters
child
Value for
dynamicProperty
in the new path.Return Value
A new multi-part path.
-
The dynamic property for a single-part path or the terminating dynamic property for a multi-part path.
See also
ofDynamic
,dynamicPath
.Declaration
Swift
open var dynamicProperty: String?
-
The entity key of the element in an entity collection.
Declaration
Swift
open var entityKey: EntityKey?
-
Returns true if data path has segments.
Declaration
Swift
open func hasSegments() -> Bool
-
true
if this path has typeDataType.NAVIGATION_PATH
.Declaration
Swift
open var isNavigation: Bool
-
true
if this path has typeDataType.STRUCTURAL_PATH
.Declaration
Swift
open var isStructural: Bool
-
The index of an element in a collection.
Declaration
Swift
open var itemIndex: Int?
-
Construct a lambda variable path (for use with ‘any’ and ‘all’ lambda operators).
Declaration
Swift
open class func lambda(_ name: String) -> DataPath
Parameters
name
Lambda variable name.
Return Value
A new lambda-variable path.
-
The lambda variable name for a lambda variable path.
See also
lambda
.Declaration
Swift
open var lambdaVariable: String?
-
Construct a new single-part path.
Declaration
Swift
open class func of(_ start: Property) -> DataPath
Parameters
start
Value for
definedProperty
in the new path.Return Value
A new single-part path.
-
Construct a new single-part path.
Declaration
Swift
open class func ofDynamic(_ start: String) -> DataPath
Parameters
start
Value for
dynamicProperty
in the new path.Return Value
A new single-part path.
-
The parent path for a multi-part path;
nil
for a single-part path.See also
path
.Declaration
Swift
open var parentPath: DataPath?
-
Construct a new multi-part path, with this path as the
parentPath
.Declaration
Swift
open func path(_ child: Property) -> DataPath
Parameters
child
Value for
definedProperty
in the new path.Return Value
A new multi-part path.
-
The ‘/’-separated segments in this path, as a list.
Declaration
Swift
open var pathSegments: StringList
-
The
definedProperty
from the topmostparentPath
in this path, ornil
if unknown.Declaration
Swift
open var rootProperty: Property?
-
Declaration
Swift
override open func toPath() -> DataPath
Return Value
this property or path, expressed as a
DataPath
. -
Return the OData CSDL path expression syntax for this path (‘/’-separated segments).
Declaration
Swift
override open func toString() -> String
-
Declaration
Swift
override open func unwrap() -> DataValue
Return Value
The path, property, constant value or query function/operator call which is wrapped by this object.
-
Sets the entity key to address an element of an entity collection.
Declaration
Swift
open func withKey(_ entityKey: EntityKey) -> DataPath
Parameters
entityKey
Entity key of the element in the entity collection.
Return Value
This data path.
-
Construct a data path with the specified
type
andsegments
.Declaration
Swift
open class func withSegments(type: Int, segments: StringList) -> DataPath
Parameters
type
Value for
pathType
.segments
Value for
pathSegments
.