olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chri...@apache.org
Subject [2/3] olingo-odata4 git commit: [OLINGO-786] Annotation metadata serialization and tests
Date Tue, 20 Oct 2015 13:52:51 GMT
[OLINGO-786] Annotation metadata serialization and tests


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/d00e3881
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/d00e3881
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/d00e3881

Branch: refs/heads/olingo786
Commit: d00e3881dcf44611ac1f778168ba95a18df6ca33
Parents: 4121024
Author: Christian Amend <christian.amend@sap.com>
Authored: Tue Oct 20 15:27:11 2015 +0200
Committer: Christian Amend <christian.amend@sap.com>
Committed: Tue Oct 20 15:27:11 2015 +0200

----------------------------------------------------------------------
 .../olingo/fit/base/MetadataTestITCase.java     |   2 +-
 .../apache/olingo/client/core/MetadataTest.java |   6 +-
 .../edm/annotation/EdmConstantExpression.java   |  37 ++-
 .../api/edm/annotation/EdmExpression.java       |  49 +++
 .../EdmLogicalOrComparisonExpression.java       |   4 +-
 .../api/edm/annotation/EdmPropertyValue.java    |   2 +-
 .../commons/api/edm/annotation/EdmUrlRef.java   |   4 +-
 .../api/edm/provider/annotation/CsdlCast.java   |  24 +-
 .../annotation/CsdlDynamicExpression.java       |  16 -
 .../provider/annotation/CsdlPropertyValue.java  |   3 +-
 .../edm/annotation/AbstractEdmExpression.java   |   2 -
 ...bstractEdmLogicalOrComparisonExpression.java |  26 ++
 .../edm/annotation/EdmAnnotationPathImpl.java   |   5 +
 .../core/edm/annotation/EdmApplyImpl.java       |   5 +
 .../core/edm/annotation/EdmCastImpl.java        |   4 +
 .../core/edm/annotation/EdmCollectionImpl.java  |   5 +
 .../annotation/EdmConstantExpressionImpl.java   | 147 ++++----
 .../commons/core/edm/annotation/EdmIfImpl.java  |   4 +
 .../core/edm/annotation/EdmIsOfImpl.java        |   4 +
 .../edm/annotation/EdmLabeledElementImpl.java   |   4 +
 .../EdmLabeledElementReferenceImpl.java         |   5 +
 .../EdmNavigationPropertyPathImpl.java          |   5 +
 .../core/edm/annotation/EdmNullImpl.java        |   5 +
 .../core/edm/annotation/EdmPathImpl.java        |   5 +
 .../edm/annotation/EdmPropertyPathImpl.java     |  11 +-
 .../edm/annotation/EdmPropertyValueImpl.java    |   9 +-
 .../core/edm/annotation/EdmRecordImpl.java      |   4 +
 .../core/edm/annotation/EdmUrlRefImpl.java      |   9 +-
 .../edm/annotations/EdmAnnotationPathTest.java  |   2 +
 .../core/edm/annotations/EdmApplyImplTest.java  |   2 +
 .../core/edm/annotations/EdmCastImplTest.java   |   2 +
 .../edm/annotations/EdmCollectionImplTest.java  |   2 +
 .../EdmConstantExpressionImplTest.java          |  13 +
 .../core/edm/annotations/EdmIfImplTest.java     |   2 +
 .../core/edm/annotations/EdmIsOfImplTest.java   |   2 +
 .../annotations/EdmLabeledElementImplTest.java  |   2 +
 .../EdmLabledElementReferenceImplTest.java      |   2 +
 .../EdmLogicalOrComparisonImplTest.java         |   2 +
 .../EdmNavigationPropertyPathImpTest.java       |   2 +
 .../core/edm/annotations/EdmPathImplTest.java   |   2 +
 .../annotations/EdmPropertyPathImplTest.java    |   2 +
 .../annotations/EdmPropertyValueImplTest.java   |  22 +-
 .../core/edm/annotations/EdmRecordImplTest.java |   2 +
 .../core/edm/annotations/EdmUrlRefImplTest.java |  15 +
 .../xml/MetadataDocumentXmlSerializer.java      | 298 +++++++++++++++--
 .../xml/MetadataDocumentXmlSerializerTest.java  | 331 +++++++++++++++++--
 46 files changed, 930 insertions(+), 181 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/fit/src/test/java/org/apache/olingo/fit/base/MetadataTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/base/MetadataTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/base/MetadataTestITCase.java
