You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ko...@apache.org on 2014/01/23 12:30:37 UTC

[06/12] [OLINGO-63] Uri Parser: Add support for II

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SelectItemOptionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SelectItemOptionImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SelectItemOptionImpl.java
new file mode 100644
index 0000000..51992a1
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SelectItemOptionImpl.java
@@ -0,0 +1,225 @@
+/*******************************************************************************
+ * 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.producer.core.uri.queryoption;
+
+//TODO rework this 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.odata4.commons.api.edm.Edm;
+import org.apache.olingo.odata4.commons.api.edm.EdmAction;
+import org.apache.olingo.odata4.commons.api.edm.EdmComplexType;
+import org.apache.olingo.odata4.commons.api.edm.EdmElement;
+import org.apache.olingo.odata4.commons.api.edm.EdmEntityType;
+import org.apache.olingo.odata4.commons.api.edm.EdmFunction;
+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.provider.FullQualifiedName;
+import org.apache.olingo.odata4.producer.api.uri.UriResourceProperty;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SelectItem;
+
+public class SelectItemOptionImpl  implements SelectItem{
+
+  private Edm edm;
+  private EdmType finalType;
+  private SelectSegment lastSegment = null;
+
+  // only one of these must me filled
+  private List<SelectSegment> segments = new ArrayList<SelectSegment>();
+  private EdmAction action;
+  private EdmFunction function;
+  private boolean isStar;
+  private FullQualifiedName addOperationsInSchema;
+
+  public class SelectSegment {
+    private EdmElement property; // ia EdmProperty or EdmNavigationProperty
+    private EdmType initialType;
+    private EdmType typeCast;
+    private EdmType finalType;
+    
+
+    public SelectSegment setProperty(EdmElement property) {
+      this.property = property;
+      this.initialType = property.getType();
+      this.finalType = initialType;
+      return this;
+    }
+
+    public EdmType getType() {
+      return finalType;
+    }
+    
+    public EdmType getTypeCast() {
+      return typeCast;
+    }
+    
+    public EdmElement getProperty() {
+      return property;
+    }
+
+    public void addCast(EdmStructuralType type) {
+      this.typeCast = type;
+      this.finalType = type;
+
+    }
+  }
+
+  public EdmType getType() {
+    return finalType;
+  }
+  
+  public SelectItemOptionImpl setEdm(Edm edm) {
+    this.edm = edm;
+    return this;
+  }
+
+  /**
+   * Sets the start type used for the type validation. For example this may be the type of the
+   * last resource path segment.
+   * @param startType
+   * @return
+   */
+  public SelectItemOptionImpl setStartType(EdmType startType) {
+    this.finalType = startType;
+    return this;
+  }
+
+  public SelectItemOptionImpl addProperty(String propertyName) {
+
+    if (!(finalType instanceof EdmStructuralType)) {
+      // TODO error
+      return this;
+    }
+
+    EdmStructuralType structType = (EdmStructuralType) finalType;
+    EdmElement property = (EdmElement) structType.getProperty(propertyName);
+    if (property == null) {
+      // TODO error
+      return this;
+    }
+
+    // create new segment
+    this.lastSegment = new SelectSegment().setProperty(property);
+    this.segments.add(this.lastSegment);
+
+    this.finalType = lastSegment.getType();
+    return this;
+  }
+
+  public void addStar() {
+    // TODO add checks
+    isStar = true;
+  }
+  
+  public void addAllOperationsInSchema(FullQualifiedName addOperationsInSchema) {
+    // TODO add checks
+    this.addOperationsInSchema =addOperationsInSchema;
+  }
+
+  public SelectItemOptionImpl addQualifiedThing(FullQualifiedName fullName) {
+    // TODO add checks
+    if (finalType instanceof EdmEntityType) {
+      EdmEntityType et = edm.getEntityType(fullName);
+      if (((EdmStructuralType) finalType).compatibleTo(et)) {
+        this.lastSegment.addCast(et);
+        this.finalType = this.lastSegment.getType();
+        return this;
+      }
+    }
+
+    if (finalType instanceof EdmComplexType) {
+      EdmComplexType ct = edm.getComplexType(fullName);
+      if (ct != null) {
+        if (((EdmStructuralType) finalType).compatibleTo(ct)) {
+          this.lastSegment.addCast(ct);
+          this.finalType = this.lastSegment.getType();
+          return this;
+        }
+      }
+    }
+
+    FullQualifiedName finalTypeName = new FullQualifiedName(finalType.getNamespace(), finalType.getName());
+
+    // check for action
+    EdmAction action = edm.getAction(fullName, finalTypeName, null);
+    // TODO verify that null ignores if it is a collection
+
+    if (action != null) {
+      if (lastSegment != null) {
+        // TODO throw error action not usable behind property cast
+      }
+      this.action = action;
+    }
+
+    // check for function
+    EdmFunction function = edm.getFunction(fullName, finalTypeName, null, null);
+    // TODO verify that null ignores if it is a collection
+    // TODO verify that the second for parameters null ignores the parameters
+
+    if (function != null) {
+      if (lastSegment != null) {
+        // TODO throw error action not usable behind property cast
+      }
+      this.function = function;
+    }
+
+    return null;
+
+  }
+
+  @Override
+  public boolean isStar() {
+    // TODO Auto-generated method stub
+    return false;
+  }
+
+  @Override
+  public boolean isAllOperationsInSchema() {
+    // TODO Auto-generated method stub
+    return false;
+  }
+
+  @Override
+  public String getNameSpace() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public EdmEntityType getEntityTypeCast() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public EdmAction getAction() {
+    return action;
+  }
+
+  @Override
+  public EdmFunction getFunction() {
+    return function;
+  }
+
+  @Override
+  public List<UriResourceProperty> getPropertyChainList() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SelectOptionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SelectOptionImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SelectOptionImpl.java
new file mode 100644
index 0000000..bfa5fda
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SelectOptionImpl.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.odata4.producer.core.uri.queryoption;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SelectItem;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SelectOption;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
+
+public class SelectOptionImpl extends SystemQueryOptionImpl implements SelectOption {
+
+  private List<SelectItemOptionImpl> selectItems;
+
+  public SelectOptionImpl() {
+    setKind(SystemQueryOptionEnum.SELECT);
+  }
+
+  public SelectOptionImpl setSelectItems(List<SelectItemOptionImpl> selectItems) {
+    this.selectItems = selectItems;
+    return this;
+  }
+
+  @Override
+  public List<SelectItem> getSelectItems() {
+    List<SelectItem> retList = new ArrayList<SelectItem>();
+    for ( SelectItemOptionImpl item : selectItems) {
+      retList.add(item);
+    }
+    return retList;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SkipOptionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SkipOptionImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SkipOptionImpl.java
new file mode 100644
index 0000000..80cf37f
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SkipOptionImpl.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 
+ * 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.producer.core.uri.queryoption;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SkipOption;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
+
+/*TODO implement*/
+public class SkipOptionImpl extends SystemQueryOptionImpl implements SkipOption {
+  private boolean isMax;
+  private String value;
+
+  public SkipOptionImpl() {
+    setKind(SystemQueryOptionEnum.SEARCH);
+  }
+  
+  public String getValue() {
+    return value;
+  }
+
+  public SkipOptionImpl setValue(String value) {
+    this.value = value;
+    return this;
+  }
+
+  @Override
+  public String getSkipValue() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SkipTokenOptionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SkipTokenOptionImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SkipTokenOptionImpl.java
new file mode 100644
index 0000000..78f222d
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SkipTokenOptionImpl.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 
+ * 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.producer.core.uri.queryoption;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SkipTokenOption;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
+
+/*TODO implement*/
+public class SkipTokenOptionImpl extends SystemQueryOptionImpl implements SkipTokenOption{
+  private boolean isMax;
+  private String token;
+
+  public SkipTokenOptionImpl() {
+    setKind(SystemQueryOptionEnum.SEARCH);
+  }
+  
+  public String getToken() {
+    return token;
+  }
+  
+  public SkipTokenOptionImpl
+  setToken( String token) {
+    this.token  = token;
+    return this;
+  }
+
+  @Override
+  public String getSkipTokenValue() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+  
+  
+
+  
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SystemQueryOption.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SystemQueryOption.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SystemQueryOption.java
deleted file mode 100644
index a5454fd..0000000
--- a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SystemQueryOption.java
+++ /dev/null
@@ -1,23 +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.producer.core.uri.queryoption;
-
-public class SystemQueryOption extends QueryOption {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SystemQueryOptionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SystemQueryOptionImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SystemQueryOptionImpl.java
new file mode 100644
index 0000000..c855d80
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/SystemQueryOptionImpl.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 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.producer.core.uri.queryoption;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOption;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
+
+
+public class SystemQueryOptionImpl extends QueryOptionImpl implements SystemQueryOption{
+
+  private SystemQueryOptionEnum kind;
+  
+  @Override
+  public SystemQueryOptionEnum getKind() {
+    return kind;
+  }
+
+  
+  void setKind(SystemQueryOptionEnum kind) {
+    this.kind = kind;
+  }
+
+  
+  
+  @Override
+  public String getName() {
+    return kind.toString();
+  }
+  
+  
+
+  
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/TopOptionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/TopOptionImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/TopOptionImpl.java
new file mode 100644
index 0000000..dff7cec
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/TopOptionImpl.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.odata4.producer.core.uri.queryoption;
+
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.SystemQueryOptionEnum;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.TopOption;
+
+/*TODO implement*/
+public class TopOptionImpl extends SystemQueryOptionImpl implements TopOption {
+  private boolean isMax;
+  private String value;
+
+  public TopOptionImpl() {
+    setKind(SystemQueryOptionEnum.TOP);
+  }
+
+  public String getValue() {
+    return value;
+  }
+  
+  public TopOptionImpl setValue(String value) {
+    this.value = value;
+    return this;
+  }
+
+  @Override
+  public String getTopValue() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/AliasImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/AliasImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/AliasImpl.java
new file mode 100644
index 0000000..7b42317
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/AliasImpl.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * 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.producer.core.uri.queryoption.expression;
+
+public class AliasImpl extends ExpressionImpl {
+
+  private String referenceName;
+
+  public void setReference(String referenceName) {
+    this.referenceName = referenceName;
+  }
+
+  @Override
+  public <T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression {
+    return visitor.visitAlias(referenceName);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/BinaryImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/BinaryImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/BinaryImpl.java
new file mode 100644
index 0000000..bf22f39
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/BinaryImpl.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.producer.core.uri.queryoption.expression;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.BinaryExpression;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.SupportedBinaryOperators;
+
+public class BinaryImpl extends ExpressionImpl implements BinaryExpression, VisitableExression {
+
+  private SupportedBinaryOperators operator;
+  private ExpressionImpl left;
+  private ExpressionImpl right;
+
+  @Override
+  public SupportedBinaryOperators getOperator() {
+    return operator;
+  }
+
+  public BinaryExpression setOperator(SupportedBinaryOperators operator) {
+    this.operator = operator;
+    return this;
+  }
+
+  @Override
+  public Expression getLeftOperand() {
+    return left;
+  }
+
+  public void setLeftOperand(ExpressionImpl operand) {
+    this.left = operand;
+  }
+
+  @Override
+  public Expression getRightOperand() {
+    return right;
+  }
+
+  public void setRightOperand(ExpressionImpl operand) {
+    this.right = operand;
+
+  }
+
+  @Override
+  public <T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression {
+    T left = this.left.accept(visitor);
+    T right = this.right.accept(visitor);
+    return visitor.visitBinaryOperator(operator, left, right);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExceptionVisitExpression.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExceptionVisitExpression.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExceptionVisitExpression.java
new file mode 100644
index 0000000..c0ff338
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExceptionVisitExpression.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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.producer.core.uri.queryoption.expression;
+
+public class ExceptionVisitExpression extends Exception {
+
+  /**
+   * 
+   */
+  private static final long serialVersionUID = 822365726050299076L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExpressionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExpressionImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExpressionImpl.java
new file mode 100644
index 0000000..0bdb71f
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExpressionImpl.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.producer.core.uri.queryoption.expression;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Expression;
+
+public class ExpressionImpl implements Expression, VisitableExression {
+
+  @Override
+  public <T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExpressionVisitor.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExpressionVisitor.java
new file mode 100644
index 0000000..6283865
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/ExpressionVisitor.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * 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.producer.core.uri.queryoption.expression;
+
+import java.util.List;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.SupportedBinaryOperators;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.SupportedMethodCalls;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.SupportedUnaryOperators;
+
+public interface ExpressionVisitor<T> {
+
+  T visitBinaryOperator(SupportedBinaryOperators operator, T left, T right) throws ExceptionVisitExpression;
+
+  T visitUnaryOperator(SupportedUnaryOperators operator, T operand) throws ExceptionVisitExpression;
+
+  T visitMethodCall(SupportedMethodCalls methodCall, List<T> parameters) throws ExceptionVisitExpression;
+
+  T visitLiteral(String literal) throws ExceptionVisitExpression;
+
+  T visitMember(MemberImpl member) throws ExceptionVisitExpression;
+
+  T visitAlias(String referenceName) throws ExceptionVisitExpression;
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/LambdaRefImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/LambdaRefImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/LambdaRefImpl.java
new file mode 100644
index 0000000..665af59
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/LambdaRefImpl.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.odata4.producer.core.uri.queryoption.expression;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.LambdaRef;
+
+public class LambdaRefImpl extends ExpressionImpl implements LambdaRef, VisitableExression {
+
+  private String variableText;
+
+  @Override
+  public String getVariableText() {
+    return variableText;
+  }
+
+  public LambdaRefImpl setVariableText(String text) {
+    this.variableText = text;
+    return this;
+  }
+
+  @Override
+  public <T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression {
+    return null;
+  }
+
+  
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/LiteralImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/LiteralImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/LiteralImpl.java
new file mode 100644
index 0000000..eade6b7
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/LiteralImpl.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.producer.core.uri.queryoption.expression;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Literal;
+
+public class LiteralImpl extends ExpressionImpl implements Literal, VisitableExression {
+
+  private String text;
+
+  @Override
+  public String getText() {
+    return text;
+  }
+
+  public LiteralImpl setText(String text) {
+    this.text = text;
+    return this;
+  }
+
+  @Override
+  public <T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression {
+    return visitor.visitLiteral(text);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/MemberImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/MemberImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/MemberImpl.java
new file mode 100644
index 0000000..56ff31d
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/MemberImpl.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.odata4.producer.core.uri.queryoption.expression;
+
+import org.apache.olingo.odata4.producer.api.uri.UriInfoResource;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Member;
+
+public class MemberImpl extends ExpressionImpl implements Member, VisitableExression {
+
+  private boolean isIT; // means $it as defined in the ABNF
+  private UriInfoResource path;
+
+  @Override
+  public boolean isIT() {
+    return isIT;
+  }
+
+  public Member setIT(boolean isIT) {
+    this.isIT = isIT;
+    return this;
+  }
+
+  @Override
+  public UriInfoResource getPath() {
+    return path;
+  }
+
+  public Member setPath(UriInfoResource pathSegments) {
+    this.path = pathSegments;
+    return this;
+  }
+
+  @Override
+  public <T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression {
+    return visitor.visitMember(this);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/MethodCallImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/MethodCallImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/MethodCallImpl.java
new file mode 100644
index 0000000..f8c666d
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/MethodCallImpl.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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.producer.core.uri.queryoption.expression;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.MethodCall;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.SupportedMethodCalls;
+
+public class MethodCallImpl extends ExpressionImpl  implements MethodCall, VisitableExression{
+
+  private SupportedMethodCalls method;
+  private List<ExpressionImpl> parameters = new ArrayList<ExpressionImpl>();
+  
+  @Override
+  public SupportedMethodCalls getMethod() {
+    return method;
+  }
+
+  public MethodCallImpl setMethod(SupportedMethodCalls methodCalls) {
+    this.method = methodCalls;
+    return this;
+  }
+  
+  @Override
+  public List<Expression> getParameters() {
+    List<Expression> list = new ArrayList<Expression>();
+    for ( ExpressionImpl item : parameters) {
+      list.add(item);
+    }
+    return list;
+  }
+
+  public MethodCallImpl addParameter(ExpressionImpl readCommonExpression) {
+    parameters.add(readCommonExpression);
+    return this;
+  }
+
+  @Override
+  public <T> T accept(ExpressionVisitor<T>  visitor) throws ExceptionVisitExpression {
+    List<T> userParameters = new ArrayList<T>();
+    for (ExpressionImpl parameter : parameters ) {
+      userParameters.add(parameter.accept(visitor));
+    }
+    return visitor.visitMethodCall(method, userParameters);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/TypeLiteralImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/TypeLiteralImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/TypeLiteralImpl.java
new file mode 100644
index 0000000..e74ff76
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/TypeLiteralImpl.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.odata4.producer.core.uri.queryoption.expression;
+
+import org.apache.olingo.odata4.commons.api.edm.EdmType;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.TypeLiteral;
+
+public class TypeLiteralImpl extends ExpressionImpl implements TypeLiteral, VisitableExression {
+
+  private EdmType type;
+
+  @Override
+  public EdmType getType() {
+    return type;
+  }
+  
+  public TypeLiteralImpl setType(EdmType type) {
+    this.type = type;
+    return this;
+  }
+
+  @Override
+  public <T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression {
+    return null;
+  }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/UnaryOperatorImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/UnaryOperatorImpl.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/UnaryOperatorImpl.java
new file mode 100644
index 0000000..98da4ba
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/UnaryOperatorImpl.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.odata4.producer.core.uri.queryoption.expression;
+
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.SupportedUnaryOperators;
+import org.apache.olingo.odata4.producer.api.uri.queryoption.expression.UnaryOperator;
+
+public class UnaryOperatorImpl extends ExpressionImpl implements UnaryOperator, VisitableExression {
+
+  private SupportedUnaryOperators operator;
+  private ExpressionImpl expression;
+
+  @Override
+  public SupportedUnaryOperators getOperator() {
+    return operator;
+  }
+
+  public void setOperator(SupportedUnaryOperators operator) {
+    this.operator = operator;
+  }
+
+  @Override
+  public Expression getOperand() {
+    return expression;
+  }
+
+  public void setOperand(ExpressionImpl expression) {
+    this.expression = expression;
+  }
+
+  @Override
+  public <T> T accept(ExpressionVisitor<T> visitor) throws ExceptionVisitExpression {
+    T operand = expression.accept(visitor);
+    return visitor.visitUnaryOperator(operator, operand);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7955eadf/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/VisitableExression.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/VisitableExression.java b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/VisitableExression.java
new file mode 100644
index 0000000..e4a2235
--- /dev/null
+++ b/odata4-lib/odata4-producer-core/src/main/java/org/apache/olingo/odata4/producer/core/uri/queryoption/expression/VisitableExression.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.odata4.producer.core.uri.queryoption.expression;
+
+
+
+
+
+
+
+
+/* TODO update documentation*/
+public interface VisitableExression {
+
+  /**
+   * Method {@link #accept(ExpressionVisitor)} is called when traversing the expression tree. This method is invoked on
+   * each
+   * expression used as node in an expression tree. The implementations should
+   * behave as follows:
+   * <li>Call accept on all sub nodes and store the returned Objects
+   * <li>Call the appropriate method on the {@link ExpressionVisitor} instance and provide the stored objects to that
+   * instance
+   * <li>Return the object which should be passed to the processing algorithm of the parent expression node
+   * <br>
+   * <br>
+   * @param visitor
+   * Object ( implementing {@link ExpressionVisitor}) whose methods are called during traversing a expression node of
+   * the expression tree.
+   * @return
+   * Object which should be passed to the processing algorithm of the parent expression node
+   * @throws ExceptionVisitExpression
+   * Exception occurred the OData library while traversing the tree
+   * @throws ODataApplicationException
+   * Exception thrown by the application who implemented the visitor
+   */
+  <T> T accept(ExpressionVisitor<T> visitor)   throws ExceptionVisitExpression;
+}
+