public class

PropertyPathHelper

extends Object
java.lang.Object
   ↳ org.odata4j.producer.PropertyPathHelper

Class Overview

Helps producers determine if a property is $selected and/or $expanded.

Note on recursive extensions: The idea here is that when one has an object graph that is a tree of like nodes (such as a class hierarchy), it should be possible to specify a $expand that is applied recursively.

Two new custom options are proposed:

expandR and selectR

ABNF:

 expandRQueryOp = "expandR=" recursiveExpandClause *("," recursiveExpandClause)
 recursiveExpandClause = entityNavProperty "/" expandDepth
 expandDepth = integer

 selectRQueryOp = "selectR=" recursiveSelectClause *("," recursiveSelectClause)
 recursiveSelectClause = rSelectItem *("," recursiveSelectClause)
 rSelectItem = selectedNavProperty "/" rPropItem
 rPropItem = "*" / selectedProperty
 

expandDepth drives the number of traversal iterations. An expandDepth of 0 is unlimited. During query processing, the max expandDepth of all recursivExpandClauses is computed and drives processing.

example: expandR=SubTypes/0,Properties/1

This says that at each position in the object graph traversal during query we will expand the SubTypes navigation property. At the first level we will also expand the Properties navigation property

 selectR=SubTypes/Namespace,SubTypes/Type
 

This says that whenever we expand the SubTypes navigation property we will only include Namespace and Type properties.

Summary

Constants
String OptionExpandR
String OptionSelectR
Fields
private PropertyPath currentNavPath
protected List<PropertyPath> expandPaths
protected List<RecursivePropertyPath> expandRPaths
protected List<PropertyPath> selectPaths
protected List<PropertyPath> selectRPaths
Public Constructors
PropertyPathHelper(String select, String expand)
PropertyPathHelper(String select, String expand, String selectR, String expandR)
PropertyPathHelper(List<EntitySimpleProperty> select, List<EntitySimpleProperty> expand)
PropertyPathHelper(List<EntitySimpleProperty> select, List<EntitySimpleProperty> expand, String selectR, String expandR)
Public Methods
int getCurrentDepth()
PropertyPath getCurrentNavPath()
boolean isExpanded(String navPropName)
boolean isRecursive()
boolean isSelected(String propName)
Determines if the given property is selected on the current navigation path.
void navigate(String propName)
void popPath()
String toString()
Protected Methods
boolean isExpandedExplicit(String navPropName)
determines if the given navigation property is expanded on the current navigation path
boolean isExpandedRecursive(String navPropName)
boolean isSelectionLimited()
Returns true if the $select contains any limiting items on the current navPath.
boolean isSelectionLimitedRecursive()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String OptionExpandR

Constant Value: "expandR"

public static final String OptionSelectR

Constant Value: "selectR"

Fields

private PropertyPath currentNavPath

protected List<PropertyPath> expandPaths

protected List<RecursivePropertyPath> expandRPaths

protected List<PropertyPath> selectPaths

protected List<PropertyPath> selectRPaths

Public Constructors

public PropertyPathHelper (String select, String expand)

Parameters
select
expand

public PropertyPathHelper (String select, String expand, String selectR, String expandR)

Parameters
select
expand
selectR
expandR

public PropertyPathHelper (List<EntitySimpleProperty> select, List<EntitySimpleProperty> expand)

Parameters
select
expand

public PropertyPathHelper (List<EntitySimpleProperty> select, List<EntitySimpleProperty> expand, String selectR, String expandR)

Parameters
select
expand
selectR
expandR

Public Methods

public int getCurrentDepth ()

public PropertyPath getCurrentNavPath ()

public boolean isExpanded (String navPropName)

Parameters
navPropName

public boolean isRecursive ()

public boolean isSelected (String propName)

Determines if the given property is selected on the current navigation path.

Parameters
propName Name of a regular property or a navigation property
Returns
  • true if property is selected, false if not

public void navigate (String propName)

Parameters
propName

public void popPath ()

public String toString ()

Protected Methods

protected boolean isExpandedExplicit (String navPropName)

determines if the given navigation property is expanded on the current navigation path

Parameters
navPropName

protected boolean isExpandedRecursive (String navPropName)

Parameters
navPropName

protected boolean isSelectionLimited ()

Returns true if the $select contains any limiting items on the current navPath.

Returns
  • true if select is limited, false if not

protected boolean isSelectionLimitedRecursive ()