index efcc41a..5509cb2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/base/MetadataTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/base/MetadataTestITCase.java
@@ -68,7 +68,7 @@ public class MetadataTestITCase extends AbstractTestITCase {
     assertNotNull(record);
     assertEquals(3, record.getPropertyValues().size());
     assertTrue(record.getPropertyValues().get(0).getValue().isConstant());
-    assertTrue((Boolean) record.getPropertyValues().get(0).getValue().asConstant().getValue().asPrimitive());
+    assertTrue((Boolean) record.getPropertyValues().get(0).getValue().asConstant().asPrimitive());
     assertTrue(record.getPropertyValues().get(1).getValue().asDynamic().isCollection());
     assertEquals(1, record.getPropertyValues().get(1).getValue().asDynamic().asCollection().getItems().size());
     assertTrue(record.getPropertyValues().get(1).getValue().asDynamic().asCollection().getItems().get(0).isDynamic());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java
index 99aa7bd..220f293 100644
--- a/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java
+++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/MetadataTest.java
@@ -174,7 +174,7 @@ public class MetadataTest extends AbstractTest {
     final EdmAnnotation annotation = annotationGroup.getAnnotations().get(0);
     assertNotNull(annotation);
     assertTrue(annotation.getExpression().isConstant());
-    assertEquals("String", annotation.getExpression().asConstant().getValue().getType());
+    assertEquals("String", annotation.getExpression().asConstant().getExpressionName());
 
     assertEquals(10, schema.getAnnotationGroups().get(3).getAnnotations().size());
   }
@@ -333,10 +333,10 @@ public class MetadataTest extends AbstractTest {
     assertNotNull(group);
 
     final EdmAnnotation time1 = group.getAnnotations().get(0);
-    assertEquals("TimeOfDay", time1.getExpression().asConstant().getValue().getType());
+    assertEquals("TimeOfDay", time1.getExpression().asConstant().getExpressionName());
 
     final EdmAnnotation time2 = group.getAnnotations().get(1);
-    assertEquals("TimeOfDay", time2.getExpression().asConstant().getValue().getType());
+    assertEquals("TimeOfDay", time2.getExpression().asConstant().getExpressionName());
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java
index fd2031f..7c9c69d 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantExpression.java
@@ -6,9 +6,9 @@
  * 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
@@ -18,19 +18,40 @@
  */
 package org.apache.olingo.commons.api.edm.annotation;
 
-import org.apache.olingo.commons.api.data.Valuable;
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.geo.Geospatial;
 
 /**
  * Represents a constant expression
  */
 public interface EdmConstantExpression extends EdmExpression {
-  
+
+  // TODO: Is methods
+
+  /**
+   * The value object of this expression or null if it is of type enum or geospatial.
+   * @return a value object or null
+   */
+  Object asPrimitive();
+
+  /**
+   * A list of enum members or empty list if this expression is of type primitve or geospatial.
+   * @return a list of all enum members or empty list
+   */
+  List<String> asEnumMembers();
+
+  /**
+   * Return the Enum type name or null if this expression is of type primitve or geospatial.
+   * @return enum type name or null
+   */
+  String getEnumTypeName();
+
   /**
-   * Value of the constant expression
-   * @return value of the constant expression
+   * Return the geospatial object or null if this expression is of type primitve or enum.
+   * @return geospatial object or null
    */
-  //TODO: Delete data package dependency
-  Valuable getValue();
+  Geospatial asGeospatial();
 
   /**
    * Returns the value of the expression as String

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmExpression.java
index 3f89b6f..2f6248b 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmExpression.java
@@ -24,6 +24,55 @@ package org.apache.olingo.commons.api.edm.annotation;
  */
 public interface EdmExpression {
 
+  enum EdmExpressionType {
+    //Constant
+    Binary,
+    Bool,
+    Date,
+    DateTimeOffset,
+    Decimal,
+    Duration,
+    EnumMember,
+    Float,
+    Guid,
+    Int,
+    String,
+    TimeOfDay,
+    //Dynamic
+    //Logical
+    And,
+    Or,
+    Not,
+    //Comparison
+    Eq,
+    Ne,
+    Gt,
+    Ge,
+    Lt,
+    Le,
+    //Other
+    AnnotationPath,
+    Apply,
+    Cast,
+    Collection,
+    If,
+    IsOf,
+    LabeledElement,
+    LabeledElementReference,
+    Null,
+    NavigationPropertyPath,
+    Path,
+    PropertyPath,
+    Record,
+    UrlRef;
+  }
+  
+  /**
+   * See {@link EdmExpressionType} for details.
+   * @return the type of this expression
+   */
+  EdmExpressionType getExpressionType();
+  
   /**
    * Will return the name of the expression e.g. Apply or Cast.
    * @return the name of the expression

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmLogicalOrComparisonExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmLogicalOrComparisonExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmLogicalOrComparisonExpression.java
index 4db2eab..c44cf3a 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmLogicalOrComparisonExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmLogicalOrComparisonExpression.java
@@ -18,10 +18,12 @@
  */
 package org.apache.olingo.commons.api.edm.annotation;
 
+import org.apache.olingo.commons.api.edm.EdmAnnotatable;
+
 /**
  * Represents a generic expression with two child exprssions
  */
-public interface EdmLogicalOrComparisonExpression extends EdmDynamicExpression {
+public interface EdmLogicalOrComparisonExpression extends EdmDynamicExpression, EdmAnnotatable {
 
   /**
    * Returns the first expression (left child)

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmPropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmPropertyValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmPropertyValue.java
index 667f849..67aeae9 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmPropertyValue.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmPropertyValue.java
@@ -24,7 +24,7 @@ import org.apache.olingo.commons.api.edm.EdmAnnotatable;
  * The edm:PropertyValue element supplies a value to a property on the type instantiated by an 
  * edm:Record expression (See {@link EdmRecord}). The value is obtained by evaluating an expression.
  */
-public interface EdmPropertyValue extends EdmDynamicExpression, EdmAnnotatable {
+public interface EdmPropertyValue extends EdmAnnotatable {
   /**
    * Property name
    * @return Property name

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmUrlRef.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmUrlRef.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmUrlRef.java
index 1fbc63a..ff7ff17 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmUrlRef.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmUrlRef.java
@@ -18,11 +18,13 @@
  */
 package org.apache.olingo.commons.api.edm.annotation;
 
+import org.apache.olingo.commons.api.edm.EdmAnnotatable;
+
 /**
  * The edm:UrlRef expression enables a value to be obtained by sending a GET request to the value of 
  * the UrlRef expression. 
  */
-public interface EdmUrlRef extends EdmDynamicExpression {
+public interface EdmUrlRef extends EdmDynamicExpression, EdmAnnotatable {
   
   /**
    * Returns a expression of type Edm.String

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
index 2545f3f..6edbb3d 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlCast.java
@@ -29,7 +29,7 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
  * Represents an edm:Cast expression.
  * Casts the value obtained from its single child expression to the specified type
  */
-public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable{
+public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable {
   private static final long serialVersionUID = 7664148202663405946L;
 
   private String type;
@@ -44,12 +44,12 @@ public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable{
   public List<CsdlAnnotation> getAnnotations() {
     return annotations;
   }
-  
+
   public CsdlCast setAnnotations(List<CsdlAnnotation> annotations) {
     this.annotations = annotations;
     return this;
   }
-  
+
   /**
    * Value cast to
    * @return value cast to
@@ -58,8 +58,9 @@ public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable{
     return type;
   }
 
-  public void setType(final String type) {
+  public CsdlCast setType(final String type) {
     this.type = type;
+    return this;
   }
 
   /**
@@ -70,8 +71,9 @@ public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable{
     return maxLength;
   }
 
-  public void setMaxLength(final Integer maxLength) {
+  public CsdlCast setMaxLength(final Integer maxLength) {
     this.maxLength = maxLength;
+    return this;
   }
 
   /**
@@ -82,8 +84,9 @@ public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable{
     return precision;
   }
 
-  public void setPrecision(final Integer precision) {
+  public CsdlCast setPrecision(final Integer precision) {
     this.precision = precision;
+    return this;
   }
 
   /**
@@ -94,8 +97,9 @@ public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable{
     return scale;
   }
 
-  public void setScale(final Integer scale) {
+  public CsdlCast setScale(final Integer scale) {
     this.scale = scale;
+    return this;
   }
 
   /**
@@ -106,8 +110,9 @@ public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable{
     return srid;
   }
 
-  public void setSrid(final SRID srid) {
+  public CsdlCast setSrid(final SRID srid) {
     this.srid = srid;
+    return this;
   }
 
   /**
@@ -118,7 +123,8 @@ public class CsdlCast extends CsdlDynamicExpression implements CsdlAnnotatable{
     return value;
   }
 
-  public void setValue(final CsdlExpression value) {
+  public CsdlCast setValue(final CsdlExpression value) {
     this.value = value;
+    return this;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
index 3ee1468..c298f01 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlDynamicExpression.java
@@ -233,22 +233,6 @@ public abstract class CsdlDynamicExpression extends CsdlExpression {
   }
 
   /**
-   * Returns true if the expression is a edm:PropertyValue expression
-   * @return true if the expression is a edm:PropertyValue expression
-   */
-  public boolean isPropertyValue() {
-    return this instanceof CsdlPropertyValue;
-  }
-
-  /**
-   * Casts the expression to a {@link CsdlPropertyValue} expression
-   * @return PropertyValue expression
-   */
-  public CsdlPropertyValue asPropertyValue() {
-    return isPropertyValue() ? (CsdlPropertyValue) this : null;
-  }
-
-  /**
    * Returns true if the expression is a edm:Record expression
    * @return true if the expression is a edm:Record expression
    */

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
index 2be2891..1aec97e 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/provider/annotation/CsdlPropertyValue.java
@@ -21,6 +21,7 @@ package org.apache.olingo.commons.api.edm.provider.annotation;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.olingo.commons.api.edm.provider.CsdlAbstractEdmItem;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotatable;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 
@@ -30,7 +31,7 @@ import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
  * edm:Record expression (See {@link org.apache.olingo.commons.api.edm.annotation.EdmRecord}). 
  * The value is obtained by evaluating an expression.
  */
-public class CsdlPropertyValue extends CsdlDynamicExpression implements CsdlAnnotatable{
+public class CsdlPropertyValue extends CsdlAbstractEdmItem implements CsdlAnnotatable{
 
   private static final long serialVersionUID = -6671376680245613990L;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmExpression.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmExpression.java
index 89469df..c21c40e 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmExpression.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmExpression.java
@@ -141,8 +141,6 @@ public abstract class AbstractEdmExpression implements EdmExpression {
       _expression = new EdmPathImpl(edm, exp.asPath());
     } else if (exp.isPropertyPath()) {
       _expression = new EdmPropertyPathImpl(edm, exp.asPropertyPath());
-    } else if (exp.isPropertyValue()) {
-      _expression = new EdmPropertyValueImpl(edm, exp.asPropertyValue());
     } else if (exp.isRecord()) {
       _expression = new EdmRecordImpl(edm, exp.asRecord());
     } else if (exp.isUrlRef()) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmLogicalOrComparisonExpression.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmLogicalOrComparisonExpression.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmLogicalOrComparisonExpression.java
index 9aa8b00..e79510e 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmLogicalOrComparisonExpression.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/AbstractEdmLogicalOrComparisonExpression.java
@@ -41,6 +41,32 @@ public abstract class AbstractEdmLogicalOrComparisonExpression
   }
 
   @Override
+  public EdmExpressionType getExpressionType() {
+    switch (csdlExp.getType()) {
+    case And:
+      return EdmExpressionType.And;
+    case Or:
+      return EdmExpressionType.Or;
+    case Not:
+      return EdmExpressionType.Not;
+    case Eq:
+      return EdmExpressionType.Eq;
+    case Ne:
+      return EdmExpressionType.Ne;
+    case Gt:
+      return EdmExpressionType.Gt;
+    case Ge:
+      return EdmExpressionType.Ge;
+    case Lt:
+      return EdmExpressionType.Lt;
+    case Le:
+      return EdmExpressionType.Le;
+    default:
+      throw new EdmException("Invalid Expressiontype for logical or comparison expression: " + csdlExp.getType());
+    }
+  }
+
+  @Override
   public EdmExpression getLeftExpression() {
     if (left == null) {
       if (csdlExp.getLeft() == null) {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAnnotationPathImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAnnotationPathImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAnnotationPathImpl.java
index 2c6cf50..65b2248 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAnnotationPathImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmAnnotationPathImpl.java
@@ -35,4 +35,9 @@ public class EdmAnnotationPathImpl extends AbstractEdmDynamicExpression implemen
   public String getValue() {
     return csdlExp.getValue();
   }
+
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.AnnotationPath;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmApplyImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmApplyImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmApplyImpl.java
index a185a55..7562b22 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmApplyImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmApplyImpl.java
@@ -65,4 +65,9 @@ public class EdmApplyImpl extends AbstractEdmAnnotatableDynamicExpression implem
     }
     return parameters;
   }
+
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.Apply;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java
index ce793cf..830fd95 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCastImpl.java
@@ -81,4 +81,8 @@ public class EdmCastImpl extends AbstractEdmAnnotatableDynamicExpression impleme
     return value;
   }
 
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.Cast;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCollectionImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCollectionImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCollectionImpl.java
index e8d5fca..d7b9087 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCollectionImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmCollectionImpl.java
@@ -51,4 +51,9 @@ public class EdmCollectionImpl extends AbstractEdmDynamicExpression implements E
     }
     return items;
   }
+
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.Collection;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantExpressionImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantExpressionImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantExpressionImpl.java
index 8e199ec..99e32fa 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantExpressionImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmConstantExpressionImpl.java
@@ -19,87 +19,58 @@
 package org.apache.olingo.commons.core.edm.annotation;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.commons.api.Constants;
-import org.apache.olingo.commons.api.data.Property;
-import org.apache.olingo.commons.api.data.Valuable;
-import org.apache.olingo.commons.api.data.ValueType;
 import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.annotation.EdmConstantExpression;
+import org.apache.olingo.commons.api.edm.geo.Geospatial;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
 
 public class EdmConstantExpressionImpl extends AbstractEdmExpression implements EdmConstantExpression {
 
-  private Valuable value;
   private EdmPrimitiveType type;
-  private final CsdlConstantExpression constExprConstruct;
+  private final CsdlConstantExpression csdlExp;
+
+  private boolean built = false;
+  private Object primitive;
+  private String enumTypeName;
+  private List<String> enumMembers;
+  private Geospatial geospatial;
 
   public EdmConstantExpressionImpl(Edm edm, final CsdlConstantExpression constExprConstruct) {
     super(edm, constExprConstruct.getType().toString());
-    this.constExprConstruct = constExprConstruct;
-  }
-
-  @Override
-  public Valuable getValue() {
-    if(value == null){
-      build();
-    }
-    return value;
+    this.csdlExp = constExprConstruct;
   }
 
   @Override
   public String getValueAsString() {
-    return constExprConstruct.getValue();
-    
-//    if (value == null) {
-//      build();
-//    }
-//    if (value == null) {
-//      return "";
-//    } else if (value.isEnum()) {
-//      return value.getValue().toString();
-//    } else if (value.isGeospatial()) {
-//      return value.toString();
-//    } else {
-//      // TODO: check after copied from ClientPrimitiveValueImpl
-//      try {
-//        return type.valueToString(value.getValue(), null, null,
-//            Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null);
-//      } catch (EdmPrimitiveTypeException e) {
-//        throw new IllegalArgumentException(e);
-//      }
-//    }
+    return csdlExp.getValue();
   }
 
   private void build() {
-    if (constExprConstruct.getType() == CsdlConstantExpression.ConstantExpressionType.EnumMember) {
-      // TODO: Delete ProeprtyValue here
-      final List<Property> enumValues = new ArrayList<Property>();
-      String enumTypeName = null;
-      for (String split : StringUtils.split(constExprConstruct.getValue(), ' ')) {
-        final String[] enumSplit = StringUtils.split(split, '/');
-        enumTypeName = enumSplit[0];
-        enumValues.add(new Property(enumSplit[0], null, ValueType.ENUM, enumSplit[1]));
+    if (csdlExp.getType() == CsdlConstantExpression.ConstantExpressionType.EnumMember) {
+      if (csdlExp.getValue() == null) {
+        throw new EdmException("Expression value must not be null");
       }
-      if (enumValues.size() == 1) {
-        value = enumValues.get(0);
-      } else {
-        final List<Property> collValue = new ArrayList<Property>();
-        for (Property enumValue : enumValues) {
-          collValue.add(enumValue);
+      final List<String> localEnumValues = new ArrayList<String>();
+      for (String split : csdlExp.getValue().split(" ")) {
+        final String[] enumSplit = split.split("/");
+        if (enumSplit.length != 2) {
+          throw new EdmException("Enum expression value must consist of enumTypeName/EnumMember.");
         }
-        value = new Property(enumTypeName, null, ValueType.COLLECTION_ENUM, collValue);
+        enumTypeName = enumSplit[0];
+        localEnumValues.add(enumSplit[1]);
       }
-      type = null;
+      enumMembers = Collections.unmodifiableList(localEnumValues);
     } else {
       EdmPrimitiveTypeKind kind;
-      switch (constExprConstruct.getType()) {
+      switch (csdlExp.getType()) {
       case Binary:
         kind = EdmPrimitiveTypeKind.Binary;
         break;
@@ -136,13 +107,75 @@ public class EdmConstantExpressionImpl extends AbstractEdmExpression implements
       }
       type = EdmPrimitiveTypeFactory.getInstance(kind);
       try {
-        final Object valueOfString = type.valueOfString(constExprConstruct.getValue(),
-            null, null, Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null,
-            type.getDefaultType());
-        value = new Property(kind.getFullQualifiedName().getName(), null, ValueType.PRIMITIVE, valueOfString);
+        primitive = type.valueOfString(csdlExp.getValue(), null, null, null, null, null, type.getDefaultType());
       } catch (EdmPrimitiveTypeException e) {
         throw new IllegalArgumentException(e);
       }
     }
+    built = true;
+  }
+
+  @Override
+  public EdmExpressionType getExpressionType() {
+    switch (csdlExp.getType()) {
+    case Binary:
+      return EdmExpressionType.Binary;
+    case Bool:
+      return EdmExpressionType.Bool;
+    case Date:
+      return EdmExpressionType.Date;
+    case DateTimeOffset:
+      return EdmExpressionType.DateTimeOffset;
+    case Decimal:
+      return EdmExpressionType.Decimal;
+    case Duration:
+      return EdmExpressionType.Duration;
+    case EnumMember:
+      return EdmExpressionType.EnumMember;
+    case Float:
+      return EdmExpressionType.Float;
+    case Guid:
+      return EdmExpressionType.Guid;
+    case Int:
+      return EdmExpressionType.Int;
+    case String:
+      return EdmExpressionType.String;
+    case TimeOfDay:
+      return EdmExpressionType.TimeOfDay;
+    default:
+      throw new EdmException("Invalid Expressiontype for constant expression: " + csdlExp.getType());
+    }
+  }
+
+  @Override
+  public Object asPrimitive() {
+    if (!built) {
+      build();
+    }
+    return primitive;
+  }
+
+  @Override
+  public List<String> asEnumMembers() {
+    if (!built) {
+      build();
+    }
+    return enumMembers;
+  }
+
+  @Override
+  public String getEnumTypeName() {
+    if (!built) {
+      build();
+    }
+    return enumTypeName;
+  }
+
+  @Override
+  public Geospatial asGeospatial() {
+    if (!built) {
+      build();
+    }
+    return geospatial;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIfImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIfImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIfImpl.java
index e33bd11..eaaeba0 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIfImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIfImpl.java
@@ -67,4 +67,8 @@ public class EdmIfImpl extends AbstractEdmAnnotatableDynamicExpression implement
     return _else;
   }
 
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.If;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java
index aa4ed16..a6b189f 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmIsOfImpl.java
@@ -83,4 +83,8 @@ public class EdmIsOfImpl extends AbstractEdmAnnotatableDynamicExpression impleme
     return value;
   }
 
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.IsOf;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementImpl.java
index babe388..64755c3 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementImpl.java
@@ -54,4 +54,8 @@ public class EdmLabeledElementImpl
     return value;
   }
 
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.LabeledElement;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementReferenceImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementReferenceImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementReferenceImpl.java
index 5c1887c..971872a 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementReferenceImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmLabeledElementReferenceImpl.java
@@ -35,4 +35,9 @@ public class EdmLabeledElementReferenceImpl extends AbstractEdmDynamicExpression
   public String getValue() {
     return csdlExp.getValue();
   }
+  
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.LabeledElementReference;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNavigationPropertyPathImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNavigationPropertyPathImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNavigationPropertyPathImpl.java
index 7d09276..dae9749 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNavigationPropertyPathImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNavigationPropertyPathImpl.java
@@ -35,4 +35,9 @@ public class EdmNavigationPropertyPathImpl extends AbstractEdmDynamicExpression
   public String getValue() {
     return csdlExp.getValue();
   }
+  
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.NavigationPropertyPath;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNullImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNullImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNullImpl.java
index b1151fc..1f7222b 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNullImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmNullImpl.java
@@ -27,4 +27,9 @@ public class EdmNullImpl extends AbstractEdmAnnotatableDynamicExpression impleme
   public EdmNullImpl(Edm edm, CsdlNull csdlExp) {
     super(edm, "Null", csdlExp);
   }
+  
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.Null;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPathImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPathImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPathImpl.java
index 35c7d30..8fb662b 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPathImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPathImpl.java
@@ -35,4 +35,9 @@ public class EdmPathImpl extends AbstractEdmDynamicExpression implements EdmPath
   public String getValue() {
     return csdlExp.getValue();
   }
+  
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.Path;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyPathImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyPathImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyPathImpl.java
index 1f18616..efab5d5 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyPathImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyPathImpl.java
@@ -6,9 +6,9 @@
  * 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
@@ -26,7 +26,7 @@ public class EdmPropertyPathImpl extends AbstractEdmDynamicExpression implements
 
   private final CsdlPropertyPath csdlExp;
 
-  public EdmPropertyPathImpl(Edm edm, CsdlPropertyPath  csdlExp) {
+  public EdmPropertyPathImpl(Edm edm, CsdlPropertyPath csdlExp) {
     super(edm, "PropertyPath");
     this.csdlExp = csdlExp;
   }
@@ -35,4 +35,9 @@ public class EdmPropertyPathImpl extends AbstractEdmDynamicExpression implements
   public String getValue() {
     return csdlExp.getValue();
   }
+
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.PropertyPath;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyValueImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyValueImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyValueImpl.java
index 97406d4..214f528 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyValueImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmPropertyValueImpl.java
@@ -23,15 +23,15 @@ import org.apache.olingo.commons.api.edm.EdmException;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmPropertyValue;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPropertyValue;
+import org.apache.olingo.commons.core.edm.AbstractEdmAnnotatable;
 
-public class EdmPropertyValueImpl
-    extends AbstractEdmAnnotatableDynamicExpression implements EdmPropertyValue {
+public class EdmPropertyValueImpl extends AbstractEdmAnnotatable implements EdmPropertyValue {
 
   private EdmExpression value;
   private CsdlPropertyValue csdlExp;
 
   public EdmPropertyValueImpl(Edm edm, CsdlPropertyValue csdlExp) {
-    super(edm, "PropertyValue", csdlExp);
+    super(edm, csdlExp);
     this.csdlExp = csdlExp;
   }
 
@@ -49,9 +49,8 @@ public class EdmPropertyValueImpl
       if (csdlExp.getValue() == null) {
         throw new EdmException("PropertyValue expressions require an expression value.");
       }
-      value = getExpression(edm, csdlExp.getValue());
+      value = AbstractEdmExpression.getExpression(edm, csdlExp.getValue());
     }
     return value;
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmRecordImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmRecordImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmRecordImpl.java
index d4af2ee..919f189 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmRecordImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmRecordImpl.java
@@ -72,4 +72,8 @@ public class EdmRecordImpl extends AbstractEdmAnnotatableDynamicExpression imple
     return type;
   }
 
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.Record;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmUrlRefImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmUrlRefImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmUrlRefImpl.java
index 1210dbc..3803816 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmUrlRefImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/annotation/EdmUrlRefImpl.java
@@ -24,13 +24,13 @@ import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmUrlRef;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlUrlRef;
 
-public class EdmUrlRefImpl extends AbstractEdmDynamicExpression implements EdmUrlRef {
+public class EdmUrlRefImpl extends AbstractEdmAnnotatableDynamicExpression implements EdmUrlRef {
 
   private final CsdlUrlRef csdlExp;
   private EdmExpression value;
 
   public EdmUrlRefImpl(Edm edm, CsdlUrlRef csdlExp) {
-    super(edm, "UrlRef");
+    super(edm, "UrlRef", csdlExp);
     this.csdlExp = csdlExp;
   }
 
@@ -44,4 +44,9 @@ public class EdmUrlRefImpl extends AbstractEdmDynamicExpression implements EdmUr
     }
     return value;
   }
+  
+  @Override
+  public EdmExpressionType getExpressionType() {
+    return EdmExpressionType.UrlRef;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmAnnotationPathTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmAnnotationPathTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmAnnotationPathTest.java
index 122abd7..071e067 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmAnnotationPathTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmAnnotationPathTest.java
@@ -27,6 +27,7 @@ import static org.mockito.Mockito.mock;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlAnnotationPath;
 import org.apache.olingo.commons.core.edm.annotation.AbstractEdmExpression;
 import org.junit.Test;
@@ -42,6 +43,7 @@ public class EdmAnnotationPathTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asAnnotationPath());
 
     assertEquals("AnnotationPath", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.AnnotationPath, dynExp.getExpressionType());
     assertNull(dynExp.asAnnotationPath().getValue());
 
     assertSingleKindDynamicExpression(dynExp);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmApplyImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmApplyImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmApplyImplTest.java
index 459536a..96706e2 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmApplyImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmApplyImplTest.java
@@ -32,6 +32,7 @@ import org.apache.olingo.commons.api.edm.EdmException;
 import org.apache.olingo.commons.api.edm.annotation.EdmApply;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlApply;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
@@ -55,6 +56,7 @@ public class EdmApplyImplTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asApply());
 
     assertEquals("Apply", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.Apply, dynExp.getExpressionType());
     assertSingleKindDynamicExpression(dynExp);
 
     EdmApply asApply = dynExp.asApply();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCastImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCastImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCastImplTest.java
index 1427e18..524a8c9 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCastImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCastImplTest.java
@@ -34,6 +34,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
 import org.apache.olingo.commons.api.edm.annotation.EdmCast;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlCast;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
@@ -52,6 +53,7 @@ public class EdmCastImplTest extends AbstractAnnotationTest{
     assertNotNull(dynExp.asCast());
 
     assertEquals("Cast", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.Cast, dynExp.getExpressionType());
     assertSingleKindDynamicExpression(dynExp);
     try {
       dynExp.asCast().getValue();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCollectionImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCollectionImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCollectionImplTest.java
index 0d7e72d..f8c7329 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCollectionImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmCollectionImplTest.java
@@ -30,6 +30,7 @@ import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.annotation.EdmCollection;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlCollection;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression.ConstantExpressionType;
@@ -52,6 +53,7 @@ public class EdmCollectionImplTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asCollection());
 
     assertEquals("Collection", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.Collection, dynExp.getExpressionType());
     assertSingleKindDynamicExpression(dynExp);
 
     EdmCollection asCollection = dynExp.asCollection();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmConstantExpressionImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmConstantExpressionImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmConstantExpressionImplTest.java
index e45c760..a77dc98 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmConstantExpressionImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmConstantExpressionImplTest.java
@@ -23,6 +23,7 @@ import static org.mockito.Mockito.mock;
 
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression.ConstantExpressionType;
 import org.apache.olingo.commons.core.edm.annotation.AbstractEdmExpression;
@@ -37,6 +38,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.Binary, exp.getExpressionType());
     assertEquals("Binary", exp.asConstant().getExpressionName());
     assertEquals("qrvM3e7_", exp.asConstant().getValueAsString());
   }
@@ -48,6 +50,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.Bool, exp.getExpressionType());
     assertEquals("Bool", exp.asConstant().getExpressionName());
     assertEquals("true", exp.asConstant().getValueAsString());
   }
@@ -59,6 +62,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.Date, exp.getExpressionType());
     assertEquals("Date", exp.asConstant().getExpressionName());
     assertEquals("2012-02-29", exp.asConstant().getValueAsString());
   }
@@ -71,6 +75,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.DateTimeOffset, exp.getExpressionType());
     assertEquals("DateTimeOffset", exp.asConstant().getExpressionName());
     assertEquals("2012-02-29T01:02:03Z", exp.asConstant().getValueAsString());
   }
@@ -83,6 +88,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.Decimal, exp.getExpressionType());
     assertEquals("Decimal", exp.asConstant().getExpressionName());
     assertEquals("-123456789012345678901234567890", exp.asConstant().getValueAsString());
   }
@@ -94,6 +100,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.Duration, exp.getExpressionType());
     assertEquals("Duration", exp.asConstant().getExpressionName());
     assertEquals("PT10S", exp.asConstant().getValueAsString());
   }
@@ -105,6 +112,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.EnumMember, exp.getExpressionType());
     assertEquals("EnumMember", exp.asConstant().getExpressionName());
     assertEquals("Enum/enumMember", exp.asConstant().getValueAsString());
   }
@@ -116,6 +124,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.Float, exp.getExpressionType());
     assertEquals("Float", exp.asConstant().getExpressionName());
     assertEquals("1.42", exp.asConstant().getValueAsString());
   }
@@ -128,6 +137,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.Guid, exp.getExpressionType());
     assertEquals("Guid", exp.asConstant().getExpressionName());
     assertEquals("aabbccdd-aabb-ccdd-eeff-aabbccddeeff", exp.asConstant().getValueAsString());
   }
