You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2013/08/28 15:34:37 UTC
[33/43] source distribution
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/ExpandSelectTreeNode.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/ExpandSelectTreeNode.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/ExpandSelectTreeNode.java
new file mode 100644
index 0000000..a4ea7c3
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/ExpandSelectTreeNode.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.edm.EdmProperty;
+
+/**
+ * Expression tree node with information about selected properties and to be expanded links.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface ExpandSelectTreeNode {
+
+ /**
+ * Determines whether all properties (including navigation properties) have been selected.
+ */
+ public boolean isAll();
+
+ /**
+ * <p>Gets the list of explicitly selected {@link EdmProperty properties}.</p>
+ * <p>This list does not contain any navigation properties.
+ * It is empty if {@link #isAll()} returns <code>true</code>.</p>
+ * @return List of selected properties
+ */
+ public List<EdmProperty> getProperties();
+
+ /**
+ * Gets the links that have to be included or expanded.
+ * @return a Map from EdmNavigationProperty Name to its related {@link ExpandSelectTreeNode};
+ * if that node is <code>null</code>, a deferred link has been requested,
+ * otherwise the link must be expanded with information found in that node
+ */
+ public Map<String, ExpandSelectTreeNode> getLinks();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/KeyPredicate.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/KeyPredicate.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/KeyPredicate.java
new file mode 100644
index 0000000..086dc85
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/KeyPredicate.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import org.apache.olingo.odata2.api.edm.EdmProperty;
+
+/**
+ * Key predicate, consisting of a simple-type property and its value as String literal
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface KeyPredicate {
+
+ /**
+ * <p>Gets the literal String in default representation.</p>
+ * <p>The description for {@link org.apache.olingo.odata2.api.edm.EdmLiteral} has some motivation for using
+ * this representation.</p>
+ * @return String literal in default (<em>not</em> URI) representation
+ * @see org.apache.olingo.odata2.api.edm.EdmLiteralKind
+ */
+ public String getLiteral();
+
+ /**
+ * Gets the key property.
+ * @return {@link EdmProperty} simple-type property
+ */
+ public EdmProperty getProperty();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/NavigationPropertySegment.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/NavigationPropertySegment.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/NavigationPropertySegment.java
new file mode 100644
index 0000000..c72080a
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/NavigationPropertySegment.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
+
+/**
+ * Navigation property segment, consisting of a navigation property and its
+ * target entity set.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface NavigationPropertySegment {
+
+ /**
+ * Gets the navigation property.
+ * @return {@link EdmNavigationProperty} navigation property
+ */
+ public EdmNavigationProperty getNavigationProperty();
+
+ /**
+ * Gets the target entity set.
+ * @return {@link EdmEntitySet} the target entity set
+ */
+ public EdmEntitySet getTargetEntitySet();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/NavigationSegment.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/NavigationSegment.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/NavigationSegment.java
new file mode 100644
index 0000000..2ce7a26
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/NavigationSegment.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import java.util.List;
+
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
+
+/**
+ * Navigation segment, consisting of a navigation property, its target entity set,
+ * and, optionally, a list of key predicates to determine a single entity out of
+ * the target entity set.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface NavigationSegment {
+
+ /**
+ * Gets the navigation property.
+ * @return {@link EdmNavigationProperty} navigation property of this navigation segment
+ */
+ public EdmNavigationProperty getNavigationProperty();
+
+ /**
+ * Gets the target entity set.
+ * @return {@link EdmEntitySet} entity set of this navigation segment
+ */
+ public EdmEntitySet getEntitySet();
+
+ /**
+ * Gets the key predicate for the target entity set.
+ * @return List of {@link KeyPredicate}: key predicate of this navigation segment
+ */
+ public List<KeyPredicate> getKeyPredicates();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/PathInfo.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/PathInfo.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/PathInfo.java
new file mode 100644
index 0000000..daa64ab
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/PathInfo.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * Object to keep OData URI information.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface PathInfo {
+
+ /**
+ * Gets preceding path segments.
+ * @return List of path segments
+ */
+ List<PathSegment> getPrecedingSegments();
+
+ /**
+ * Gets OData path segments as immutable list.
+ * @return List of path segments
+ */
+ List<PathSegment> getODataSegments();
+
+ /**
+ * Gets the root URI of this service.
+ * @return absolute base URI of the request
+ */
+ URI getServiceRoot();
+
+ /**
+ * Get the absolute request URI including any query parameters.
+ * @return the absolute request URI
+ */
+ URI getRequestUri();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/PathSegment.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/PathSegment.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/PathSegment.java
new file mode 100644
index 0000000..7f5b3f7
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/PathSegment.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>URI path segment consisting of an URI path element and URI matrix parameters.</p>
+ * <p>Example URI:
+ * <pre>{@code //moremaps.com/map/color;mul=50,25;long=20;scale=32000}</pre>
+ * where <code>color</code> is a path segment,
+ * <code>mul</code>, <code>long</code>, and <code>scale</code> are matrix parameters,
+ * and the matrix parameter <code>mul</code> has a multi-value list.</p>
+ *
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface PathSegment {
+
+ /**
+ * Gets a URI path element. In the example above, <code>color</code> will be an element.
+ * @return a URI path element
+ */
+ String getPath();
+
+ /**
+ * <p>Gets the matrix parameters of this path segment.</p>
+ * <p>In the {@link PathSegment} example, <code>mul</code>, <code>long</code>,
+ * and <code>scale</code> are matrix parameters.</p>
+ * @return an immutable map of matrix parameters and their values
+ */
+ Map<String, List<String>> getMatrixParameters();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/SelectItem.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/SelectItem.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/SelectItem.java
new file mode 100644
index 0000000..abf7975
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/SelectItem.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import java.util.List;
+
+import org.apache.olingo.odata2.api.edm.EdmProperty;
+
+/**
+ * An item of a $select system query option.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ */
+public interface SelectItem {
+
+ /**
+ * <code>true</code> if select=*
+ * @return <code>true</code> if select=*
+ */
+ public boolean isStar();
+
+ /**
+ * Gets the EDM property.
+ * @return {@link EdmProperty} property of this select item
+ */
+ public EdmProperty getProperty();
+
+ /**
+ * Gets the navigation-property segments for this select item.
+ * @return List of {@link NavigationPropertySegment} for this select item or Collection.EmptyList
+ */
+ public List<NavigationPropertySegment> getNavigationPropertySegments();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriInfo.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriInfo.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriInfo.java
new file mode 100644
index 0000000..c8b64a9
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriInfo.java
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.commons.InlineCount;
+import org.apache.olingo.odata2.api.edm.EdmEntityContainer;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmFunctionImport;
+import org.apache.olingo.odata2.api.edm.EdmLiteral;
+import org.apache.olingo.odata2.api.edm.EdmProperty;
+import org.apache.olingo.odata2.api.edm.EdmType;
+import org.apache.olingo.odata2.api.uri.expression.FilterExpression;
+import org.apache.olingo.odata2.api.uri.expression.OrderByExpression;
+import org.apache.olingo.odata2.api.uri.info.DeleteUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetComplexPropertyUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntityCountUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntityLinkCountUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntityLinkUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntitySetCountUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntitySetLinksCountUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntitySetLinksUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetEntityUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetFunctionImportUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetMediaResourceUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetMetadataUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetServiceDocumentUriInfo;
+import org.apache.olingo.odata2.api.uri.info.GetSimplePropertyUriInfo;
+import org.apache.olingo.odata2.api.uri.info.PostUriInfo;
+import org.apache.olingo.odata2.api.uri.info.PutMergePatchUriInfo;
+
+/**
+ * Structured parts of the request URI - the result of URI parsing.
+ * @org.apache.olingo.odata2.DoNotImplement
+ *
+ * @see UriParser
+ */
+public interface UriInfo extends GetServiceDocumentUriInfo,
+ GetEntitySetUriInfo, GetEntityUriInfo,
+ GetComplexPropertyUriInfo, GetSimplePropertyUriInfo,
+ GetEntityLinkUriInfo, GetEntitySetLinksUriInfo,
+ GetMetadataUriInfo,
+ GetFunctionImportUriInfo,
+ GetEntitySetCountUriInfo, GetEntityCountUriInfo,
+ GetMediaResourceUriInfo,
+ GetEntityLinkCountUriInfo, GetEntitySetLinksCountUriInfo,
+ PutMergePatchUriInfo, PostUriInfo, DeleteUriInfo {
+
+ /**
+ * Gets the target entity container.
+ * @return {@link EdmEntityContainer} the target entity container
+ */
+ @Override
+ public EdmEntityContainer getEntityContainer();
+
+ /**
+ * Gets the start entity set - identical to the target entity set if no navigation
+ * has been used.
+ * @return {@link EdmEntitySet}
+ */
+ @Override
+ public EdmEntitySet getStartEntitySet();
+
+ /**
+ * Gets the target entity set after navigation.
+ * @return {@link EdmEntitySet} target entity set
+ */
+ @Override
+ public EdmEntitySet getTargetEntitySet();
+
+ /**
+ * Gets the function import.
+ * @return {@link EdmFunctionImport} the function import
+ */
+ @Override
+ public EdmFunctionImport getFunctionImport();
+
+ /**
+ * Gets the target type of the request: an entity type, a simple type, or a complex type.
+ * @return {@link EdmType} the target type
+ */
+ @Override
+ public EdmType getTargetType();
+
+ /**
+ * Gets the key predicates used to select a single entity out of the start entity set,
+ * or an empty list if not used.
+ * @return List of {@link KeyPredicate}
+ * @see #getStartEntitySet()
+ */
+ @Override
+ public List<KeyPredicate> getKeyPredicates();
+
+ /**
+ * Gets the key predicates used to select a single entity out of the target entity set,
+ * or an empty list if not used - identical to the key predicates from the last entry
+ * retrieved from {@link #getNavigationSegments()} or, if no navigation has been used,
+ * to the result of {@link #getKeyPredicates()}.
+ * @return List of {@link KeyPredicate}
+ * @see #getTargetEntitySet()
+ */
+ @Override
+ public List<KeyPredicate> getTargetKeyPredicates();
+
+ /**
+ * Gets the navigation segments, or an empty list if no navigation has been used.
+ * @return List of {@link NavigationSegment}
+ */
+ @Override
+ public List<NavigationSegment> getNavigationSegments();
+
+ /**
+ * Gets the path used to select a (simple or complex) property of an entity,
+ * or an empty list if no property is accessed.
+ * @return List of {@link EdmProperty}
+ */
+ @Override
+ public List<EdmProperty> getPropertyPath();
+
+ /**
+ * Determines whether $count has been used in the request URI.
+ * @return whether $count has been used
+ */
+ @Override
+ public boolean isCount();
+
+ /**
+ * Determines whether $value has been used in the request URI.
+ * @return whether $value has been used
+ */
+ @Override
+ public boolean isValue();
+
+ /**
+ * Determines whether $links has been used in the request URI.
+ * @return whether $links has been used
+ */
+ @Override
+ public boolean isLinks();
+
+ /**
+ * Gets the value of the $format system query option.
+ * @return the format (as set as <code>$format</code> query parameter) or null
+ */
+ @Override
+ public String getFormat();
+
+ /**
+ * Gets the value of the $filter system query option as root object of the
+ * expression tree built during URI parsing.
+ * @return the filter expression or null
+ */
+ @Override
+ public FilterExpression getFilter();
+
+ /**
+ * Gets the value of the $inlinecount system query option.
+ * @return {@link InlineCount} the inline count or null
+ */
+ @Override
+ public InlineCount getInlineCount();
+
+ /**
+ * Gets the value of the $orderby system query option as root object of the
+ * expression tree built during URI parsing.
+ * @return the order-by expression or null
+ */
+ @Override
+ public OrderByExpression getOrderBy();
+
+ /**
+ * Gets the value of the $skiptoken system query option.
+ * @return skip token or null
+ */
+ @Override
+ public String getSkipToken();
+
+ /**
+ * Gets the value of the $skip system query option.
+ * @return skip or null
+ */
+ @Override
+ public Integer getSkip();
+
+ /**
+ * Gets the value of the $top system query option.
+ * @return top or null
+ */
+ @Override
+ public Integer getTop();
+
+ /**
+ * Gets the value of the $expand system query option as a list of
+ * lists of navigation-property segments, or an empty list if not used.
+ * @return List of a list of {@link NavigationPropertySegment} to be expanded
+ */
+ @Override
+ public List<ArrayList<NavigationPropertySegment>> getExpand();
+
+ /**
+ * Gets the value of the $select system query option as a list of select items,
+ * or an empty list if not used.
+ * @return List of {@link SelectItem} to be selected
+ */
+ @Override
+ public List<SelectItem> getSelect();
+
+ /**
+ * Gets the parameters of a function import as Map from parameter names to
+ * their corresponding typed values, or an empty list if no function import
+ * is used or no parameters are given in the URI.
+ * @return Map of {@literal <String,} {@link EdmLiteral}{@literal >} function import parameters
+ */
+ @Override
+ public Map<String, EdmLiteral> getFunctionImportParameters();
+
+ /**
+ * Gets the custom query options as Map from option names to their
+ * corresponding String values, or an empty list if no custom query options
+ * are given in the URI.
+ * @return Map of {@literal <String, String>} custom query options
+ */
+ @Override
+ public Map<String, String> getCustomQueryOptions();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriNotMatchingException.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriNotMatchingException.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriNotMatchingException.java
new file mode 100644
index 0000000..0eb9352
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriNotMatchingException.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import org.apache.olingo.odata2.api.exception.MessageReference;
+import org.apache.olingo.odata2.api.exception.ODataNotFoundException;
+
+/**
+ * URI-parsing exception resulting in a 404 Not Found response.
+ *
+ */
+public class UriNotMatchingException extends ODataNotFoundException {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final MessageReference MATCHPROBLEM = createMessageReference(UriNotMatchingException.class, "MATCHPROBLEM");
+ public static final MessageReference NOTFOUND = createMessageReference(UriNotMatchingException.class, "NOTFOUND");
+ public static final MessageReference CONTAINERNOTFOUND = createMessageReference(UriNotMatchingException.class, "CONTAINERNOTFOUND");
+ public static final MessageReference ENTITYNOTFOUND = createMessageReference(UriNotMatchingException.class, "ENTITYNOTFOUND");
+ public static final MessageReference PROPERTYNOTFOUND = createMessageReference(UriNotMatchingException.class, "PROPERTYNOTFOUND");
+
+ public UriNotMatchingException(final MessageReference messageReference) {
+ super(messageReference);
+ }
+
+ public UriNotMatchingException(final MessageReference messageReference, final Throwable cause) {
+ super(messageReference, cause);
+ }
+
+ public UriNotMatchingException(final MessageReference messageReference, final String errorCode) {
+ super(messageReference, errorCode);
+ }
+
+ public UriNotMatchingException(final MessageReference messageReference, final Throwable cause, final String errorCode) {
+ super(messageReference, cause, errorCode);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriParser.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriParser.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriParser.java
new file mode 100644
index 0000000..ff83bc3
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriParser.java
@@ -0,0 +1,181 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.edm.Edm;
+import org.apache.olingo.odata2.api.edm.EdmEntityType;
+import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.exception.ODataMessageException;
+import org.apache.olingo.odata2.api.rt.RuntimeDelegate;
+import org.apache.olingo.odata2.api.uri.expression.ExpressionParserException;
+import org.apache.olingo.odata2.api.uri.expression.FilterExpression;
+import org.apache.olingo.odata2.api.uri.expression.OrderByExpression;
+
+/**
+ * Wrapper for UriParser functionality.
+ *
+ */
+public abstract class UriParser {
+
+ /**
+ * Parses path segments and query parameters for the given EDM.
+ * @param edm Entity Data Model
+ * @param pathSegments list of path segments
+ * @param queryParameters query parameters
+ * @return {@link UriInfo} information about the parsed URI
+ * @throws ODataException
+ */
+ public static UriInfo parse(final Edm edm, final List<PathSegment> pathSegments, final Map<String, String> queryParameters) throws ODataException {
+ return RuntimeDelegate.getUriParser(edm).parse(pathSegments, queryParameters);
+ }
+
+ /**
+ * Parses path segments and query parameters.
+ * @param pathSegments list of path segments
+ * @param queryParameters query parameters
+ * @return {@link UriInfo} information about the parsed URI
+ * @throws UriSyntaxException
+ * @throws UriNotMatchingException
+ * @throws EdmException
+ */
+ public abstract UriInfo parse(List<PathSegment> pathSegments, Map<String, String> queryParameters) throws UriSyntaxException, UriNotMatchingException, EdmException;
+
+ /**
+ * Parses a $filter expression string and create an expression tree.
+ * <p>The current expression parser supports expressions as defined in the
+ * OData specification 2.0 with the following restrictions:
+ * <ul>
+ * <li>the methods "cast", "isof" and "replace" are not supported</li>
+ * </ul></p>
+ *
+ * <p>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:
+ * <ul>
+ * <li>All properties used in the expression must be defined inside the EDM,</li>
+ * <li>the types of EDM properties will be checked against the lists of allowed
+ * types per method and per binary or unary operator, respectively</li>
+ * </ul>
+ * If no EDM is provided the expression parser performs a lax validation:
+ * <ul>
+ * <li>The properties used in the expression are not looked up inside the EDM
+ * and the type of the expression node representing the property will be "null",</li>
+ * <li>expression nodes with EDM type "null" are not considered during the parameter
+ * type validation, so the return type of the parent expression node will
+ * also become "null".</li>
+ * </ul>
+ * @param edm entity data model of the accessed OData service
+ * @param edmType EDM type of the OData entity/complex type/... addressed by the URL
+ * @param expression $filter expression string to be parsed
+ * @return expression tree which can be traversed with help of the interfaces
+ * {@link org.apache.olingo.odata2.api.uri.expression.ExpressionVisitor ExpressionVisitor}
+ * and {@link org.apache.olingo.odata2.api.uri.expression.Visitable Visitable}
+ * @throws ExpressionParserException thrown due to errors while parsing the $filter expression string
+ * @throws ODataMessageException for extensibility
+ */
+ public static FilterExpression parseFilter(final Edm edm, final EdmEntityType edmType, final String expression) throws ExpressionParserException, ODataMessageException {
+ return RuntimeDelegate.getUriParser(edm).parseFilterString(edmType, expression);
+ }
+
+ /**
+ * Parses a $filter expression string and create an expression tree.
+ * <p>The current expression parser supports expressions as defined in the
+ * OData specification 2.0 with the following restrictions:
+ * <ul>
+ * <li>the methods "cast", "isof" and "replace" are not supported</li>
+ * </ul></p>
+ *
+ * <p>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:
+ * <ul>
+ * <li>All properties used in the expression must be defined inside the EDM,</li>
+ * <li>the types of EDM properties will be checked against the lists of allowed
+ * types per method and per binary or unary operator, respectively</li>
+ * </ul>
+ * If no EDM is provided the expression parser performs a lax validation:
+ * <ul>
+ * <li>The properties used in the expression are not looked up inside the EDM
+ * and the type of the expression node representing the property will be "null",</li>
+ * <li>expression nodes with EDM type "null" are not considered during the parameter
+ * type validation, so the return type of the parent expression node will
+ * also become "null".</li>
+ * </ul>
+ * @param edmType EDM type of the OData entity/complex type/... addressed by the URL
+ * @param expression $filter expression string to be parsed
+ * @return expression tree which can be traversed with help of the interfaces
+ * {@link org.apache.olingo.odata2.api.uri.expression.ExpressionVisitor ExpressionVisitor}
+ * and {@link org.apache.olingo.odata2.api.uri.expression.Visitable Visitable}
+ * @throws ExpressionParserException thrown due to errors while parsing the $filter expression string
+ * @throws ODataMessageException for extensibility
+ */
+ public abstract FilterExpression parseFilterString(EdmEntityType edmType, String expression) throws ExpressionParserException, ODataMessageException;
+
+ /**
+ * Parses a $orderby expression string and creates an expression tree.
+ * @param edm EDM model of the accessed OData service
+ * @param edmType EDM type of the OData entity/complex type/... addressed by the URL
+ * @param expression $orderby expression string to be parsed
+ * @return expression tree which can be traversed with help of the interfaces
+ * {@link org.apache.olingo.odata2.api.uri.expression.ExpressionVisitor ExpressionVisitor}
+ * and {@link org.apache.olingo.odata2.api.uri.expression.Visitable Visitable}
+ * @throws ExpressionParserException thrown due to errors while parsing the $orderby expression string
+ * @throws ODataMessageException used for extensibility
+ */
+ public static OrderByExpression parseOrderBy(final Edm edm, final EdmEntityType edmType, final String expression) throws ExpressionParserException, ODataMessageException {
+ return RuntimeDelegate.getUriParser(edm).parseOrderByString(edmType, expression);
+ }
+
+ /**
+ * Parses a $orderby expression string and creates an expression tree.
+ * @param edmType EDM type of the OData entity/complex type/... addressed by the URL
+ * @param expression $orderby expression string to be parsed
+ * @return expression tree which can be traversed with help of the interfaces
+ * {@link org.apache.olingo.odata2.api.uri.expression.ExpressionVisitor ExpressionVisitor}
+ * and {@link org.apache.olingo.odata2.api.uri.expression.Visitable Visitable}
+ * @throws ExpressionParserException thrown due to errors while parsing the $orderby expression string
+ * @throws ODataMessageException used for extensibility
+ */
+ public abstract OrderByExpression parseOrderByString(EdmEntityType edmType, String expression) throws ExpressionParserException, ODataMessageException;
+
+ /**
+ * Creates an optimized expression tree out of $expand and $select expressions.
+ * @param select List of {@link SelectItem select items}
+ * @param expand List of Lists of {@link NavigationPropertySegment navigation property segments}
+ * @return expression tree of type {@link ExpandSelectTreeNode}
+ * @throws EdmException
+ */
+ public static ExpandSelectTreeNode createExpandSelectTree(final List<SelectItem> select, final List<ArrayList<NavigationPropertySegment>> expand) throws EdmException {
+ return RuntimeDelegate.getUriParser(null).buildExpandSelectTree(select, expand);
+ }
+
+ /**
+ * Creates an optimized expression tree out of $expand and $select expressions.
+ * @param select List of {@link SelectItem select items}
+ * @param expand List of Lists of {@link NavigationPropertySegment navigation property segments}
+ * @return expression tree of type {@link ExpandSelectTreeNode}
+ * @throws EdmException
+ */
+ public abstract ExpandSelectTreeNode buildExpandSelectTree(List<SelectItem> select, List<ArrayList<NavigationPropertySegment>> expand) throws EdmException;
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriSyntaxException.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriSyntaxException.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriSyntaxException.java
new file mode 100644
index 0000000..52e1782
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/UriSyntaxException.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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.odata2.api.uri;
+
+import org.apache.olingo.odata2.api.exception.MessageReference;
+import org.apache.olingo.odata2.api.exception.ODataBadRequestException;
+
+/**
+ * Exception for violation of the OData URI construction rules,
+ * resulting in a 400 Bad Request response.
+ *
+ */
+public class UriSyntaxException extends ODataBadRequestException {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final MessageReference URISYNTAX = createMessageReference(UriSyntaxException.class, "URISYNTAX");
+ public static final MessageReference ENTITYSETINSTEADOFENTITY = createMessageReference(UriSyntaxException.class, "ENTITYSETINSTEADOFENTITY");
+ public static final MessageReference NOTEXT = createMessageReference(UriSyntaxException.class, "NOTEXT");
+ public static final MessageReference NOMEDIARESOURCE = createMessageReference(UriSyntaxException.class, "NOMEDIARESOURCE");
+ public static final MessageReference NONAVIGATIONPROPERTY = createMessageReference(UriSyntaxException.class, "NONAVIGATIONPROPERTY");
+ public static final MessageReference MISSINGPARAMETER = createMessageReference(UriSyntaxException.class, "MISSINGPARAMETER");
+ public static final MessageReference MISSINGKEYPREDICATENAME = createMessageReference(UriSyntaxException.class, "MISSINGKEYPREDICATENAME");
+ public static final MessageReference DUPLICATEKEYNAMES = createMessageReference(UriSyntaxException.class, "DUPLICATEKEYNAMES");
+ public static final MessageReference EMPTYSEGMENT = createMessageReference(UriSyntaxException.class, "EMPTYSEGMENT");
+ public static final MessageReference MUSTNOTBELASTSEGMENT = createMessageReference(UriSyntaxException.class, "MUSTNOTBELASTSEGMENT");
+ public static final MessageReference MUSTBELASTSEGMENT = createMessageReference(UriSyntaxException.class, "MUSTBELASTSEGMENT");
+ public static final MessageReference INVALIDSEGMENT = createMessageReference(UriSyntaxException.class, "INVALIDSEGMENT");
+ public static final MessageReference INVALIDVALUE = createMessageReference(UriSyntaxException.class, "INVALIDVALUE");
+ public static final MessageReference INVALIDNULLVALUE = createMessageReference(UriSyntaxException.class, "INVALIDNULLVALUE");
+ public static final MessageReference INVALIDNEGATIVEVALUE = createMessageReference(UriSyntaxException.class, "INVALIDNEGATIVEVALUE");
+ public static final MessageReference INVALIDRETURNTYPE = createMessageReference(UriSyntaxException.class, "INVALIDRETURNTYPE");
+ public static final MessageReference INVALIDPROPERTYTYPE = createMessageReference(UriSyntaxException.class, "INVALIDPROPERTYTYPE");
+ public static final MessageReference INVALIDKEYPREDICATE = createMessageReference(UriSyntaxException.class, "INVALIDKEYPREDICATE");
+ public static final MessageReference INVALIDSYSTEMQUERYOPTION = createMessageReference(UriSyntaxException.class, "INVALIDSYSTEMQUERYOPTION");
+ public static final MessageReference INVALIDFILTEREXPRESSION = createMessageReference(UriSyntaxException.class, "INVALIDFILTEREXPRESSION");
+ public static final MessageReference INVALIDORDERBYEXPRESSION = createMessageReference(UriSyntaxException.class, "INVALIDORDERBYEXPRESSION");
+ public static final MessageReference LITERALFORMAT = createMessageReference(UriSyntaxException.class, "LITERALFORMAT");
+ public static final MessageReference UNKNOWNLITERAL = createMessageReference(UriSyntaxException.class, "UNKNOWNLITERAL");
+ public static final MessageReference INCOMPATIBLELITERAL = createMessageReference(UriSyntaxException.class, "INCOMPATIBLELITERAL");
+ public static final MessageReference INCOMPATIBLESYSTEMQUERYOPTION = createMessageReference(UriSyntaxException.class, "INCOMPATIBLESYSTEMQUERYOPTION");
+
+ public UriSyntaxException(final MessageReference MessageReference) {
+ super(MessageReference);
+ }
+
+ public UriSyntaxException(final MessageReference messageReference, final Throwable cause) {
+ super(messageReference, cause);
+ }
+
+ public UriSyntaxException(final MessageReference MessageReference, final String errorCode) {
+ super(MessageReference, errorCode);
+ }
+
+ public UriSyntaxException(final MessageReference messageReference, final Throwable cause, final String errorCode) {
+ super(messageReference, cause, errorCode);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/BinaryExpression.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/BinaryExpression.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/BinaryExpression.java
new file mode 100644
index 0000000..40893a7
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/BinaryExpression.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.expression;
+
+/**
+ * Represents a binary expression node in the expression tree returned by the methods
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseFilterString(org.apache.olingo.odata2.api.edm.EdmEntityType, String)}</li>
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseOrderByString(org.apache.olingo.odata2.api.edm.EdmEntityType, String)}</li>
+ * <br>
+ * <br>
+ * A binary expression node is inserted in the expression tree for any valid
+ * ODATA binary operator in {@link BinaryOperator} (e.g. for "and", "div", "eg", ... )
+ * <br>
+ *
+ */
+public interface BinaryExpression extends CommonExpression {
+ /**
+ * @return Operator object that represents the used operator
+ * @see BinaryOperator
+ */
+ public BinaryOperator getOperator();
+
+ /**
+ * @return Expression sub tree of the left operand
+ */
+ public CommonExpression getLeftOperand();
+
+ /**
+ * @return Expression sub tree of the right operand
+ */
+ public CommonExpression getRightOperand();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/BinaryOperator.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/BinaryOperator.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/BinaryOperator.java
new file mode 100644
index 0000000..93140f4
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/BinaryOperator.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.expression;
+
+/**
+ * Enumerations for supported binary operators of the ODATA expression parser
+ * for ODATA version 2.0 (with some restrictions)
+ *
+*/
+public enum BinaryOperator {
+ AND("and"), OR("or"), EQ("eq"), NE("ne"), LT("lt"), LE("le"), GT("gt"), GE("ge"), ADD("add"), SUB("sub"), MUL("mul"), DIV("div"), MODULO("mod"),
+
+ /**
+ * Property access operator. E.g. $filter=address/city eq "Sydney"
+ */
+ PROPERTY_ACCESS("/", "property access");
+
+ private String uriSyntax;
+ private String stringRespresentation;
+
+ private BinaryOperator(final String uriSyntax) {
+ this.uriSyntax = uriSyntax;
+ stringRespresentation = uriSyntax;
+ }
+
+ private BinaryOperator(final String syntax, final String stringRespresentation) {
+ uriSyntax = syntax;
+ this.stringRespresentation = stringRespresentation;
+ }
+
+ /**
+ * @return Operator name for usage in text
+ */
+ @Override
+ public String toString() {
+ return stringRespresentation;
+ }
+
+ /**
+ * @return URI literal of the binary operator as used in the URL.
+ */
+ public String toUriLiteral() {
+ return uriSyntax;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/CommonExpression.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/CommonExpression.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/CommonExpression.java
new file mode 100644
index 0000000..04a99ec
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/CommonExpression.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.odata2.api.uri.expression;
+
+import org.apache.olingo.odata2.api.edm.EdmType;
+
+/**
+ * Parent class of all classes used to build the expression tree returned by
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseFilterString(org.apache.olingo.odata2.api.edm.EdmEntityType, String)}</li>
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseOrderByString(org.apache.olingo.odata2.api.edm.EdmEntityType, String)}</li>
+ * <br>
+ * <br>
+ * <p>This interface defines the default methods for all expression tree nodes
+ * <br>
+ * <br>
+ *
+ */
+public interface CommonExpression extends Visitable {
+ /**
+ * @return Kind of this expression
+ * @see ExpressionKind
+ */
+ ExpressionKind getKind();
+
+ /**
+ * @return The return type of the value represented with
+ * this expression. For example the {@link #getEdmType()} method
+ * for an expression representing the "concat" method will return always
+ * "Edm.String".<br>
+ * <br>
+ * <p>This type information is set while parsing the $filter or $orderby
+ * expressions and used to do a first validation of the expression.
+ * For calculating operators like "add, sub, mul" this type
+ * information is purely based on input and output types of the
+ * operator as defined in the OData specification.
+ * So for $filter=2 add 7 the {@link #getEdmType()} method of the binary expression
+ * will return Edm.Byte and not Edm.Int16 because the parser performs no real
+ * addition.<br>
+ * <br>
+ * <p>However, the application may change this type while evaluating the
+ * expression tree.
+ */
+ EdmType getEdmType();
+
+ /**
+ * Set the edmType of this expression node
+ * @param edmType Type to be set
+ * @return A self reference for method chaining"
+ */
+ CommonExpression setEdmType(EdmType edmType);
+
+ /**
+ * Returns the URI literal which lead to the creation of this expression.
+ * @return URI literal
+ */
+ String getUriLiteral();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExceptionVisitExpression.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExceptionVisitExpression.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExceptionVisitExpression.java
new file mode 100644
index 0000000..5007c2a
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExceptionVisitExpression.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.odata2.api.uri.expression;
+
+import org.apache.olingo.odata2.api.exception.MessageReference;
+import org.apache.olingo.odata2.api.exception.ODataMessageException;
+
+/**
+ * Exception thrown while traversing/visiting a filter expression tree
+ *
+ */
+public class ExceptionVisitExpression extends ODataMessageException {
+ private static final long serialVersionUID = 7701L;
+
+ public static final MessageReference COMMON = createMessageReference(ExceptionVisitExpression.class, "COMMON");
+
+ private CommonExpression filterTree;
+
+ public ExceptionVisitExpression() {
+ super(COMMON);
+ }
+
+ /**
+ * Create {@link ExceptionVisitExpression} with given {@link MessageReference}.
+ *
+ * @param messageReference
+ * references the message text (and additional values) of this {@link ExceptionVisitExpression}
+ */
+ public ExceptionVisitExpression(final MessageReference messageReference) {
+ super(messageReference);
+ }
+
+ /**
+ * Create {@link ExceptionVisitExpression} with given {@link MessageReference} and cause {@link Throwable} which caused
+ * this {@link ExceptionVisitExpression}.
+ *
+ * @param message
+ * references the message text (and additional values) of this {@link ExceptionVisitExpression}
+ * @param cause
+ * exception which caused this {@link ExceptionVisitExpression}
+ */
+ public ExceptionVisitExpression(final MessageReference message, final Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Get erroneous filter for debug information
+ * @return Erroneous filter tree
+ */
+ public CommonExpression getFilterTree() {
+ return filterTree;
+ }
+
+ /**
+ * Sets erroneous filter tree for debug information.
+ * @param filterTree Erroneous filter tree
+ */
+ public void setFilterTree(final CommonExpression filterTree) {
+ this.filterTree = filterTree;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionKind.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionKind.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionKind.java
new file mode 100644
index 0000000..ad666c6
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionKind.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.expression;
+
+/**
+ * Enumeration describing all possible node types inside an expression tree
+ *
+ */
+public enum ExpressionKind {
+ /**
+ * Used to mark the root node of a filter expression tree
+ * @see FilterExpression
+ */
+ FILTER,
+ /**
+ * Literal expressions like "1.1d" or "'This is a string'"
+ * @see LiteralExpression
+ */
+ LITERAL,
+
+ /**
+ * Unary operator expressions like "not" and "-"
+ * @see UnaryExpression
+ */
+ UNARY,
+
+ /**
+ * Binary operator expressions like "eq" and "or"
+ * @see BinaryExpression
+ */
+ BINARY,
+
+ /**
+ * Method operator expressions like "substringof" and "concat"
+ * @see MethodExpression
+ */
+ METHOD,
+
+ /**
+ * Member access expressions like "/" in "adress/street"
+ * @see MemberExpression
+ */
+ MEMBER,
+
+ /**
+ * Property expressions like "age"
+ * @see PropertyExpression
+ */
+ PROPERTY,
+
+ /**
+ * Order expressions like "age desc"
+ * @see OrderExpression
+ */
+ ORDER,
+
+ /**
+ * Orderby expression like "age desc, name asc"
+ * @see OrderByExpression
+ */
+ ORDERBY;
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionParserException.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionParserException.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionParserException.java
new file mode 100644
index 0000000..68d199e
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionParserException.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.odata2.api.uri.expression;
+
+import org.apache.olingo.odata2.api.exception.MessageReference;
+import org.apache.olingo.odata2.api.exception.ODataBadRequestException;
+
+/**
+ * Exception thrown while parsing a filter or orderby expression
+ *
+ */
+public class ExpressionParserException extends ODataBadRequestException {
+ private static final long serialVersionUID = 7702L;
+
+ public static final MessageReference COMMON_ERROR = createMessageReference(ExpressionParserException.class, "COMMON");
+
+ //token related exception texts
+ public static final MessageReference ERROR_IN_TOKENIZER = createMessageReference(ExpressionParserException.class, "ERROR_IN_TOKENIZER");
+ public static final MessageReference TOKEN_UNDETERMINATED_STRING = createMessageReference(ExpressionParserException.class, "TOKEN_UNDETERMINATED_STRING");
+ public static final MessageReference INVALID_TRAILING_TOKEN_DETECTED_AFTER_PARSING = createMessageReference(ExpressionParserException.class, "INVALID_TRAILING_TOKEN_DETECTED_AFTER_PARSING");
+
+ //parsing
+ public static final MessageReference EXPRESSION_EXPECTED_AFTER_POS = createMessageReference(ExpressionParserException.class, "EXPRESSION_EXPECTED_AFTER_POS");
+ public static final MessageReference COMMA_OR_END_EXPECTED_AT_POS = createMessageReference(ExpressionParserException.class, "COMMA_OR_END_EXPECTED_AT_POS");
+ public static final MessageReference EXPRESSION_EXPECTED_AT_POS = createMessageReference(ExpressionParserException.class, "EXPRESSION_EXPECTED_AT_POS");
+ public static final MessageReference MISSING_CLOSING_PHARENTHESIS = createMessageReference(ExpressionParserException.class, "MISSING_CLOSING_PHARENTHESIS");
+ public static final MessageReference COMMA_OR_CLOSING_PHARENTHESIS_EXPECTED_AFTER_POS = createMessageReference(ExpressionParserException.class, "COMMA_OR_CLOSING_PHARENTHESIS_EXPECTED_AFTER_POS");
+ public static final MessageReference INVALID_METHOD_CALL = createMessageReference(ExpressionParserException.class, "INVALID_METHOD_CALL");
+ public static final MessageReference TYPE_EXPECTED_AT = createMessageReference(ExpressionParserException.class, "TYPE_EXPECTED_AT");
+
+ //validation exceptions texts - method
+ public static final MessageReference METHOD_WRONG_ARG_EXACT = createMessageReference(ExpressionParserException.class, "METHOD_WRONG_ARG_EXACT");
+ public static final MessageReference METHOD_WRONG_ARG_BETWEEN = createMessageReference(ExpressionParserException.class, "METHOD_WRONG_ARG_BETWEEN");
+ public static final MessageReference METHOD_WRONG_ARG_X_OR_MORE = createMessageReference(ExpressionParserException.class, "METHOD_WRONG_ARG_X_OR_MORE");
+ public static final MessageReference METHOD_WRONG_ARG_X_OR_LESS = createMessageReference(ExpressionParserException.class, "METHOD_WRONG_ARG_X_OR_LESS");
+ public static final MessageReference METHOD_WRONG_INPUT_TYPE = createMessageReference(ExpressionParserException.class, "METHOD_WRONG_INPUT_TYPE");
+
+ //validation exceptions texts - member
+ public static final MessageReference LEFT_SIDE_NOT_STRUCTURAL_TYPE = createMessageReference(ExpressionParserException.class, "LEFT_SIDE_NOT_STRUCTURAL_TYPE");
+ public static final MessageReference LEFT_SIDE_NOT_A_PROPERTY = createMessageReference(ExpressionParserException.class, "LEFT_SIDE_NOT_A_PROPERTY");
+ public static final MessageReference PROPERTY_NAME_NOT_FOUND_IN_TYPE = createMessageReference(ExpressionParserException.class, "PROPERTY_NAME_NOT_FOUND_IN_TYPE");
+
+ //validation exceptions texts - binary
+ public static final MessageReference INVALID_TYPES_FOR_BINARY_OPERATOR = createMessageReference(ExpressionParserException.class, "INVALID_TYPES_FOR_BINARY_OPERATOR");
+
+ //orderby
+ public static final MessageReference INVALID_SORT_ORDER = createMessageReference(ExpressionParserException.class, "INVALID_SORT_ORDER");
+
+ //instance attributes
+ private CommonExpression filterTree;
+
+ //Constructors
+ public ExpressionParserException() {
+ super(COMMON_ERROR);
+ }
+
+ /**
+ * Create {@link ExpressionParserException} with given {@link MessageReference}.
+ *
+ * @param messageReference
+ * references the message text (and additional values) of this {@link ExpressionParserException}
+ */
+ public ExpressionParserException(final MessageReference messageReference) {
+ super(messageReference);
+ }
+
+ /**
+ * Create {@link ExpressionParserException} with given {@link MessageReference} and cause {@link Throwable} which caused
+ * this {@link ExpressionParserException}.
+ *
+ * @param messageReference
+ * References the message text (and additional values) of this {@link ExpressionParserException}
+ * @param cause
+ * Exception which caused this {@link ExpressionParserException}
+ */
+ public ExpressionParserException(final MessageReference messageReference, final Throwable cause) {
+ super(messageReference, cause);
+ }
+
+ /**
+ * Gets erroneous filter expression tree for debug information.
+ * @return erroneous filter tree
+ */
+ public CommonExpression getFilterTree() {
+ return filterTree;
+ }
+
+ /**
+ * Sets erroneous filter tree for debug information.
+ * @param filterTree filter tree to be set
+ */
+ public void setFilterTree(final CommonExpression filterTree) {
+ this.filterTree = filterTree;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionVisitor.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionVisitor.java
new file mode 100644
index 0000000..8b1da90
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/ExpressionVisitor.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.expression;
+
+import java.util.List;
+
+import org.apache.olingo.odata2.api.edm.EdmLiteral;
+import org.apache.olingo.odata2.api.edm.EdmTyped;
+
+/**
+ * Interface {@link ExpressionVisitor} is used to traverse a $filter or $orderby expression tree.
+ * Any class instance implementing this interface can be passed to the method {@link Visitable#accept(ExpressionVisitor)}
+ * of an expression node to start the traversing. While traversing, the appropriate methods of the visitor implementation
+ * will be called.
+ *
+ */
+public interface ExpressionVisitor {
+ /**
+ * Visits a filter expression
+ * @param filterExpression
+ * The visited filter expression node
+ * @param expressionString
+ * The $filter expression string used to build the filter expression tree
+ * @param expression
+ * The expression node representing the first <i>operator</i>,<i>method</i>,<i>literal</i> or <i>property</i> of the expression tree
+ * @return
+ * The overall result of evaluating the whole filter expression tree
+ */
+ Object visitFilterExpression(FilterExpression filterExpression, String expressionString, Object expression);
+
+ /**
+ * Visits a binary expression
+ * @param binaryExpression
+ * The visited binary expression node
+ * @param operator
+ * The operator used in the binary expression
+ * @param leftSide
+ * The result of visiting the left expression node
+ * @param rightSide
+ * The result of visiting the right expression node
+ * @return
+ * Returns the result from evaluating operator, leftSide and rightSide
+ */
+ Object visitBinary(BinaryExpression binaryExpression, BinaryOperator operator, Object leftSide, Object rightSide);
+
+ /**
+ * Visits a orderby expression
+ * @param orderByExpression
+ * The visited orderby expression node
+ * @param expressionString
+ * The $orderby expression string used to build the orderby expression tree
+ * @param orders
+ * The result of visiting the orders of the orderby expression
+ * @return
+ * The overall result of evaluating the orderby expression tree
+ */
+ Object visitOrderByExpression(OrderByExpression orderByExpression, String expressionString, List<Object> orders);
+
+ /**
+ * Visits a order expression
+ * @param orderExpression
+ * The visited order expression node
+ * @param filterResult
+ * The result of visiting the filter expression contained in the order
+ * @param sortOrder
+ * The sort order
+ * @return
+ * The overall result of evaluating the order
+ */
+ Object visitOrder(OrderExpression orderExpression, Object filterResult, SortOrder sortOrder);
+
+ /**
+ * Visits a literal expression
+ * @param literal
+ * The visited literal expression node
+ * @param edmLiteral
+ * The detected EDM literal (value and type)
+ * @return
+ * The value of the literal
+ */
+ Object visitLiteral(LiteralExpression literal, EdmLiteral edmLiteral);
+
+ /**
+ * Visits a method expression
+ * @param methodExpression
+ * The visited method expression node
+ * @param method
+ * The method used in the method expression
+ * @param parameters
+ * The result of visiting the parameters of the method
+ * @return
+ * Returns the result from evaluating the method and the method parameters
+ */
+ Object visitMethod(MethodExpression methodExpression, MethodOperator method, List<Object> parameters);
+
+ /**
+ * Visits a member expression (e.g. <path property>/<member property>)
+ * @param memberExpression
+ * The visited member expression node
+ * @param path
+ * The result of visiting the path property expression node (the left side of the property operator)
+ * @param property
+ * The result of visiting the member property expression node
+ * @return
+ * Returns the <b>value</b> of the corresponding property (which may be a single EDM value or a structured EDM value)
+ */
+ Object visitMember(MemberExpression memberExpression, Object path, Object property);
+
+ /**
+ * Visits a property expression
+ * @param propertyExpression
+ * The visited property expression node
+ * @param uriLiteral
+ * The URI literal of the property
+ * @param edmProperty
+ * The EDM property matching the property name used in the expression String
+ * @return
+ * Returns the <b>value</b> of the corresponding property ( which may be a single EDM value or a structured EDM value)
+ */
+ Object visitProperty(PropertyExpression propertyExpression, String uriLiteral, EdmTyped edmProperty);
+
+ /**
+ * Visits a unary expression
+ * @param unaryExpression
+ * The visited unary expression node
+ * @param operator
+ * The operator used in the unary expression
+ * @param operand
+ * The result of visiting the operand expression node
+ * @return
+ * Returns the result from evaluating operator and operand
+ */
+ Object visitUnary(UnaryExpression unaryExpression, UnaryOperator operator, Object operand);
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/FilterExpression.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/FilterExpression.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/FilterExpression.java
new file mode 100644
index 0000000..65c1bb2
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/FilterExpression.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.odata2.api.uri.expression;
+
+/**
+ * Represents a $filter expression in the expression tree returned by {@link org.apache.olingo.odata2.api.uri.UriParser#parseFilterString(org.apache.olingo.odata2.api.edm.EdmEntityType, String)}
+ * Used to define the <b>root</b> expression node in an $filter expression tree.
+ *
+ *
+ */
+public interface FilterExpression extends CommonExpression {
+
+ /**
+ * @return Returns the $filter expression string used to build the expression tree
+ */
+ String getExpressionString();
+
+ /**
+ * @return Returns the expression node representing the first <i>operator</i>,<i>method</i>,<i>literal</i> or <i>property</i> of the expression tree
+ */
+ CommonExpression getExpression();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/LiteralExpression.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/LiteralExpression.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/LiteralExpression.java
new file mode 100644
index 0000000..e8e6819
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/LiteralExpression.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.odata2.api.uri.expression;
+
+/**
+ * Represents a literal expression node in the expression tree returned by the methods:
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseFilterString(org.apache.olingo.odata2.api.edm.EdmEntityType, String) }</li>
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseOrderByString(org.apache.olingo.odata2.api.edm.EdmEntityType, String) }</li>
+ * <br>
+ * <br>
+ * <p>A literal expression node is inserted in the expression tree for any token witch is no
+ * valid <i>operator</i>, <i>method</i> or <i>property</i>.
+ * <br>
+ * <br>
+ * <p><b>For example</b> the filter "$filter=age eq 12" will result in an expression tree
+ * with a literal expression node for "12".
+ * <br>
+ * <br>
+ *
+ */
+public interface LiteralExpression extends CommonExpression {
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/MemberExpression.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/MemberExpression.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/MemberExpression.java
new file mode 100644
index 0000000..8bc20e8
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/MemberExpression.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.expression;
+
+/**
+ * Represents a member expression in the expression tree returned by the methods:
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseFilterString(org.apache.olingo.odata2.api.edm.EdmEntityType, String)}</li>
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseOrderByString(org.apache.olingo.odata2.api.edm.EdmEntityType, String)}</li>
+ * <br>
+ * <br>
+ * <p>A member expression node is inserted in the expression tree for any member operator ("/")
+ * which is used to reference a property of an complex type or entity type.
+ * <br>
+ * <br>
+ * <p><b>For example:</b> The expression "address/city eq 'Heidelberg' will result in an expression tree
+ * containing a member expression node for accessing property "city" which is part of the
+ * complex property "address". Method {@link #getPath()} will return a reference to the "address" property,
+ * method {@link #getProperty()} will return a refence to the "city" property.
+ *
+ */
+public interface MemberExpression extends CommonExpression {
+ /**
+ * @return
+ * Returns the CommonExpression forming the path (the left side of '/') of the method operator.
+ * For OData 2.0 the value returned by {@link #getPath()} is a {@link PropertyExpression}
+ */
+ public CommonExpression getPath();
+
+ /**
+ * @return
+ * Return the CommonExpression forming the property (the right side of '/') of the method operator.
+ * For OData 2.0 the value returned by {@link #getProperty()} is a {@link PropertyExpression}
+ */
+ public CommonExpression getProperty();
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/c5b266a6/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/MethodExpression.java
----------------------------------------------------------------------
diff --git a/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/MethodExpression.java b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/MethodExpression.java
new file mode 100644
index 0000000..bb455d8
--- /dev/null
+++ b/aggregated-sources/org.apache.olingo.odata2-parent-sources/org/apache/olingo/odata2/api/uri/expression/MethodExpression.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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.odata2.api.uri.expression;
+
+import java.util.List;
+
+/**
+ * Represents a method expression in the expression tree returned by the methods:
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseFilterString(org.apache.olingo.odata2.api.edm.EdmEntityType, String) }</li>
+ * <li>{@link org.apache.olingo.odata2.api.uri.UriParser#parseOrderByString(org.apache.olingo.odata2.api.edm.EdmEntityType, String) }</li>
+ * <br>
+ * <br>
+ * <p>A method expression node is inserted in the expression tree for any valid
+ * OData method operator in {@link MethodOperator} (e.g. for "substringof", "concat", "year", ... )
+ * <br>
+ * <br>
+ *
+ */
+public interface MethodExpression extends CommonExpression {
+
+ /**
+ * @return Returns the method object that represents the used method
+ * @see MethodOperator
+ */
+ public MethodOperator getMethod();
+
+ /**
+ * @return Returns the number of provided method parameters
+ */
+ public int getParameterCount();
+
+ /**
+ * @return Returns a ordered list of expressions defining the input parameters for the used method
+ * @see CommonExpression
+ */
+ public List<CommonExpression> getParameters();
+
+}