You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/02/20 14:28:32 UTC
[6/9] git commit: [OLINGO-63] Uri Parser: add special handling for
leading type filter in member, expand, select
[OLINGO-63] Uri Parser: add special handling for leading type filter in member, expand, select
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/commit/32467b8d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/tree/32467b8d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/diff/32467b8d
Branch: refs/heads/olingo169
Commit: 32467b8d6295efea354ae5e28c15f329c38bf8d1
Parents: 30ca8f0
Author: Sven Kobler <sv...@sap.com>
Authored: Thu Feb 20 12:26:16 2014 +0100
Committer: Sven Kobler <sv...@sap.com>
Committed: Thu Feb 20 12:26:44 2014 +0100
----------------------------------------------------------------------
.../odata4/server/api/uri/UriInfoResource.java | 4 +-
.../api/uri/UriResourceStartingTypeFilter.java | 29 -
.../server/api/uri/queryoption/CountOption.java | 25 +
.../server/api/uri/queryoption/ExpandItem.java | 8 +-
.../api/uri/queryoption/InlineCountOption.java | 25 -
.../server/api/uri/queryoption/SelectItem.java | 5 +-
.../api/uri/queryoption/expression/Member.java | 6 +-
.../odata4/server/core/uri/antlr/UriParser.g4 | 3 +-
.../odata4/server/core/uri/UriInfoImpl.java | 296 ++++++++++
.../server/core/uri/UriParameterImpl.java | 83 +++
.../server/core/uri/UriParserException.java | 36 --
.../core/uri/UriParserSemanticException.java | 37 --
.../core/uri/UriParserSyntaxException.java | 36 --
.../server/core/uri/UriResourceActionImpl.java | 77 +++
.../uri/UriResourceComplexPropertyImpl.java | 70 +++
.../server/core/uri/UriResourceCountImpl.java | 35 ++
.../core/uri/UriResourceEntitySetImpl.java | 67 +++
.../core/uri/UriResourceFunctionImpl.java | 111 ++++
.../odata4/server/core/uri/UriResourceImpl.java | 39 ++
.../server/core/uri/UriResourceItImpl.java | 65 +++
.../core/uri/UriResourceLambdaAllImpl.java | 73 +++
.../core/uri/UriResourceLambdaAnyImpl.java | 72 +++
.../core/uri/UriResourceLambdaVarImpl.java | 70 +++
.../uri/UriResourceNavigationPropertyImpl.java | 63 ++
.../uri/UriResourcePrimitivePropertyImpl.java | 59 ++
.../server/core/uri/UriResourceRefImpl.java | 36 ++
.../server/core/uri/UriResourceRootImpl.java | 62 ++
.../core/uri/UriResourceSingletonImpl.java | 71 +++
.../uri/UriResourceStartingTypeFilterImpl.java | 68 +++
.../server/core/uri/UriResourceTypedImpl.java | 60 ++
.../server/core/uri/UriResourceValueImpl.java | 36 ++
.../core/uri/UriResourceWithKeysImpl.java | 99 ++++
.../server/core/uri/apiimpl/UriInfoImpl.java | 291 ---------
.../core/uri/apiimpl/UriParameterImpl.java | 83 ---
.../core/uri/apiimpl/UriResourceActionImpl.java | 77 ---
.../apiimpl/UriResourceComplexPropertyImpl.java | 70 ---
.../core/uri/apiimpl/UriResourceCountImpl.java | 35 --
.../uri/apiimpl/UriResourceEntitySetImpl.java | 67 ---
.../uri/apiimpl/UriResourceFunctionImpl.java | 111 ----
.../core/uri/apiimpl/UriResourceImpl.java | 39 --
.../core/uri/apiimpl/UriResourceItImpl.java | 65 ---
.../uri/apiimpl/UriResourceLambdaAllImpl.java | 73 ---
.../uri/apiimpl/UriResourceLambdaAnyImpl.java | 72 ---
.../uri/apiimpl/UriResourceLambdaVarImpl.java | 70 ---
.../UriResourceNavigationPropertyImpl.java | 63 --
.../UriResourcePrimitivePropertyImpl.java | 59 --
.../core/uri/apiimpl/UriResourceRefImpl.java | 36 --
.../core/uri/apiimpl/UriResourceRootImpl.java | 62 --
.../uri/apiimpl/UriResourceSingletonImpl.java | 71 ---
.../UriResourceStartingTypeFilterImpl.java | 68 ---
.../core/uri/apiimpl/UriResourceTypedImpl.java | 60 --
.../core/uri/apiimpl/UriResourceValueImpl.java | 36 --
.../uri/apiimpl/UriResourceWithKeysImpl.java | 99 ----
.../odata4/server/core/uri/parser/Parser.java | 6 +-
.../odata4/server/core/uri/parser/RawUri.java | 2 +-
.../server/core/uri/parser/UriContext.java | 2 +-
.../server/core/uri/parser/UriDecoder.java | 3 +-
.../core/uri/parser/UriParseTreeVisitor.java | 194 ++++--
.../core/uri/parser/UriParserException.java | 36 ++
.../uri/parser/UriParserSemanticException.java | 37 ++
.../uri/parser/UriParserSyntaxException.java | 36 ++
.../core/uri/queryoption/CountOptionImpl.java | 4 +-
.../core/uri/queryoption/ExpandItemImpl.java | 24 +-
.../core/uri/queryoption/SelectItemImpl.java | 17 +-
.../uri/queryoption/expression/MemberImpl.java | 23 +-
.../server/core/testutil/ExpandValidator.java | 221 -------
.../server/core/testutil/FilterTreeToText.java | 154 -----
.../server/core/testutil/FilterValidator.java | 518 ----------------
.../server/core/testutil/ParseTreeToText.java | 82 ---
.../server/core/testutil/ParserValidator.java | 243 --------
.../server/core/testutil/ParserWithLogging.java | 56 --
.../server/core/testutil/ResourceValidator.java | 571 ------------------
.../server/core/testutil/TestErrorLogger.java | 105 ----
.../server/core/testutil/TokenValidator.java | 194 ------
.../server/core/testutil/UriLexerWithTrace.java | 85 ---
.../server/core/testutil/UriValidator.java | 245 --------
.../odata4/server/core/testutil/Validator.java | 23 -
.../odata4/server/core/uri/RawUriTest.java | 1 +
.../odata4/server/core/uri/UriInfoImplTest.java | 3 -
.../server/core/uri/UriParameterImplTest.java | 22 +-
.../core/uri/antlr/TestFullResourcePath.java | 111 ++--
.../odata4/server/core/uri/antlr/TestLexer.java | 2 +-
.../server/core/uri/antlr/TestParser.java | 2 +-
.../core/uri/antlr/TestUriParserImpl.java | 70 ++-
.../core/uri/queryoption/QueryOptionTest.java | 6 +-
.../queryoption/expression/ExpressionTest.java | 24 +-
.../core/uri/testutil/ExpandValidator.java | 233 ++++++++
.../core/uri/testutil/FilterTreeToText.java | 154 +++++
.../core/uri/testutil/FilterValidator.java | 534 +++++++++++++++++
.../core/uri/testutil/ParseTreeToText.java | 82 +++
.../core/uri/testutil/ParserValidator.java | 243 ++++++++
.../core/uri/testutil/ParserWithLogging.java | 56 ++
.../core/uri/testutil/ResourceValidator.java | 583 +++++++++++++++++++
.../core/uri/testutil/TestErrorLogger.java | 105 ++++
.../core/uri/testutil/TokenValidator.java | 194 ++++++
.../core/uri/testutil/UriLexerWithTrace.java | 85 +++
.../server/core/uri/testutil/UriValidator.java | 258 ++++++++
.../server/core/uri/testutil/Validator.java | 23 +
98 files changed, 4638 insertions(+), 4467 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoResource.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoResource.java b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoResource.java
index 8d3a69a..8dca44f 100644
--- a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoResource.java
+++ b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriInfoResource.java
@@ -25,7 +25,7 @@ import org.apache.olingo.odata4.server.api.uri.queryoption.ExpandOption;
import org.apache.olingo.odata4.server.api.uri.queryoption.FilterOption;
import org.apache.olingo.odata4.server.api.uri.queryoption.FormatOption;
import org.apache.olingo.odata4.server.api.uri.queryoption.IdOption;
-import org.apache.olingo.odata4.server.api.uri.queryoption.InlineCountOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.CountOption;
import org.apache.olingo.odata4.server.api.uri.queryoption.OrderByOption;
import org.apache.olingo.odata4.server.api.uri.queryoption.SearchOption;
import org.apache.olingo.odata4.server.api.uri.queryoption.SelectOption;
@@ -45,7 +45,7 @@ public interface UriInfoResource {
IdOption getIdOption();
- InlineCountOption getInlineCountOption();
+ CountOption getInlineCountOption();
OrderByOption getOrderByOption();
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceStartingTypeFilter.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceStartingTypeFilter.java b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceStartingTypeFilter.java
deleted file mode 100644
index 1fb51c3..0000000
--- a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/UriResourceStartingTypeFilter.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ******************************************************************************/
-package org.apache.olingo.odata4.server.api.uri;
-
-import org.apache.olingo.odata4.commons.api.edm.EdmType;
-
-public interface UriResourceStartingTypeFilter extends UriResourcePartTyped {
-
- EdmType getTypeFilterOnCollection();
-
- EdmType getTypeFilterOnEntry();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CountOption.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CountOption.java b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CountOption.java
new file mode 100644
index 0000000..70cb0fb
--- /dev/null
+++ b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/CountOption.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.api.uri.queryoption;
+
+public interface CountOption extends SystemQueryOption {
+
+ boolean getValue();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandItem.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandItem.java b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandItem.java
index f1f9590..47b6a3e 100644
--- a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandItem.java
+++ b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/ExpandItem.java
@@ -18,6 +18,7 @@
******************************************************************************/
package org.apache.olingo.odata4.server.api.uri.queryoption;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
import org.apache.olingo.odata4.server.api.uri.UriInfoResource;
public interface ExpandItem {
@@ -34,16 +35,19 @@ public interface ExpandItem {
TopOption getTopOption();
- InlineCountOption getInlineCountOption();
+ CountOption getInlineCountOption();
SelectOption getSelectOption();
ExpandOption getExpandOption();
- UriInfoResource getResourceInfo();
+ UriInfoResource getResourcePath();
boolean isStar();
boolean isRef();
+ EdmType getStartTypeFilter();
+
+
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/InlineCountOption.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/InlineCountOption.java b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/InlineCountOption.java
deleted file mode 100644
index cb0066f..0000000
--- a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/InlineCountOption.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ******************************************************************************/
-package org.apache.olingo.odata4.server.api.uri.queryoption;
-
-public interface InlineCountOption extends SystemQueryOption {
-
- boolean getValue();
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectItem.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectItem.java b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectItem.java
index 04cef3e..f150f00 100644
--- a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectItem.java
+++ b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/SelectItem.java
@@ -18,6 +18,7 @@
******************************************************************************/
package org.apache.olingo.odata4.server.api.uri.queryoption;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
import org.apache.olingo.odata4.server.api.uri.UriInfoResource;
@@ -29,6 +30,8 @@ public interface SelectItem {
FullQualifiedName getAllOperationsInSchemaNameSpace();
- UriInfoResource getResourceInfo();
+ UriInfoResource getResourcePath();
+
+ EdmType getStartTypeFilter();
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Member.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Member.java b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Member.java
index 6670454..a764001 100644
--- a/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Member.java
+++ b/odata4-lib/odata4-server-api/src/main/java/org/apache/olingo/odata4/server/api/uri/queryoption/expression/Member.java
@@ -23,10 +23,14 @@ import org.apache.olingo.odata4.server.api.uri.UriInfoResource;
public interface Member extends Expression {
- public UriInfoResource getPath();
+ public UriInfoResource getResourcePath();
public EdmType getType();
+ public EdmType getStartTypeFilter();
public boolean isCollection();
+
+
+
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriParser.g4
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriParser.g4 b/odata4-lib/odata4-server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriParser.g4
index 0b246cb..d94302f 100644
--- a/odata4-lib/odata4-server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriParser.g4
+++ b/odata4-lib/odata4-server-core/src/main/antlr4/org/apache/olingo/odata4/server/core/uri/antlr/UriParser.g4
@@ -347,7 +347,7 @@ odataIdentifier : ODATAIDENTIFIER;
primitiveLiteral : nullrule
| booleanNonCase
| DECIMAL //includes double and single literals
- | NANINFINITY
+ | naninfinity
| INT //includes int16/int32 and int64 literals
| BINARY
| DATE
@@ -373,6 +373,7 @@ primitiveLiteral : nullrule
| geometryPolygon
;
+naninfinity : NANINFINITY;
nullrule : NULLVALUE;
booleanNonCase : BOOLEAN | TRUE | FALSE;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriInfoImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriInfoImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriInfoImpl.java
new file mode 100644
index 0000000..e527feb
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriInfoImpl.java
@@ -0,0 +1,296 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
+import org.apache.olingo.odata4.server.api.uri.UriInfo;
+import org.apache.olingo.odata4.server.api.uri.UriInfoAll;
+import org.apache.olingo.odata4.server.api.uri.UriInfoBatch;
+import org.apache.olingo.odata4.server.api.uri.UriInfoCrossjoin;
+import org.apache.olingo.odata4.server.api.uri.UriInfoEntityId;
+import org.apache.olingo.odata4.server.api.uri.UriInfoKind;
+import org.apache.olingo.odata4.server.api.uri.UriInfoMetadata;
+import org.apache.olingo.odata4.server.api.uri.UriInfoResource;
+import org.apache.olingo.odata4.server.api.uri.UriInfoService;
+import org.apache.olingo.odata4.server.api.uri.UriResource;
+import org.apache.olingo.odata4.server.api.uri.queryoption.CustomQueryOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.ExpandOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.FilterOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.FormatOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.IdOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.CountOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.OrderByOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.SearchOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.SelectOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.SkipOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.SkipTokenOption;
+import org.apache.olingo.odata4.server.api.uri.queryoption.SupportedQueryOptions;
+import org.apache.olingo.odata4.server.api.uri.queryoption.TopOption;
+import org.apache.olingo.odata4.server.core.uri.queryoption.CountOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.CustomQueryOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.ExpandOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.FilterOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.FormatOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.IdOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.OrderByOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.QueryOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.SearchOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.SelectOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.SkipOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.SkipTokenOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.SystemQueryOptionImpl;
+import org.apache.olingo.odata4.server.core.uri.queryoption.TopOptionImpl;
+
+public class UriInfoImpl implements UriInfo {
+
+ private UriInfoKind kind;
+
+ private List<String> entitySetNames = new ArrayList<String>(); // for $entity
+ private EdmEntityType entityTypeCast; // for $entity
+
+ // Query options
+ private List<CustomQueryOptionImpl> customQueryOptions = new ArrayList<CustomQueryOptionImpl>();
+ private ExpandOptionImpl expandOption;
+ private FilterOptionImpl filterOption;
+ private FormatOptionImpl formatOption;
+ private IdOption idOption;
+ private CountOptionImpl inlineCountOption;
+ private OrderByOptionImpl orderByOption;
+ private SearchOptionImpl searchOption;
+ private SelectOptionImpl selectOption;
+ private SkipOptionImpl skipOption;
+ private SkipTokenOptionImpl skipTokenOption;
+ private TopOptionImpl topOption;
+
+ private String fragment;
+
+ private UriResource lastResourcePart;
+ private List<UriResource> pathParts = new ArrayList<UriResource>();
+
+ @Override
+ public UriInfoAll asUriInfoAll() {
+ return this;
+ }
+
+ @Override
+ public UriInfoBatch asUriInfoBatch() {
+ return this;
+ }
+
+ @Override
+ public UriInfoCrossjoin asUriInfoCrossjoin() {
+ return this;
+ }
+
+ @Override
+ public UriInfoEntityId asUriInfoEntityId() {
+ return this;
+ }
+
+ @Override
+ public UriInfoMetadata asUriInfoMetadata() {
+ return this;
+ }
+
+ @Override
+ public UriInfoResource asUriInfoResource() {
+ return this;
+ }
+
+ @Override
+ public List<String> getEntitySetNames() {
+ return Collections.unmodifiableList(entitySetNames);
+ }
+
+ public void addEntitySetName(final String entitySet) {
+ entitySetNames.add(entitySet);
+ }
+
+ @Override
+ public List<UriResource> getUriResourceParts() {
+ List<UriResource> returnList = new ArrayList<UriResource>();
+ for (UriResource item : pathParts) {
+ returnList.add(item);
+ }
+ return Collections.unmodifiableList(returnList);
+ }
+
+ public UriInfoImpl addResourcePart(final UriResourceImpl uriPathInfo) {
+ pathParts.add(uriPathInfo);
+ lastResourcePart = uriPathInfo;
+ return this;
+ }
+
+ @Override
+ public List<CustomQueryOption> getCustomQueryOptions() {
+ List<CustomQueryOption> retList = new ArrayList<CustomQueryOption>();
+ for (CustomQueryOptionImpl item : customQueryOptions) {
+ retList.add(item);
+ }
+ return retList;
+ }
+
+ @Override
+ public EdmEntityType getEntityTypeCast() {
+ return entityTypeCast;
+ }
+
+ public UriInfoImpl setEntityTypeCast(final EdmEntityType type) {
+ entityTypeCast = type;
+ return this;
+ }
+
+ @Override
+ public ExpandOption getExpandOption() {
+ return expandOption;
+ }
+
+ @Override
+ public FilterOption getFilterOption() {
+ return filterOption;
+ }
+
+ @Override
+ public FormatOption getFormatOption() {
+ return formatOption;
+ }
+
+ @Override
+ public IdOption getIdOption() {
+ return idOption;
+ }
+
+ @Override
+ public CountOption getInlineCountOption() {
+ return inlineCountOption;
+ }
+
+ @Override
+ public UriInfoKind getKind() {
+ return kind;
+ }
+
+ public UriInfoImpl setKind(final UriInfoKind kind) {
+ this.kind = kind;
+ return this;
+ }
+
+ public UriResource getLastResourcePart() {
+ return lastResourcePart;
+ }
+
+ @Override
+ public OrderByOption getOrderByOption() {
+ return orderByOption;
+ }
+
+ @Override
+ public SearchOption getSearchOption() {
+
+ return searchOption;
+ }
+
+ @Override
+ public SelectOption getSelectOption() {
+ return selectOption;
+ }
+
+ @Override
+ public SkipOption getSkipOption() {
+ return skipOption;
+ }
+
+ @Override
+ public SkipTokenOption getSkipTokenOption() {
+ return skipTokenOption;
+ }
+
+ @Override
+ public TopOption getTopOption() {
+ return topOption;
+ }
+
+ public UriInfoImpl setQueryOptions(final List<QueryOptionImpl> list) {
+
+ for (QueryOptionImpl item : list) {
+ if (item instanceof SystemQueryOptionImpl) {
+ setSystemQueryOption((SystemQueryOptionImpl) item);
+ } else if (item instanceof CustomQueryOptionImpl) {
+ addCustomQueryOption(item);
+ }
+ }
+ return this;
+ }
+
+ public void addCustomQueryOption(final QueryOptionImpl item) {
+ customQueryOptions.add((CustomQueryOptionImpl) item);
+ }
+
+ public UriInfoImpl setSystemQueryOption(final SystemQueryOptionImpl systemOption) {
+
+ if (systemOption.getKind() == SupportedQueryOptions.EXPAND) {
+ expandOption = (ExpandOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.FILTER) {
+ filterOption = (FilterOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.FORMAT) {
+ formatOption = (FormatOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.ID) {
+ idOption = (IdOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.INLINECOUNT) {
+ inlineCountOption = (CountOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.ORDERBY) {
+ orderByOption = (OrderByOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.SEARCH) {
+ searchOption = (SearchOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.SELECT) {
+ selectOption = (SelectOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.SKIP) {
+ skipOption = (SkipOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.SKIPTOKEN) {
+ skipTokenOption = (SkipTokenOptionImpl) systemOption;
+ } else if (systemOption.getKind() == SupportedQueryOptions.TOP) {
+ topOption = (TopOptionImpl) systemOption;
+ }
+ return this;
+ }
+
+ @Override
+ public UriInfoService asUriInfoService() {
+ return this;
+ }
+
+ @Override
+ public String getFragment() {
+ return fragment;
+ }
+
+ public UriInfoImpl setFragment(final String fragment) {
+ this.fragment = fragment;
+ return this;
+ }
+
+ public void removeResourcePart(int index) {
+ this.pathParts.remove(index);
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParameterImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParameterImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParameterImpl.java
new file mode 100644
index 0000000..96e7162
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParameterImpl.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.server.api.uri.UriParameter;
+import org.apache.olingo.odata4.server.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.odata4.server.core.uri.queryoption.expression.ExpressionImpl;
+
+public class UriParameterImpl implements UriParameter {
+ private String name;
+ private String text;
+ private String alias;
+ private Expression expression;
+ private String referencedProperty;
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public UriParameterImpl setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public String getAlias() {
+ return alias;
+ }
+
+ public UriParameterImpl setAlias(final String alias) {
+ this.alias = alias;
+ return this;
+ }
+
+ @Override
+ public String getText() {
+ return text;
+ }
+
+ public UriParameterImpl setText(final String text) {
+ this.text = text;
+ return this;
+ }
+
+ @Override
+ public Expression getExression() {
+ return expression;
+ }
+
+ public UriParameterImpl setExpression(final ExpressionImpl expression) {
+ this.expression = expression;
+ return this;
+ }
+
+ @Override
+ public String getRefencedProperty() {
+ return referencedProperty;
+ }
+
+ public UriParameterImpl setRefencedProperty(final String referencedProperty) {
+ this.referencedProperty = referencedProperty;
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserException.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserException.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserException.java
deleted file mode 100644
index 826951c..0000000
--- a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ******************************************************************************/
-package org.apache.olingo.odata4.server.core.uri;
-
-//TODO Check name of this exception when implementing proper error handling
-public class UriParserException extends Exception {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public UriParserException(final String message, final Throwable cause) {
- super(message, cause);
- }
-
- public UriParserException(final String message) {
- super(message, null);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserSemanticException.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserSemanticException.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserSemanticException.java
deleted file mode 100644
index ad3e820..0000000
--- a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserSemanticException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ******************************************************************************/
-package org.apache.olingo.odata4.server.core.uri;
-
-//TODO Check name of this exception when implementing proper error handling
-public class UriParserSemanticException extends UriParserException {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public UriParserSemanticException(final String message, final Throwable cause) {
- super(message, cause);
- }
-
- public UriParserSemanticException(final String message) {
- super(message, null);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserSyntaxException.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserSyntaxException.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserSyntaxException.java
deleted file mode 100644
index 3125557..0000000
--- a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriParserSyntaxException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- ******************************************************************************/
-package org.apache.olingo.odata4.server.core.uri;
-
-public class UriParserSyntaxException extends UriParserException {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public UriParserSyntaxException(final String message, final Throwable cause) {
- super(message, cause);
- }
-
- public UriParserSyntaxException(final String message) {
- super(message, null);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceActionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceActionImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceActionImpl.java
new file mode 100644
index 0000000..e4b1113
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceActionImpl.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmAction;
+import org.apache.olingo.odata4.commons.api.edm.EdmActionImport;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceAction;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+
+public class UriResourceActionImpl extends UriResourceTypedImpl implements UriResourceAction {
+
+ protected EdmAction action;
+ protected EdmActionImport actionImport;
+
+ public UriResourceActionImpl() {
+ super(UriResourceKind.action);
+ }
+
+ @Override
+ public EdmAction getAction() {
+ return action;
+ }
+
+ public UriResourceActionImpl setAction(final EdmAction action) {
+ this.action = action;
+ return this;
+ }
+
+ @Override
+ public EdmActionImport getActionImport() {
+ return actionImport;
+ }
+
+ public UriResourceActionImpl setActionImport(final EdmActionImport actionImport) {
+ this.actionImport = actionImport;
+ setAction(actionImport.getAction());
+ return this;
+ }
+
+ @Override
+ public boolean isCollection() {
+ return action.getReturnType().isCollection();
+ }
+
+ @Override
+ public EdmType getType() {
+ return action.getReturnType().getType();
+ }
+
+ @Override
+ public String toString() {
+ if (actionImport != null) {
+ return actionImport.getName();
+ } else if (action != null) {
+ return action.getName();
+ }
+ return "";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceComplexPropertyImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceComplexPropertyImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceComplexPropertyImpl.java
new file mode 100644
index 0000000..18f803f
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceComplexPropertyImpl.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
+import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceComplexProperty;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+
+public class UriResourceComplexPropertyImpl extends UriResourceTypedImpl implements UriResourceComplexProperty {
+
+ protected EdmProperty property;
+
+ public UriResourceComplexPropertyImpl() {
+ super(UriResourceKind.complexProperty);
+ }
+
+ @Override
+ public EdmProperty getProperty() {
+ return property;
+ }
+
+ public UriResourceComplexPropertyImpl setProperty(final EdmProperty property) {
+ this.property = property;
+ return this;
+ }
+
+ @Override
+ public EdmComplexType getComplexType() {
+ return (EdmComplexType) getType();
+ }
+
+ @Override
+ public EdmComplexType getComplexTypeFilter() {
+ return (EdmComplexType) typeFilter;
+ }
+
+ @Override
+ public EdmType getType() {
+ return property.getType();
+ }
+
+ @Override
+ public boolean isCollection() {
+ return property.isCollection();
+ }
+
+ @Override
+ public String toString() {
+ return property.getName();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceCountImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceCountImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceCountImpl.java
new file mode 100644
index 0000000..179d174
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceCountImpl.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.server.api.uri.UriResourceCount;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+
+public class UriResourceCountImpl extends UriResourceImpl implements UriResourceCount {
+
+ public UriResourceCountImpl() {
+ super(UriResourceKind.count);
+ }
+
+ @Override
+ public String toString() {
+ return "$count";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceEntitySetImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceEntitySetImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceEntitySetImpl.java
new file mode 100644
index 0000000..8c1617a
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceEntitySetImpl.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceEntitySet;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+
+public class UriResourceEntitySetImpl extends UriResourceWithKeysImpl implements UriResourceEntitySet {
+ protected EdmEntitySet edmEntitySet = null;
+
+ public UriResourceEntitySetImpl() {
+ super(UriResourceKind.entitySet);
+ }
+
+ @Override
+ public EdmEntitySet getEntitySet() {
+ return edmEntitySet;
+ }
+
+ public UriResourceEntitySetImpl setEntitSet(final EdmEntitySet edmES) {
+ edmEntitySet = edmES;
+ return this;
+ }
+
+ @Override
+ public EdmEntityType getEntityType() {
+ return edmEntitySet.getEntityType();
+ }
+
+ @Override
+ public EdmType getType() {
+ return edmEntitySet.getEntityType();
+ }
+
+ @Override
+ public boolean isCollection() {
+ if (keyPredicates == null) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return edmEntitySet.getName();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceFunctionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceFunctionImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceFunctionImpl.java
new file mode 100644
index 0000000..5600d8c
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceFunctionImpl.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
+import org.apache.olingo.odata4.commons.api.edm.EdmFunctionImport;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriParameter;
+import org.apache.olingo.odata4.server.api.uri.UriResourceFunction;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+
+/**
+ * Covers Function imports and BoundFunction in URI
+ */
+public class UriResourceFunctionImpl extends UriResourceWithKeysImpl implements UriResourceFunction {
+
+ protected List<UriParameterImpl> parameters;
+ protected EdmFunction function;
+ protected EdmFunctionImport functionImport;
+ private boolean isParameterListFilled = false;
+
+ public UriResourceFunctionImpl() {
+ super(UriResourceKind.function);
+ }
+
+ @Override
+ public List<UriParameter> getParameters() {
+ List<UriParameter> retList = new ArrayList<UriParameter>();
+ for (UriParameterImpl item : parameters) {
+ retList.add(item);
+ }
+ return retList;
+ }
+
+ public UriResourceFunctionImpl setParameters(final List<UriParameterImpl> parameters) {
+ isParameterListFilled = true;
+ this.parameters = parameters;
+ return this;
+ }
+
+ @Override
+ public EdmFunction getFunction() {
+ return function;
+ }
+
+ public UriResourceFunctionImpl setFunction(final EdmFunction function) {
+ this.function = function;
+ return this;
+ }
+
+ @Override
+ public EdmFunctionImport getFunctionImport() {
+ return functionImport;
+ }
+
+ public UriResourceFunctionImpl setFunctionImport(final EdmFunctionImport edmFI,
+ final List<UriParameterImpl> parameters) {
+ functionImport = edmFI;
+
+ setParameters(parameters);
+
+ return this;
+ }
+
+ @Override
+ public EdmType getType() {
+ return function.getReturnType().getType();
+ }
+
+ @Override
+ public boolean isCollection() {
+ if (keyPredicates != null) {
+ return false;
+ }
+ return function.getReturnType().isCollection();
+ }
+
+ @Override
+ public String toString() {
+ if (functionImport != null) {
+ return functionImport.getName();
+ } else if (function != null) {
+ return function.getName();
+ }
+ return "";
+ }
+
+ public boolean isParameterListFilled() {
+ return isParameterListFilled;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceImpl.java
new file mode 100644
index 0000000..c0b04c6
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceImpl.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.server.api.uri.UriResource;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+
+/**
+ * Covers Functionimports and BoundFunction in URI
+ */
+public abstract class UriResourceImpl implements UriResource {
+ protected UriResourceKind kind;
+
+ public UriResourceImpl(final UriResourceKind kind) {
+ this.kind = kind;
+ }
+
+ @Override
+ public UriResourceKind getKind() {
+ return kind;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceItImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceItImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceItImpl.java
new file mode 100644
index 0000000..4d91f1a
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceItImpl.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceIt;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+
+/**
+ * Covers Functionimports and BoundFunction in URI
+ */
+public class UriResourceItImpl extends UriResourceWithKeysImpl implements UriResourceIt {
+
+ private EdmType type;
+ private boolean isCollection;
+
+ public UriResourceItImpl() {
+ super(UriResourceKind.it);
+ }
+
+ @Override
+ public EdmType getType() {
+ return type;
+ }
+
+ public UriResourceItImpl setType(final EdmType type) {
+ this.type = type;
+ return this;
+ }
+
+ @Override
+ public boolean isCollection() {
+ if (keyPredicates != null) {
+ return false;
+ }
+ return isCollection;
+ }
+
+ public UriResourceItImpl setCollection(final boolean isCollection) {
+ this.isCollection = isCollection;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return "$it";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaAllImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaAllImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaAllImpl.java
new file mode 100644
index 0000000..39ca238
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaAllImpl.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourceLambdaAll;
+import org.apache.olingo.odata4.server.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.odata4.server.core.uri.queryoption.expression.ExpressionImpl;
+
+public class UriResourceLambdaAllImpl extends UriResourceTypedImpl implements UriResourceLambdaAll {
+ protected EdmProperty property;
+ private String lamdaVariable;
+ private ExpressionImpl expression;
+
+ public UriResourceLambdaAllImpl() {
+ super(UriResourceKind.lambdaAll);
+ }
+
+ @Override
+ public EdmType getType() {
+ return EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance();
+ }
+
+ @Override
+ public boolean isCollection() {
+ return false;
+ }
+
+ @Override
+ public String getLamdaVariable() {
+ return lamdaVariable;
+ }
+
+ public UriResourceLambdaAllImpl setLamdaVariable(final String lamdaVariable) {
+ this.lamdaVariable = lamdaVariable;
+ return this;
+ };
+
+ @Override
+ public Expression getExpression() {
+ return expression;
+ }
+
+ public UriResourceLambdaAllImpl setExpression(final ExpressionImpl expression) {
+ this.expression = expression;
+ return this;
+ };
+
+ @Override
+ public String toString() {
+ return "all";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaAnyImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaAnyImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaAnyImpl.java
new file mode 100644
index 0000000..3a20c81
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaAnyImpl.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.commons.core.edm.primitivetype.EdmPrimitiveTypeKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourceLambdaAny;
+import org.apache.olingo.odata4.server.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.odata4.server.core.uri.queryoption.expression.ExpressionImpl;
+
+public class UriResourceLambdaAnyImpl extends UriResourceTypedImpl implements UriResourceLambdaAny {
+ protected EdmProperty property;
+ private String lamdaVariable;
+ private ExpressionImpl expression;
+
+ public UriResourceLambdaAnyImpl() {
+ super(UriResourceKind.lambdaAny);
+ }
+
+ @Override
+ public EdmType getType() {
+ return EdmPrimitiveTypeKind.Boolean.getEdmPrimitiveTypeInstance();
+ }
+
+ @Override
+ public boolean isCollection() {
+ return false;
+ }
+
+ @Override
+ public String getLamdaVariable() {
+ return lamdaVariable;
+ }
+
+ public UriResourceLambdaAnyImpl setLamdaVariable(final String lamdaVariable) {
+ this.lamdaVariable = lamdaVariable;
+ return this;
+ };
+
+ @Override
+ public Expression getExpression() {
+ return expression;
+ }
+
+ public UriResourceLambdaAnyImpl setExpression(final ExpressionImpl expression) {
+ this.expression = expression;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return "any";
+ };
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaVarImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaVarImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaVarImpl.java
new file mode 100644
index 0000000..e3154dc
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceLambdaVarImpl.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourceLambdaRef;
+
+public class UriResourceLambdaVarImpl extends UriResourceTypedImpl implements UriResourceLambdaRef {
+
+ private EdmType type;
+ private boolean isCollection;
+ private String variableText;
+
+ public UriResourceLambdaVarImpl() {
+ super(UriResourceKind.lambdaVariable);
+ }
+
+ @Override
+ public String getVariableText() {
+ return variableText;
+ }
+
+ public UriResourceLambdaVarImpl setVariableText(final String variableText) {
+ this.variableText = variableText;
+ return this;
+ }
+
+ @Override
+ public EdmType getType() {
+ return type;
+ }
+
+ public UriResourceLambdaVarImpl setType(final EdmType type) {
+ this.type = type;
+ return this;
+
+ }
+
+ @Override
+ public boolean isCollection() {
+ return isCollection;
+ }
+
+ public UriResourceLambdaVarImpl setCollection(final boolean isCollection) {
+ this.isCollection = isCollection;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return variableText;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceNavigationPropertyImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceNavigationPropertyImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceNavigationPropertyImpl.java
new file mode 100644
index 0000000..637f09a
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceNavigationPropertyImpl.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourceNavigation;
+
+public class UriResourceNavigationPropertyImpl extends UriResourceWithKeysImpl implements UriResourceNavigation {
+
+ protected EdmNavigationProperty navigationProperty;
+
+ public UriResourceNavigationPropertyImpl() {
+ super(UriResourceKind.navigationProperty);
+ }
+
+ @Override
+ public EdmNavigationProperty getProperty() {
+ return navigationProperty;
+ }
+
+ public UriResourceNavigationPropertyImpl setNavigationProperty(final EdmNavigationProperty property) {
+ navigationProperty = property;
+ return this;
+
+ }
+
+ @Override
+ public EdmType getType() {
+ return navigationProperty.getType();
+ }
+
+ @Override
+ public boolean isCollection() {
+ if (keyPredicates != null) {
+ return false;
+ }
+ return navigationProperty.isCollection();
+ }
+
+ @Override
+ public String toString() {
+ return navigationProperty.getName();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourcePrimitivePropertyImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourcePrimitivePropertyImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourcePrimitivePropertyImpl.java
new file mode 100644
index 0000000..3fd4139
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourcePrimitivePropertyImpl.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmProperty;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourcePrimitiveProperty;
+
+public class UriResourcePrimitivePropertyImpl extends UriResourceTypedImpl implements UriResourcePrimitiveProperty {
+
+ EdmProperty property;
+
+ public UriResourcePrimitivePropertyImpl() {
+ super(UriResourceKind.primitiveProperty);
+ }
+
+ @Override
+ public EdmProperty getProperty() {
+ return property;
+ }
+
+ public UriResourcePrimitivePropertyImpl setProperty(final EdmProperty property) {
+ this.property = property;
+ return this;
+ }
+
+ @Override
+ public EdmType getType() {
+ return property.getType();
+ }
+
+ @Override
+ public boolean isCollection() {
+ return property.isCollection();
+ }
+
+ @Override
+ public String toString() {
+ return property.getName();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceRefImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceRefImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceRefImpl.java
new file mode 100644
index 0000000..17cf8f3
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceRefImpl.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourceRef;
+
+public class UriResourceRefImpl extends UriResourceImpl implements UriResourceRef {
+
+ public UriResourceRefImpl() {
+ super(UriResourceKind.ref);
+
+ }
+
+ @Override
+ public String toString() {
+ return "$ref";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceRootImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceRootImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceRootImpl.java
new file mode 100644
index 0000000..1d5f55d
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceRootImpl.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourceRoot;
+
+public class UriResourceRootImpl extends UriResourceWithKeysImpl implements UriResourceRoot {
+
+ private EdmType type;
+ private boolean isCollection;
+
+ public UriResourceRootImpl() {
+ super(UriResourceKind.root);
+ }
+
+ @Override
+ public EdmType getType() {
+ return type;
+ }
+
+ public UriResourceRootImpl setType(final EdmType type) {
+ this.type = type;
+ return this;
+ }
+
+ @Override
+ public boolean isCollection() {
+ if (keyPredicates != null) {
+ return false;
+ }
+ return isCollection;
+ }
+
+ public UriResourceRootImpl setCollection(final boolean isCollection) {
+ this.isCollection = isCollection;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return "$root";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceSingletonImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceSingletonImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceSingletonImpl.java
new file mode 100644
index 0000000..abb8964
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceSingletonImpl.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
+import org.apache.olingo.odata4.commons.api.edm.EdmSingleton;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourceSingleton;
+
+public class UriResourceSingletonImpl extends UriResourceTypedImpl implements UriResourceSingleton {
+
+ private EdmSingleton singleton;
+
+ public UriResourceSingletonImpl() {
+ super(UriResourceKind.singleton);
+ }
+
+ @Override
+ public EdmSingleton getSingleton() {
+ return singleton;
+ }
+
+ public UriResourceSingletonImpl setSingleton(final EdmSingleton singleton) {
+
+ this.singleton = singleton;
+ return this;
+ }
+
+ @Override
+ public EdmEntityType getEntityTypeFilter() {
+ return (EdmEntityType) typeFilter;
+ }
+
+ @Override
+ public EdmType getType() {
+ return singleton.getEntityType();
+ }
+
+ @Override
+ public EdmEntityType getEntityType() {
+ return singleton.getEntityType();
+ }
+
+ @Override
+ public boolean isCollection() {
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return singleton.getName();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceStartingTypeFilterImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceStartingTypeFilterImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceStartingTypeFilterImpl.java
new file mode 100644
index 0000000..2fba96c
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceStartingTypeFilterImpl.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 2 * Licensed to the Apache Software Foundation (ASF) under one
+ * 3 * or more contributor license agreements. See the NOTICE file
+ * 4 * distributed with this work for additional information
+ * 5 * regarding copyright ownership. The ASF licenses this file
+ * 6 * to you under the Apache License, Version 2.0 (the
+ * 7 * "License"); you may not use this file except in compliance
+ * 8 * with the License. You may obtain a copy of the License at
+ * 9 *
+ * 10 * http://www.apache.org/licenses/LICENSE-2.0
+ * 11 *
+ * 12 * Unless required by applicable law or agreed to in writing,
+ * 13 * software distributed under the License is distributed on an
+ * 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * 15 * KIND, either express or implied. See the License for the
+ * 16 * specific language governing permissions and limitations
+ * 17 * under the License.
+ * 18
+ ******************************************************************************/
+
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+
+public class UriResourceStartingTypeFilterImpl extends UriResourceWithKeysImpl {
+
+ private EdmType type;
+ private boolean isCollection;
+
+ public UriResourceStartingTypeFilterImpl() {
+ super(UriResourceKind.startingTypeFilter);
+ }
+
+ @Override
+ public UriResourceKind getKind() {
+ return kind;
+ }
+
+ @Override
+ public EdmType getType() {
+ return type;
+ }
+
+ public UriResourceStartingTypeFilterImpl setType(final EdmType type) {
+ this.type = type;
+ return this;
+ }
+
+ @Override
+ public boolean isCollection() {
+ if (keyPredicates != null) {
+ return false;
+ }
+ return isCollection;
+ }
+
+ public UriResourceStartingTypeFilterImpl setCollection(final boolean isCollection) {
+ this.isCollection = isCollection;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return type.getNamespace() + "." + type.getName();
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/32467b8d/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceTypedImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceTypedImpl.java b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceTypedImpl.java
new file mode 100644
index 0000000..36f146e
--- /dev/null
+++ b/odata4-lib/odata4-server-core/src/main/java/org/apache/olingo/odata4/server/core/uri/UriResourceTypedImpl.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata4.server.core.uri;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmStructuralType;
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.odata4.server.api.uri.UriResourceKind;
+import org.apache.olingo.odata4.server.api.uri.UriResourcePartTyped;
+
+public abstract class UriResourceTypedImpl extends UriResourceImpl implements UriResourcePartTyped {
+
+ protected EdmType typeFilter = null;
+
+ public UriResourceTypedImpl(final UriResourceKind kind) {
+ super(kind);
+ }
+
+ public EdmType getTypeFilter() {
+ return typeFilter;
+ }
+
+ public UriResourceTypedImpl setTypeFilter(final EdmStructuralType typeFilter) {
+ this.typeFilter = typeFilter;
+ return this;
+ }
+
+ @Override
+ public String toString(final boolean includeFilters) {
+ if (includeFilters) {
+ if (typeFilter != null) {
+ return toString() + "/" + getFQN(typeFilter).toString();
+ } else {
+ return toString();
+ }
+ }
+ return toString();
+ }
+
+ private FullQualifiedName getFQN(final EdmType type) {
+ return new FullQualifiedName(type.getNamespace(), type.getName());
+ }
+
+}