DataPath
open class DataPath : PropertyPath, BindingPath
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 an entity collection.
Declaration
Swift
open func atIndex(_ itemIndex: Int) -> DataPath
Parameters
itemIndex
Zero-based index of the element in the collection.
Return Value
This data path.
-
Declaration
Swift
open func changeRoot(newRoot: DataPath) -> DataPath
Parameters
newRoot
Replacement for
rootProperty
.Return Value
A copy of this data path with the
rootProperty
changed. -
Declaration
Swift
override open func copyMutable() -> DataValue
Return Value
A clone of this value if it (together with all value subcomponents) is possibly mutable, or return
self
value if it (together with all value subcomponents) is definitely immutable. The resulting value might share mutable metadata with this query. -
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 { get }
-
The defined property for a single-part path or the terminating defined property for a multi-part path.
See also
of
,path
.Declaration
Swift
@inline(__always) public final var definedProperty: Property? { get }
-
Declaration
Swift
open func dotString() -> String
Return Value
the OData CSDL path expression syntax for this path (‘.’-separated segments).
-
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
@inline(__always) public final var dynamicProperty: String? { get }
-
The entity key in an entity collection.
Declaration
Swift
open var entityKey: EntityKey? { get }
-
The entity set for an entity collection.
Declaration
Swift
open var entitySet: EntitySet? { get }
-
Declaration
Swift
open func hasSegments() -> Bool
Return Value
true
if this path has segments. -
true
if this path has typeDataType.NAVIGATION_PATH
.Declaration
Swift
open var isNavigation: Bool { get }
-
Declaration
Swift
open func isNavigationProperty(_ property: Property? = nil) -> Bool
Parameters
property
Specified target property, or `null’ to check if this path is a simple navigation property path.
Return Value
true
if this path is simply for the specified target navigationproperty
. -
Declaration
Swift
open func isProperty(_ property: Property? = nil) -> Bool
Parameters
property
Specified target property, or `null’ to check if this path is a simple property path.
Return Value
true
if this path is simply for the specified targetproperty
. -
true
if this path has typeDataType.STRUCTURAL_PATH
.Declaration
Swift
open var isStructural: Bool { get }
-
Declaration
Swift
open func isStructuralProperty(_ property: Property? = nil) -> Bool
Parameters
property
Specified target property, or `null’ to check if this path is a simple structural property path.
Return Value
true
if this path is simply for the specified target structuralproperty
. -
The index of an element in a collection.
Declaration
Swift
open var itemIndex: Int? { get }
-
Declaration
Swift
open class func lambda(_ name: String, _ type: StructureType? = nil) -> DataPath
Parameters
name
Lambda variable name.
type
Lambda variable type.
Return Value
A new lambda-variable path (for use with ‘any’ and ‘all’ lambda operators).
-
The lambda variable type for a lambda variable path.
See also
lambda
.Declaration
Swift
@inline(__always) public final var lambdaType: StructureType? { get }
-
The lambda variable name for a lambda variable path.
See also
lambda
.Declaration
Swift
@inline(__always) public final var lambdaVariable: String? { get }
-
Declaration
Swift
open class func of(_ property: Property) -> DataPath
Parameters
property
Value for
definedProperty
in the new path.Return Value
A new property 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? { get }
-
Declaration
Swift
open func path(_ child: Property) -> DataPath
Parameters
child
Value for
definedProperty
in the new path.Return Value
A new multi-part path, with this path as the
parentPath
. -
The ‘/’-separated segments in this path, as a list.
Declaration
Swift
open var pathSegments: StringList { get }
-
Data type code of
DataType.PATH
,DataType.PATH_EXPRESSION
,DataType.ANNOTATION_PATH
,DataType.NAVIGATION_PATH
,DataType.STRUCTURAL_PATH
, orDataType.DYNAMIC_PATH
.Declaration
Swift
open var pathType: Int { get }
-
Declaration
Swift
open func resolveType() -> DataType
Return Value
The resolved data type of this path, or
DataType.unknown
if it cannot be determined statically. -
The
DataPath
at the root of this path. The root path has noparentPath
.Declaration
Swift
open var rootPath: DataPath { get }
-
The
definedProperty
from the topmostparentPath
in this path, ornil
if unknown.Declaration
Swift
open var rootProperty: Property? { get }
-
The number of segments in this path.
Declaration
Swift
open var segmentCount: Int { get }
-
See also
withSegments
.Declaration
Swift
open class func toDynamic(segments: StringList) -> DataPath
Parameters
segments
Path segments. Must not be empty.
Return Value
A new data path with the specified
type
, using chainedparentPath
anddynamicProperty
rather thanpathSegments
. -
Declaration
Swift
override open func toPath() -> DataPath
Return Value
this property or path, expressed as a
DataPath
. -
Declaration
Swift
override open func toString() -> String
Return Value
the OData CSDL path expression syntax for this path (‘/’-separated segments).
-
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.
-
Declaration
Swift
open func withParent(_ parent: DataPath) -> DataPath
Parameters
parent
Parent for the copied path.
Return Value
A copy of this data path with the specified
parent
as theparentPath
of the priorrootPath
. -
Declaration
Swift
open class func withSegments(type: Int, segments: StringList) -> DataPath
Parameters
type
Value for
pathType
.segments
Value for
pathSegments
.Return Value
A new data path with the specified
type
andsegments
.