@@ -139,6 +149,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.Int, exp.getExpressionType());
     assertEquals("Int", exp.asConstant().getExpressionName());
     assertEquals("42", exp.asConstant().getValueAsString());
   }
@@ -150,6 +161,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.String, exp.getExpressionType());
     assertEquals("String", exp.asConstant().getExpressionName());
     assertEquals("ABCD", exp.asConstant().getValueAsString());
   }
@@ -161,6 +173,7 @@ public class EdmConstantExpressionImplTest extends AbstractAnnotationTest {
 
     assertConstant(exp);
 
+    assertEquals(EdmExpressionType.TimeOfDay, exp.getExpressionType());
     assertEquals("TimeOfDay", exp.asConstant().getExpressionName());
     assertEquals("00:00:00.999", exp.asConstant().getValueAsString());
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIfImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIfImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIfImplTest.java
index fa41522..0fd94ba 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIfImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIfImplTest.java
@@ -33,6 +33,7 @@ import org.apache.olingo.commons.api.edm.EdmException;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmIf;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression.ConstantExpressionType;
@@ -55,6 +56,7 @@ public class EdmIfImplTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asIf());
 
     assertEquals("If", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.If, dynExp.getExpressionType());
     assertSingleKindDynamicExpression(dynExp);
 
     EdmIf asIf = dynExp.asIf();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIsOfImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIsOfImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIsOfImplTest.java
index cba3abf..256d590 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIsOfImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmIsOfImplTest.java
@@ -34,6 +34,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmIsOf;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression.ConstantExpressionType;
@@ -52,6 +53,7 @@ public class EdmIsOfImplTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asIsOf());
 
     assertEquals("IsOf", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.IsOf, dynExp.getExpressionType());
     assertSingleKindDynamicExpression(dynExp);
     try {
       dynExp.asIsOf().getValue();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabeledElementImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabeledElementImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabeledElementImplTest.java
index 3a5a6a0..f9a297e 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabeledElementImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabeledElementImplTest.java
@@ -32,6 +32,7 @@ import org.apache.olingo.commons.api.edm.EdmException;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmLabeledElement;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlLabeledElement;
@@ -50,6 +51,7 @@ public class EdmLabeledElementImplTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asLabeledElement());
 
     assertEquals("LabeledElement", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.LabeledElement, dynExp.getExpressionType());
     assertSingleKindDynamicExpression(dynExp);
 
     EdmLabeledElement asLabeled = dynExp.asLabeledElement();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabledElementReferenceImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabledElementReferenceImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabledElementReferenceImplTest.java
index 0fa2e64..c57af8d 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabledElementReferenceImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLabledElementReferenceImplTest.java
@@ -27,6 +27,7 @@ import static org.mockito.Mockito.mock;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlLabeledElementReference;
 import org.apache.olingo.commons.core.edm.annotation.AbstractEdmExpression;
 import org.junit.Test;
@@ -41,6 +42,7 @@ public class EdmLabledElementReferenceImplTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asLabeledElementReference());
 
     assertEquals("LabeledElementReference", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.LabeledElementReference, dynExp.getExpressionType());
     assertNull(dynExp.asLabeledElementReference().getValue());
     assertSingleKindDynamicExpression(dynExp);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLogicalOrComparisonImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLogicalOrComparisonImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLogicalOrComparisonImplTest.java
index e5a4cf9..e39f0e2 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLogicalOrComparisonImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmLogicalOrComparisonImplTest.java
@@ -29,6 +29,7 @@ import org.apache.olingo.commons.api.edm.EdmException;
 import org.apache.olingo.commons.api.edm.annotation.EdmConstantExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.annotation.EdmLogicalOrComparisonExpression;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression.ConstantExpressionType;
@@ -50,6 +51,7 @@ public class EdmLogicalOrComparisonImplTest extends AbstractAnnotationTest {
 
       EdmDynamicExpression dynExp = assertDynamic(path);
       assertEquals(type.toString(), dynExp.getExpressionName());
+      assertEquals(EdmExpressionType.valueOf(type.toString()), dynExp.getExpressionType());
       assertSingleKindDynamicExpression(dynExp);
 
       EdmLogicalOrComparisonExpression logicOrComparisonExp = (EdmLogicalOrComparisonExpression) dynExp;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmNavigationPropertyPathImpTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmNavigationPropertyPathImpTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmNavigationPropertyPathImpTest.java
index d4fe6f1..5927cd9 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmNavigationPropertyPathImpTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmNavigationPropertyPathImpTest.java
@@ -27,6 +27,7 @@ import static org.mockito.Mockito.mock;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlNavigationPropertyPath;
 import org.apache.olingo.commons.core.edm.annotation.AbstractEdmExpression;
 import org.junit.Test;
@@ -41,6 +42,7 @@ public class EdmNavigationPropertyPathImpTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asNavigationPropertyPath());
 
     assertEquals("NavigationPropertyPath", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.NavigationPropertyPath, dynExp.getExpressionType());
     assertNull(dynExp.asNavigationPropertyPath().getValue());
 
     assertSingleKindDynamicExpression(dynExp);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPathImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPathImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPathImplTest.java
index 5f32f07..df73c10 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPathImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPathImplTest.java
@@ -27,6 +27,7 @@ import static org.mockito.Mockito.mock;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPath;
 import org.apache.olingo.commons.core.edm.annotation.AbstractEdmExpression;
 import org.junit.Test;
@@ -41,6 +42,7 @@ public class EdmPathImplTest extends AbstractAnnotationTest{
     assertNotNull(dynExp.asPath());
 
     assertEquals("Path", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.Path, dynExp.getExpressionType());
     assertNull(dynExp.asPath().getValue());
 
     assertSingleKindDynamicExpression(dynExp);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyPathImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyPathImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyPathImplTest.java
index eb0228e..8deda28 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyPathImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyPathImplTest.java
@@ -27,6 +27,7 @@ import static org.mockito.Mockito.mock;
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPropertyPath;
 import org.apache.olingo.commons.core.edm.annotation.AbstractEdmExpression;
 import org.junit.Test;
@@ -42,6 +43,7 @@ public class EdmPropertyPathImplTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asPropertyPath());
 
     assertEquals("PropertyPath", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.PropertyPath, dynExp.getExpressionType());
     assertNull(dynExp.asPropertyPath().getValue());
 
     assertSingleKindDynamicExpression(dynExp);

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyValueImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyValueImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyValueImplTest.java
index 28d1740..f4fd0e3 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyValueImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmPropertyValueImplTest.java
@@ -29,29 +29,18 @@ import java.util.List;
 
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmException;
-import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
-import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmPropertyValue;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
-import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPropertyValue;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression.ConstantExpressionType;
-import org.apache.olingo.commons.core.edm.annotation.AbstractEdmExpression;
+import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPropertyValue;
+import org.apache.olingo.commons.core.edm.annotation.EdmPropertyValueImpl;
 import org.junit.Test;
 
 public class EdmPropertyValueImplTest extends AbstractAnnotationTest {
   @Test
   public void initialPropertyValue() {
-    EdmExpression exp = AbstractEdmExpression.getExpression(mock(Edm.class), new CsdlPropertyValue());
-
-    EdmDynamicExpression dynExp = assertDynamic(exp);
-    assertTrue(dynExp.isPropertyValue());
-    assertNotNull(dynExp.asPropertyValue());
-
-    assertEquals("PropertyValue", dynExp.getExpressionName());
-    assertSingleKindDynamicExpression(dynExp);
-
-    EdmPropertyValue asPropValue = dynExp.asPropertyValue();
+    EdmPropertyValue asPropValue = new EdmPropertyValueImpl(mock(Edm.class), new CsdlPropertyValue());
     try {
       asPropValue.getProperty();
       fail("EdmException expected");
@@ -78,14 +67,13 @@ public class EdmPropertyValueImplTest extends AbstractAnnotationTest {
     List<CsdlAnnotation> csdlAnnotations = new ArrayList<CsdlAnnotation>();
     csdlAnnotations.add(new CsdlAnnotation().setTerm("ns.term"));
     csdlPropertyValue.setAnnotations(csdlAnnotations);
-    EdmExpression exp = AbstractEdmExpression.getExpression(mock(Edm.class), csdlPropertyValue);
-    EdmPropertyValue asPropValue = exp.asDynamic().asPropertyValue();
+    EdmPropertyValue asPropValue = new EdmPropertyValueImpl(mock(Edm.class), csdlPropertyValue);
 
     assertNotNull(asPropValue.getProperty());
     assertEquals("property", asPropValue.getProperty());
     assertNotNull(asPropValue.getValue());
     assertTrue(asPropValue.getValue().isConstant());
-    
+
     assertNotNull(asPropValue.getAnnotations());
     assertEquals(1, asPropValue.getAnnotations().size());
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmRecordImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmRecordImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmRecordImplTest.java
index 2f3bc1b..bdaca51 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmRecordImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmRecordImplTest.java
@@ -38,6 +38,7 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmRecord;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
 import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlPropertyValue;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlRecord;
@@ -55,6 +56,7 @@ public class EdmRecordImplTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asRecord());
 
     assertEquals("Record", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.Record, dynExp.getExpressionType());
     assertNotNull(dynExp.asRecord().getPropertyValues());
     assertTrue(dynExp.asRecord().getPropertyValues().isEmpty());
 

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/d00e3881/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmUrlRefImplTest.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmUrlRefImplTest.java b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmUrlRefImplTest.java
index 1f6d703..f27847c 100644
--- a/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmUrlRefImplTest.java
+++ b/lib/commons-core/src/test/java/org/apache/olingo/commons/core/edm/annotations/EdmUrlRefImplTest.java
@@ -24,11 +24,16 @@ import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.mockito.Mockito.mock;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.olingo.commons.api.edm.Edm;
 import org.apache.olingo.commons.api.edm.EdmException;
 import org.apache.olingo.commons.api.edm.annotation.EdmDynamicExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmExpression;
 import org.apache.olingo.commons.api.edm.annotation.EdmUrlRef;
+import org.apache.olingo.commons.api.edm.annotation.EdmExpression.EdmExpressionType;
+import org.apache.olingo.commons.api.edm.provider.CsdlAnnotation;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression.ConstantExpressionType;
 import org.apache.olingo.commons.api.edm.provider.annotation.CsdlNull;
@@ -47,6 +52,7 @@ public class EdmUrlRefImplTest extends AbstractAnnotationTest {
     assertNotNull(dynExp.asUrlRef());
 
     assertEquals("UrlRef", dynExp.getExpressionName());
+    assertEquals(EdmExpressionType.UrlRef, dynExp.getExpressionType());
     assertSingleKindDynamicExpression(dynExp);
 
     EdmUrlRef asUrlRef = dynExp.asUrlRef();
@@ -56,16 +62,25 @@ public class EdmUrlRefImplTest extends AbstractAnnotationTest {
     } catch (EdmException e) {
       assertEquals("URLRef expressions require an expression value.", e.getMessage());
     }
+
+    assertNotNull(asUrlRef.getAnnotations());
+    assertTrue(asUrlRef.getAnnotations().isEmpty());
   }
 
   @Test
   public void urlRefWithValue() {
     CsdlUrlRef csdlUrlRef = new CsdlUrlRef();
     csdlUrlRef.setValue(new CsdlConstantExpression(ConstantExpressionType.String));
+    List<CsdlAnnotation> csdlAnnotations = new ArrayList<CsdlAnnotation>();
+    csdlAnnotations.add(new CsdlAnnotation().setTerm("ns.term"));
+    csdlUrlRef.setAnnotations(csdlAnnotations);
     EdmExpression exp = AbstractEdmExpression.getExpression(mock(Edm.class), csdlUrlRef);
     EdmUrlRef asUrlRef = exp.asDynamic().asUrlRef();
     assertNotNull(asUrlRef.getValue());
     assertTrue(asUrlRef.getValue().isConstant());
+
+    assertNotNull(asUrlRef.getAnnotations());
+    assertEquals(1, asUrlRef.getAnnotations().size());
   }
 
   @Test


Mime
View raw message