public class DataPath extends 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.
Modifier and Type | Method and Description |
---|---|
DataPath |
atIndex(int itemIndex)
Sets the item index to address an element of a collection typed property.
|
static DataPath |
castOptional(DataValue value)
For internal use only.
|
static DataPath |
castRequired(DataValue value)
For internal use only.
|
DataPath |
dynamicPath(java.lang.String child)
Construct a new multi-part path, with this path as the
DataPath.parentPath . |
DataType |
getDataType()
Data type with a
DataType.code of DataType.PATH, DataType.PATH_EXPRESSION, DataType.ANNOTATION_PATH, DataType.NAVIGATION_PATH, DataType.STRUCTURAL_PATH, or DataType.DYNAMIC_PATH. |
Property |
getDefinedProperty()
(nullable) The defined property for a single-part path or the terminating defined property for a multi-part path.
|
java.lang.String |
getDynamicProperty()
(nullable) The dynamic property for a single-part path or the terminating dynamic property for a multi-part path.
|
EntityKey |
getEntityKey()
(nullable) The entity key of the element in an entity collection.
|
java.lang.Integer |
getItemIndex()
(nullable) The index of an element in a collection.
|
java.lang.String |
getLambdaVariable()
(nullable) The lambda variable name for a lambda variable path.
|
DataPath |
getParentPath()
(nullable) The parent path for a multi-part path;
null for a single-part path. |
StringList |
getPathSegments()
The '/'-separated segments in this path, as a list.
|
Property |
getRootProperty()
(nullable) The
DataPath.definedProperty from the topmost DataPath.parentPath in this path, or null if unknown. |
boolean |
hasSegments()
Returns true if data path has segments.
|
boolean |
isNavigation()
true if this path has type DataType.NAVIGATION_PATH. |
boolean |
isStructural()
true if this path has type DataType.STRUCTURAL_PATH. |
static DataPath |
lambda(java.lang.String name)
Construct a lambda variable path (for use with 'any' and 'all' lambda operators).
|
static DataPath |
of(Property start)
Construct a new single-part path.
|
static DataPath |
ofDynamic(java.lang.String start)
Construct a new single-part path.
|
DataPath |
path(Property child)
Construct a new multi-part path, with this path as the
DataPath.parentPath . |
DataPath |
toPath()
Return this property or path, expressed as a
DataPath . |
java.lang.String |
toString()
Return the OData CSDL path expression syntax for this path ('/'-separated segments).
|
DataValue |
unwrap()
Return the path, property, constant value or query function/operator call which is wrapped by this object.
|
DataPath |
withKey(EntityKey entityKey)
Sets the entity key to address an element of an entity collection.
|
static DataPath |
withSegments(int type,
StringList segments)
Construct a data path with the specified
type and segments . |
add, add, add, add, add, add, add, all, any, asType, average, ceiling, concat, concat, contains, contains, countDistinct, date, day, divide, divide, divide, divide, divide, divide, divide, endsWith, endsWith, equal, equal, equal, equal, equal, equal, equal, equal, equal, floor, fractionalSeconds, geoDistance, geoIntersectse, geoLength, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterEqual, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, has, hour, indexOf, indexOf, isNull, isType, length, lessEqual, lessEqual, lessEqual, lessEqual, lessEqual, lessEqual, lessEqual, lessEqual, lessEqual, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, lessThan, maximum, minimum, minute, modulo, modulo, modulo, modulo, modulo, modulo, modulo, month, multiply, multiply, multiply, multiply, multiply, multiply, multiply, negate, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notEqual, notNull, round, second, startsWith, startsWith, substring, substring, substring, substring, subtract, subtract, subtract, subtract, subtract, subtract, subtract, sum, time, toLower, totalOffsetMinutes, toUpper, trim, wrap, year
cloneMutable, equals, getTypeCode, hashCode
public DataPath atIndex(int itemIndex)
Sets the item index to address an element of a collection typed property.
itemIndex
- Zero-based index of the element in the collection.public DataPath dynamicPath(java.lang.String child)
Construct a new multi-part path, with this path as the DataPath.parentPath
.
child
- Value for DataPath.dynamicProperty
in the new path.public DataType getDataType()
Data type with a DataType.code
of DataType.PATH, DataType.PATH_EXPRESSION, DataType.ANNOTATION_PATH, DataType.NAVIGATION_PATH, DataType.STRUCTURAL_PATH, or DataType.DYNAMIC_PATH.
getDataType
in class QueryValue
public Property getDefinedProperty()
(nullable) The defined property for a single-part path or the terminating defined property for a multi-part path.
public java.lang.String getDynamicProperty()
(nullable) The dynamic property for a single-part path or the terminating dynamic property for a multi-part path.
public EntityKey getEntityKey()
(nullable) The entity key of the element in an entity collection.
public java.lang.Integer getItemIndex()
(nullable) The index of an element in a collection.
public java.lang.String getLambdaVariable()
(nullable) The lambda variable name for a lambda variable path.
public DataPath getParentPath()
(nullable) The parent path for a multi-part path; null
for a single-part path.
public StringList getPathSegments()
The '/'-separated segments in this path, as a list.
public Property getRootProperty()
(nullable) The DataPath.definedProperty
from the topmost DataPath.parentPath
in this path, or null
if unknown.
public boolean hasSegments()
Returns true if data path has segments.
public boolean isNavigation()
true
if this path has type DataType.NAVIGATION_PATH.
public boolean isStructural()
true
if this path has type DataType.STRUCTURAL_PATH.
public static DataPath lambda(java.lang.String name)
Construct a lambda variable path (for use with 'any' and 'all' lambda operators).
name
- Lambda variable name.public static DataPath of(Property start)
Construct a new single-part path.
start
- Value for DataPath.definedProperty
in the new path.public static DataPath ofDynamic(java.lang.String start)
Construct a new single-part path.
start
- Value for DataPath.dynamicProperty
in the new path.public DataPath path(Property child)
Construct a new multi-part path, with this path as the DataPath.parentPath
.
child
- Value for DataPath.definedProperty
in the new path.public DataPath toPath()
Return this property or path, expressed as a DataPath
.
toPath
in class PropertyPath
DataPath
.public java.lang.String toString()
Return the OData CSDL path expression syntax for this path ('/'-separated segments).
toString
in class QueryValue
public DataValue unwrap()
Return the path, property, constant value or query function/operator call which is wrapped by this object.
unwrap
in class QueryValue
public DataPath withKey(EntityKey entityKey)
Sets the entity key to address an element of an entity collection.
entityKey
- Entity key of the element in the entity collection.public static DataPath withSegments(int type, StringList segments)
Construct a data path with the specified type
and segments
.
type
- Value for DataPath.pathType
.segments
- Value for DataPath.pathSegments
.