|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceElement
Element in a resource tree
The Resource portion of an SData URL is the portion from the contract up to the end of the URL or to the question mark that denotes the beginning of the query. It consists of a list of elements, which may be special elements, resource sets, single resources (or properties, but these cannot be distinguished from resource sets).
An element whose name begins with a dollar sign is a Special element. For example the $schema element denotes the schema of the Set above it. For some Special elements there may be Elements after it (such as $service) but for others (such as $template) the element must be last in the list and preceded by a Set.
An element consisting of merely a name is (normally) a Set. It is a plural name and denotes a set of resources. For example customers means "the customers" as a set, and the set may be constrained by a "where" clause.
At the end of the list an element consisting of merely a name may actually be a Property, basically a field.
The parsing cannot distinguish a Set from a Property; that depends on the handlers.
An element consisting of a name followed by something in parentheses denotes a single resource. What appears between the parentheses defines which resource it is. It may be an explicit key surrounded by single quotes or else it may be an expression in the SData Query language which (hopefully) defines a single resource.
For the time being there is a third option for defining a single resource, which may be deprecated soon. That is an Accpac predicate expression denoting a particular record, for example the first or last or previous or next of a key.
Nested Class Summary | |
---|---|
static class |
ResourceElement.Navigation
|
static class |
ResourceElement.Type
An enumeration of the types of resource element |
Method Summary | |
---|---|
java.lang.String |
getKey()
the key identifying which individual resource, in the sdata form |
java.lang.String |
getName()
the name of the element |
ResourceElement.Navigation |
getNavigation()
Gets the ResourceElement.Navigation method of the Resource Element |
com.sage.swt.common.filter.QueryExpression |
getQuery()
the query identifying which individual resource. |
ResourceElement.Type |
getType()
the type of the element |
boolean |
isAbsolute()
returns true if the navigation is absolute, FIRST or LAST |
boolean |
isRelative()
returns true if the navigation is relative to the key, CURRENT, PREVIOUS or NEXT |
Method Detail |
---|
java.lang.String getName()
ResourceElement.Type getType()
java.lang.String getKey()
It is up to the application to split the key into parts if the application supports multipart keys
java.lang.UnsupportedOperationException
- if the element is not a Single resourcecom.sage.swt.common.filter.QueryExpression getQuery()
java.lang.UnsupportedOperationException
- if the element is not a Single resourceResourceElement.Navigation getNavigation()
ResourceElement.Navigation
method of the Resource Element
ResourceElement.Navigation
method of the Resource Elementboolean isAbsolute()
boolean isRelative()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |