public abstract class UriParser extends Object
Constructor and Description |
---|
UriParser() |
Modifier and Type | Method and Description |
---|---|
abstract ExpandSelectTreeNode |
buildExpandSelectTree(List<SelectItem> select,
List<ArrayList<NavigationPropertySegment>> expand)
Creates an optimized expression tree out of $expand and $select expressions.
|
protected abstract PathSegment |
buildPathSegment(String path,
Map<String,List<String>> matrixParameters)
Creates an path segment object.
|
static ExpandSelectTreeNode |
createExpandSelectTree(List<SelectItem> select,
List<ArrayList<NavigationPropertySegment>> expand)
Creates an optimized expression tree out of $expand and $select expressions.
|
static PathSegment |
createPathSegment(String path,
Map<String,List<String>> matrixParameters)
Creates an path segment object.
|
abstract List<KeyPredicate> |
getKeyFromEntityLink(EdmEntitySet entitySet,
String entityLink,
URI serviceRoot)
Retrieves the key predicates from a canonical link to an entity.
|
static List<KeyPredicate> |
getKeyPredicatesFromEntityLink(EdmEntitySet entitySet,
String entityLink,
URI serviceRoot)
Retrieves the key predicates from a canonical link to an entity.
|
static UriInfo |
parse(Edm edm,
List<PathSegment> pathSegments,
Map<String,String> queryParameters)
Parses path segments and query parameters for the given EDM.
|
abstract UriInfo |
parse(List<PathSegment> pathSegments,
Map<String,String> queryParameters)
Parses path segments and query parameters.
|
abstract UriInfo |
parseAll(List<PathSegment> pathSegments,
Map<String,List<String>> allQueryParameters)
Parses path segments and query parameters.
|
static FilterExpression |
parseFilter(Edm edm,
EdmEntityType edmType,
String expression)
Parses a $filter expression string and create an expression tree.
|
abstract FilterExpression |
parseFilterString(EdmEntityType edmType,
String expression)
Parses a $filter expression string and create an expression tree.
|
static OrderByExpression |
parseOrderBy(Edm edm,
EdmEntityType edmType,
String expression)
Parses a $orderby expression string and creates an expression tree.
|
abstract OrderByExpression |
parseOrderByString(EdmEntityType edmType,
String expression)
Parses a $orderby expression string and creates an expression tree.
|
public static UriInfo parse(Edm edm, List<PathSegment> pathSegments, Map<String,String> queryParameters) throws ODataException
edm
- Entity Data ModelpathSegments
- list of path segmentsqueryParameters
- query parametersUriInfo
information about the parsed URIODataException
public abstract UriInfo parse(List<PathSegment> pathSegments, Map<String,String> queryParameters) throws UriSyntaxException, UriNotMatchingException, EdmException
pathSegments
- list of path segmentsqueryParameters
- query parametersUriInfo
information about the parsed URIUriSyntaxException
UriNotMatchingException
EdmException
public abstract UriInfo parseAll(List<PathSegment> pathSegments, Map<String,List<String>> allQueryParameters) throws UriSyntaxException, UriNotMatchingException, EdmException
pathSegments
- list of path segmentsqueryParameters
- query parametersUriInfo
information about the parsed URIUriSyntaxException
UriNotMatchingException
EdmException
public static FilterExpression parseFilter(Edm edm, EdmEntityType edmType, String expression) throws ExpressionParserException, ODataMessageException
The current expression parser supports expressions as defined in the OData specification 2.0 with the following restrictions:
The expression parser can be used with providing an Entity Data Model (EDM) and without providing it. When an EDM is provided the expression parser will be as strict as possible. That means:
edm
- entity data model of the accessed OData serviceedmType
- EDM type of the OData entity/complex type/... addressed by the URLexpression
- $filter expression string to be parsedExpressionVisitor
and
Visitable
ExpressionParserException
- thrown due to errors while parsing the $filter expression stringODataMessageException
- for extensibilitypublic abstract FilterExpression parseFilterString(EdmEntityType edmType, String expression) throws ExpressionParserException, ODataMessageException
The current expression parser supports expressions as defined in the OData specification 2.0 with the following restrictions:
The expression parser can be used with providing an Entity Data Model (EDM) and without providing it. When an EDM is provided the expression parser will be as strict as possible. That means:
edmType
- EDM type of the OData entity/complex type/... addressed by the URLexpression
- $filter expression string to be parsedExpressionVisitor
and
Visitable
ExpressionParserException
- thrown due to errors while parsing the $filter expression stringODataMessageException
- for extensibilitypublic static OrderByExpression parseOrderBy(Edm edm, EdmEntityType edmType, String expression) throws ExpressionParserException, ODataMessageException
edm
- EDM model of the accessed OData serviceedmType
- EDM type of the OData entity/complex type/... addressed by the URLexpression
- $orderby expression string to be parsedExpressionVisitor
and
Visitable
ExpressionParserException
- thrown due to errors while parsing the $orderby expression stringODataMessageException
- used for extensibilitypublic abstract OrderByExpression parseOrderByString(EdmEntityType edmType, String expression) throws ExpressionParserException, ODataMessageException
edmType
- EDM type of the OData entity/complex type/... addressed by the URLexpression
- $orderby expression string to be parsedExpressionVisitor
and
Visitable
ExpressionParserException
- thrown due to errors while parsing the $orderby expression stringODataMessageException
- used for extensibilitypublic static ExpandSelectTreeNode createExpandSelectTree(List<SelectItem> select, List<ArrayList<NavigationPropertySegment>> expand) throws EdmException
select
- List of select items
expand
- List of Lists of navigation property segments
ExpandSelectTreeNode
EdmException
public abstract ExpandSelectTreeNode buildExpandSelectTree(List<SelectItem> select, List<ArrayList<NavigationPropertySegment>> expand) throws EdmException
select
- List of select items
expand
- List of Lists of navigation property segments
ExpandSelectTreeNode
EdmException
protected abstract PathSegment buildPathSegment(String path, Map<String,List<String>> matrixParameters)
path
- path of created path segmentmatrixParameters
- Map of Lists of matrix parameters for this path segment (can be null if no matrix
parameters should be set for this path segment)public static PathSegment createPathSegment(String path, Map<String,List<String>> matrixParameters)
path
- path of created path segmentmatrixParameters
- Map of Lists of matrix parameters for this path segment (can be null if no matrix
parameters should be set for this path segment)public static List<KeyPredicate> getKeyPredicatesFromEntityLink(EdmEntitySet entitySet, String entityLink, URI serviceRoot) throws ODataException
Retrieves the key predicates from a canonical link to an entity.
A canonical link to an entity must follow the pattern
[<service root>][<entityContainer>.]<entitySet>(<key>)
, i.e.,
it must be a relative or absolute URI consisting of an entity set (qualified
with an entity-container name if not in the default entity container) and a
syntactically valid key that identifies a single entity; example:
http://example.server.com/service.svc/Employees('42')
.
entitySet
- the entity set the entity belongs toentityLink
- the link as StringserviceRoot
- the root URI of the service, may be null
for a relative link URIODataException
- in case the link is malformedpublic abstract List<KeyPredicate> getKeyFromEntityLink(EdmEntitySet entitySet, String entityLink, URI serviceRoot) throws ODataException
entitySet
- the entity set the entity belongs toentityLink
- the link as StringserviceRoot
- the root URI of the service, may be null
for a relative link URIODataException
- in case the link is malformedgetKeyPredicatesFromEntityLink(org.apache.olingo.odata2.api.edm.EdmEntitySet, java.lang.String, java.net.URI)
Copyright © 2013-2017 The Apache Software Foundation. All Rights Reserved.