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

[36/51] [partial] [OLINGO-146] Java Client Lib contributed under SGA from Microsoft Open Technologies, Inc. The majority of this was written by Francesco Chicchiriccò

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Schema.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Schema.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Schema.java
new file mode 100644
index 0000000..d7807e7
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Schema.java
@@ -0,0 +1,172 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4;
+
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractSchema;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class Schema extends AbstractSchema<EntityContainer, EntityType, ComplexType, FunctionImport>
+        implements AnnotatedEdm {
+
+    private static final long serialVersionUID = 4453992249818796144L;
+
+    private final List<Action> actions = new ArrayList<Action>();
+
+    private final List<Annotations> annotationsList = new ArrayList<Annotations>();
+
+    private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+    private final List<ComplexType> complexTypes = new ArrayList<ComplexType>();
+
+    private EntityContainer entityContainer;
+
+    private final List<EnumType> enumTypes = new ArrayList<EnumType>();
+
+    private final List<EntityType> entityTypes = new ArrayList<EntityType>();
+
+    private final List<Function> functions = new ArrayList<Function>();
+
+    private final List<Term> terms = new ArrayList<Term>();
+
+    private final List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>();
+
+    private Annotation annotation;
+
+    public List<Action> getActions() {
+        return actions;
+    }
+
+    public List<Action> getActions(final String name) {
+        final List<Action> result = new ArrayList<Action>();
+        for (Action action : getActions()) {
+            if (name.equals(action.getName())) {
+                result.add(action);
+            }
+        }
+        return result;
+    }
+
+    @Override
+    public List<Annotations> getAnnotationsList() {
+        return annotationsList;
+    }
+
+    @Override
+    public Annotations getAnnotationsList(final String target) {
+        Annotations result = null;
+        for (Annotations annots : getAnnotationsList()) {
+            if (target.equals(annots.getTarget())) {
+                result = annots;
+            }
+        }
+        return result;
+    }
+
+    public List<Annotation> getAnnotations() {
+        return annotations;
+    }
+
+    @Override
+    public List<EnumType> getEnumTypes() {
+        return enumTypes;
+    }
+
+    @Override
+    public EnumType getEnumType(final String name) {
+        EnumType result = null;
+        for (EnumType type : getEnumTypes()) {
+            if (name.equals(type.getName())) {
+                result = type;
+            }
+        }
+        return result;
+    }
+
+    public List<Function> getFunctions() {
+        return functions;
+    }
+
+    public List<Function> getFunctions(final String name) {
+        final List<Function> result = new ArrayList<Function>();
+        for (Function function : getFunctions()) {
+            if (name.equals(function.getName())) {
+                result.add(function);
+            }
+        }
+        return result;
+    }
+
+    public List<Term> getTerms() {
+        return terms;
+    }
+
+    public List<TypeDefinition> getTypeDefinitions() {
+        return typeDefinitions;
+    }
+
+    public EntityContainer getEntityContainer() {
+        return entityContainer;
+    }
+
+    public void setEntityContainer(final EntityContainer entityContainer) {
+        this.entityContainer = entityContainer;
+    }
+
+    @Override
+    public List<EntityContainer> getEntityContainers() {
+        return entityContainer == null
+                ? Collections.<EntityContainer>emptyList() : Collections.singletonList(entityContainer);
+    }
+
+    @Override
+    public EntityContainer getDefaultEntityContainer() {
+        return entityContainer;
+    }
+
+    @Override
+    public EntityContainer getEntityContainer(final String name) {
+        if (entityContainer != null && name.equals(entityContainer.getName())) {
+            return entityContainer;
+        }
+        throw new IllegalArgumentException("No EntityContainer found with name " + name);
+    }
+
+    @Override
+    public List<EntityType> getEntityTypes() {
+        return entityTypes;
+    }
+
+    @Override
+    public List<ComplexType> getComplexTypes() {
+        return complexTypes;
+    }
+
+    @Override
+    public Annotation getAnnotation() {
+        return annotation;
+    }
+
+    @Override
+    public void setAnnotation(final Annotation annotation) {
+        this.annotation = annotation;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Singleton.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Singleton.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Singleton.java
new file mode 100644
index 0000000..6af864b
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Singleton.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonDeserialize(using = SingletonDeserializer.class)
+public class Singleton extends AbstractAnnotatedEdm {
+
+    private static final long serialVersionUID = 941802518279658559L;
+
+    private String name;
+
+    private String type;
+
+    private final List<NavigationPropertyBinding> navigationPropertyBindings =
+            new ArrayList<NavigationPropertyBinding>();
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(final String type) {
+        this.type = type;
+    }
+
+    public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
+        return navigationPropertyBindings;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/SingletonDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/SingletonDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/SingletonDeserializer.java
new file mode 100644
index 0000000..504f62f
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/SingletonDeserializer.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4;
+
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import java.io.IOException;
+
+public class SingletonDeserializer extends AbstractEdmDeserializer<Singleton> {
+
+    @Override
+    protected Singleton doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        final Singleton singleton = new Singleton();
+
+        for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+            final JsonToken token = jp.getCurrentToken();
+            if (token == JsonToken.FIELD_NAME) {
+                if ("Name".equals(jp.getCurrentName())) {
+                    singleton.setName(jp.nextTextValue());
+                } else if ("Type".equals(jp.getCurrentName())) {
+                    singleton.setType(jp.nextTextValue());
+                } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
+                    jp.nextToken();
+                    singleton.getNavigationPropertyBindings().add(
+                            jp.getCodec().readValue(jp, NavigationPropertyBinding.class));
+                } else if ("Annotation".equals(jp.getCurrentName())) {
+                    jp.nextToken();
+                    singleton.setAnnotation(jp.getCodec().readValue(jp, Annotation.class));
+                }
+            }
+        }
+
+        return singleton;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Term.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Term.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Term.java
new file mode 100644
index 0000000..f24b54b
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/Term.java
@@ -0,0 +1,128 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonDeserialize(using = TermDeserializer.class)
+public class Term extends AbstractAnnotatedEdm {
+
+    private static final long serialVersionUID = -5888231162358116515L;
+
+    private String name;
+
+    private String type;
+
+    private String baseTerm;
+
+    private String defaultValue;
+
+    private boolean nullable = true;
+
+    private String maxLength;
+
+    private BigInteger precision;
+
+    private BigInteger scale;
+
+    private String srid;
+
+    private final List<CSDLElement> appliesTo = new ArrayList<CSDLElement>();
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(final String type) {
+        this.type = type;
+    }
+
+    public String getBaseTerm() {
+        return baseTerm;
+    }
+
+    public void setBaseTerm(final String baseTerm) {
+        this.baseTerm = baseTerm;
+    }
+
+    public String getDefaultValue() {
+        return defaultValue;
+    }
+
+    public void setDefaultValue(final String defaultValue) {
+        this.defaultValue = defaultValue;
+    }
+
+    public boolean isNullable() {
+        return nullable;
+    }
+
+    public void setNullable(final boolean nullable) {
+        this.nullable = nullable;
+    }
+
+    public String getMaxLength() {
+        return maxLength;
+    }
+
+    public void setMaxLength(final String maxLength) {
+        this.maxLength = maxLength;
+    }
+
+    public BigInteger getPrecision() {
+        return precision;
+    }
+
+    public void setPrecision(final BigInteger precision) {
+        this.precision = precision;
+    }
+
+    public BigInteger getScale() {
+        return scale;
+    }
+
+    public void setScale(final BigInteger scale) {
+        this.scale = scale;
+    }
+
+    public String getSrid() {
+        return srid;
+    }
+
+    public void setSrid(final String srid) {
+        this.srid = srid;
+    }
+
+    public List<CSDLElement> getAppliesTo() {
+        return appliesTo;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TermDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TermDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TermDeserializer.java
new file mode 100644
index 0000000..77d6ce4
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TermDeserializer.java
@@ -0,0 +1,75 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4;
+
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import java.io.IOException;
+import java.math.BigInteger;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
+
+public class TermDeserializer extends AbstractEdmDeserializer<Term> {
+
+    @Override
+    protected Term doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        final Term term = new Term();
+
+        for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+            final JsonToken token = jp.getCurrentToken();
+            if (token == JsonToken.FIELD_NAME) {
+                if ("Name".equals(jp.getCurrentName())) {
+                    term.setName(jp.nextTextValue());
+                } else if ("Type".equals(jp.getCurrentName())) {
+                    term.setType(jp.nextTextValue());
+                } else if ("BaseTerm".equals(jp.getCurrentName())) {
+                    term.setBaseTerm(jp.nextTextValue());
+                } else if ("DefaultValue".equals(jp.getCurrentName())) {
+                    term.setDefaultValue(jp.nextTextValue());
+                } else if ("Nullable".equals(jp.getCurrentName())) {
+                    term.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+                } else if ("MaxLength".equals(jp.getCurrentName())) {
+                    term.setMaxLength(jp.nextTextValue());
+                } else if ("Precision".equals(jp.getCurrentName())) {
+                    term.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L)));
+                } else if ("Scale".equals(jp.getCurrentName())) {
+                    term.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
+                } else if ("SRID".equals(jp.getCurrentName())) {
+                    term.setSrid(jp.nextTextValue());
+                } else if ("AppliesTo".equals(jp.getCurrentName())) {
+                    for (String split : StringUtils.split(jp.nextTextValue())) {
+                        term.getAppliesTo().add(CSDLElement.valueOf(split));
+                    }
+                } else if ("Annotation".equals(jp.getCurrentName())) {
+                    jp.nextToken();
+                    term.setAnnotation(jp.getCodec().readValue(jp, Annotation.class));
+                }
+            }
+        }
+
+        return term;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TypeDefinition.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TypeDefinition.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TypeDefinition.java
new file mode 100644
index 0000000..4ae2654
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TypeDefinition.java
@@ -0,0 +1,107 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4;
+
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdm;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+public class TypeDefinition extends AbstractEdm {
+
+    private static final long serialVersionUID = -5888231162358116515L;
+
+    private String name;
+
+    private String underlyingType;
+
+    private String maxLength;
+
+    private BigInteger precision;
+
+    private BigInteger scale;
+
+    private boolean unicode = true;
+
+    private String srid;
+
+    private final List<Annotation> annotations = new ArrayList<Annotation>();
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    public String getUnderlyingType() {
+        return underlyingType;
+    }
+
+    public void setUnderlyingType(final String underlyingType) {
+        this.underlyingType = underlyingType;
+    }
+
+    public String getMaxLength() {
+        return maxLength;
+    }
+
+    public void setMaxLength(final String maxLength) {
+        this.maxLength = maxLength;
+    }
+
+    public BigInteger getPrecision() {
+        return precision;
+    }
+
+    public void setPrecision(final BigInteger precision) {
+        this.precision = precision;
+    }
+
+    public BigInteger getScale() {
+        return scale;
+    }
+
+    public void setScale(final BigInteger scale) {
+        this.scale = scale;
+    }
+
+    public boolean isUnicode() {
+        return unicode;
+    }
+
+    public void setUnicode(final boolean unicode) {
+        this.unicode = unicode;
+    }
+
+    public String getSrid() {
+        return srid;
+    }
+
+    public void setSrid(final String srid) {
+        this.srid = srid;
+    }
+
+    public List<Annotation> getAnnotations() {
+        return annotations;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TypeDefinitionDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TypeDefinitionDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TypeDefinitionDeserializer.java
new file mode 100644
index 0000000..e7f0c40
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/TypeDefinitionDeserializer.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import java.io.IOException;
+import java.math.BigInteger;
+import org.apache.commons.lang3.BooleanUtils;
+
+public class TypeDefinitionDeserializer extends AbstractEdmDeserializer<TypeDefinition> {
+
+    @Override
+    protected TypeDefinition doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        final TypeDefinition typeDefinition = new TypeDefinition();
+
+        for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+            final JsonToken token = jp.getCurrentToken();
+            if (token == JsonToken.FIELD_NAME) {
+                if ("Name".equals(jp.getCurrentName())) {
+                    typeDefinition.setName(jp.nextTextValue());
+                } else if ("UnderlyingType".equals(jp.getCurrentName())) {
+                    typeDefinition.setUnderlyingType(jp.nextTextValue());
+                } else if ("MaxLength".equals(jp.getCurrentName())) {
+                    typeDefinition.setMaxLength(jp.nextTextValue());
+                } else if ("Unicode".equals(jp.getCurrentName())) {
+                    typeDefinition.setUnicode(BooleanUtils.toBoolean(jp.nextTextValue()));
+                } else if ("Precision".equals(jp.getCurrentName())) {
+                    typeDefinition.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L)));
+                } else if ("Scale".equals(jp.getCurrentName())) {
+                    typeDefinition.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
+                } else if ("SRID".equals(jp.getCurrentName())) {
+                    typeDefinition.setSrid(jp.nextTextValue());
+                } else if ("Annotation".equals(jp.getCurrentName())) {
+                    jp.nextToken();
+                    typeDefinition.getAnnotations().add(jp.getCodec().readValue(jp, Annotation.class));
+                }
+            }
+        }
+
+        return typeDefinition;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AbstractElOrAttrConstruct.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AbstractElOrAttrConstruct.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AbstractElOrAttrConstruct.java
new file mode 100644
index 0000000..51ef33e
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AbstractElOrAttrConstruct.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+/**
+ * Groups dynamic expressions that may be provided using element notation or attribute notation.
+ */
+abstract class AbstractElOrAttrConstruct extends DynExprConstruct {
+
+    private static final long serialVersionUID = 5503275111425750339L;
+
+    private String value;
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(final String value) {
+        this.value = value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AnnotatedDynExprConstruct.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AnnotatedDynExprConstruct.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AnnotatedDynExprConstruct.java
new file mode 100644
index 0000000..b0f694a
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AnnotatedDynExprConstruct.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.msopentech.odatajclient.engine.metadata.edm.v4.AnnotatedEdm;
+import com.msopentech.odatajclient.engine.metadata.edm.v4.Annotation;
+
+public abstract class AnnotatedDynExprConstruct extends DynExprConstruct implements AnnotatedEdm {
+
+    private static final long serialVersionUID = -8117155475397749038L;
+
+    private Annotation annotation;
+
+    @Override
+    public Annotation getAnnotation() {
+        return annotation;
+    }
+
+    @Override
+    public void setAnnotation(final Annotation annotation) {
+        this.annotation = annotation;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AnnotationPath.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AnnotationPath.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AnnotationPath.java
new file mode 100644
index 0000000..7e3f9cc
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/AnnotationPath.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+public class AnnotationPath extends AbstractElOrAttrConstruct {
+
+    private static final long serialVersionUID = 6198019768659098819L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Apply.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Apply.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Apply.java
new file mode 100644
index 0000000..91734f1
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Apply.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonDeserialize(using = ApplyDeserializer.class)
+public class Apply extends AnnotatedDynExprConstruct {
+
+    private static final long serialVersionUID = 6198019768659098819L;
+
+    public static final String CANONICAL_FUNCTION_CONCAT = "odata.concat";
+
+    public static final String CANONICAL_FUNCTION_FILLURITEMPLATE = "odata.fillUriTemplate";
+
+    public static final String CANONICAL_FUNCTION_URIENCODE = "odata.uriEncode";
+
+    private String function;
+
+    private final List<ExprConstruct> parameters = new ArrayList<ExprConstruct>();
+
+    public String getFunction() {
+        return function;
+    }
+
+    public void setFunction(final String function) {
+        this.function = function;
+    }
+
+    public List<ExprConstruct> getParameters() {
+        return parameters;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ApplyDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ApplyDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ApplyDeserializer.java
new file mode 100644
index 0000000..eddf267
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ApplyDeserializer.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.msopentech.odatajclient.engine.metadata.edm.v4.Annotation;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import java.io.IOException;
+
+public class ApplyDeserializer extends AbstractEdmDeserializer<Apply> {
+
+    @Override
+    protected Apply doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        final Apply apply = new Apply();
+
+        for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+            final JsonToken token = jp.getCurrentToken();
+            if (token == JsonToken.FIELD_NAME) {
+                if ("Function".equals(jp.getCurrentName())) {
+                    apply.setFunction(jp.nextTextValue());
+                } else if ("Annotation".equals(jp.getCurrentName())) {
+                    apply.setAnnotation(jp.getCodec().readValue(jp, Annotation.class));
+                } else if (isAnnotationConstExprConstruct(jp)) {
+                    apply.getParameters().add(parseAnnotationConstExprConstruct(jp));
+                } else {
+                    apply.getParameters().add(jp.getCodec().readValue(jp, DynExprConstruct.class));
+                }
+            }
+        }
+
+        return apply;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Cast.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Cast.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Cast.java
new file mode 100644
index 0000000..05a0b59
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Cast.java
@@ -0,0 +1,90 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.math.BigInteger;
+
+@JsonDeserialize(using = CastDeserializer.class)
+public class Cast extends AnnotatedDynExprConstruct {
+
+    private static final long serialVersionUID = -7836626668653004926L;
+
+    private String type;
+
+    private String maxLength;
+
+    private BigInteger precision;
+
+    private BigInteger scale;
+
+    private String srid;
+
+    private DynExprConstruct value;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(final String type) {
+        this.type = type;
+    }
+
+    public String getMaxLength() {
+        return maxLength;
+    }
+
+    public void setMaxLength(final String maxLength) {
+        this.maxLength = maxLength;
+    }
+
+    public BigInteger getPrecision() {
+        return precision;
+    }
+
+    public void setPrecision(final BigInteger precision) {
+        this.precision = precision;
+    }
+
+    public BigInteger getScale() {
+        return scale;
+    }
+
+    public void setScale(final BigInteger scale) {
+        this.scale = scale;
+    }
+
+    public String getSrid() {
+        return srid;
+    }
+
+    public void setSrid(final String srid) {
+        this.srid = srid;
+    }
+
+    public DynExprConstruct getValue() {
+        return value;
+    }
+
+    public void setValue(final DynExprConstruct value) {
+        this.value = value;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/CastDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/CastDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/CastDeserializer.java
new file mode 100644
index 0000000..cb24721
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/CastDeserializer.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.msopentech.odatajclient.engine.metadata.edm.v4.Annotation;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import java.io.IOException;
+import java.math.BigInteger;
+
+public class CastDeserializer extends AbstractEdmDeserializer<Cast> {
+
+    @Override
+    protected Cast doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        final Cast cast = new Cast();
+
+        for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+            final JsonToken token = jp.getCurrentToken();
+            if (token == JsonToken.FIELD_NAME) {
+                if ("Type".equals(jp.getCurrentName())) {
+                    cast.setType(jp.nextTextValue());
+                } else if ("Annotation".equals(jp.getCurrentName())) {
+                    cast.setAnnotation(jp.getCodec().readValue(jp, Annotation.class));
+                } else if ("MaxLength".equals(jp.getCurrentName())) {
+                    cast.setMaxLength(jp.nextTextValue());
+                } else if ("Precision".equals(jp.getCurrentName())) {
+                    cast.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L)));
+                } else if ("Scale".equals(jp.getCurrentName())) {
+                    cast.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
+                } else if ("SRID".equals(jp.getCurrentName())) {
+                    cast.setSrid(jp.nextTextValue());
+                } else {
+                    cast.setValue(jp.getCodec().readValue(jp, DynExprConstruct.class));
+                }
+            }
+        }
+
+        return cast;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Collection.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Collection.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Collection.java
new file mode 100644
index 0000000..73c2f74
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Collection.java
@@ -0,0 +1,37 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonDeserialize(using = CollectionDeserializer.class)
+public class Collection extends DynExprConstruct {
+
+    private static final long serialVersionUID = -4975881520695477686L;
+
+    private final List<ExprConstruct> items = new ArrayList<ExprConstruct>();
+
+    public List<ExprConstruct> getItems() {
+        return items;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/CollectionDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/CollectionDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/CollectionDeserializer.java
new file mode 100644
index 0000000..4948c5c
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/CollectionDeserializer.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import java.io.IOException;
+
+public class CollectionDeserializer extends AbstractEdmDeserializer<Collection> {
+
+    @Override
+    protected Collection doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        final Collection collection = new Collection();
+
+        for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+            final JsonToken token = jp.getCurrentToken();
+            if (token == JsonToken.FIELD_NAME) {
+                if (isAnnotationConstExprConstruct(jp)) {
+                    collection.getItems().add(parseAnnotationConstExprConstruct(jp));
+                } else {
+                    collection.getItems().add(jp.getCodec().readValue(jp, DynExprConstruct.class));
+                }
+            }
+        }
+
+        return collection;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ConstExprConstruct.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ConstExprConstruct.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ConstExprConstruct.java
new file mode 100644
index 0000000..4cda320
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ConstExprConstruct.java
@@ -0,0 +1,72 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+public class ConstExprConstruct extends ExprConstruct {
+
+    private static final long serialVersionUID = 2250072064504668969L;
+
+    public enum Type {
+
+        Binary,
+        Bool,
+        Date,
+        DateTimeOffset,
+        Decimal,
+        Duration,
+        EnumMember,
+        Float,
+        Guid,
+        Int,
+        String,
+        TimeOfDay;
+
+        public static Type fromString(final String value) {
+            Type result = null;
+            try {
+                result = valueOf(value);
+            } catch (IllegalArgumentException e) {
+                // ignore
+            }
+            return result;
+        }
+    }
+
+    private Type type;
+
+    private String value;
+
+    public Type getType() {
+        return type;
+    }
+
+    public void setType(final Type type) {
+        this.type = type;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(final String value) {
+        this.value = value;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprConstruct.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprConstruct.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprConstruct.java
new file mode 100644
index 0000000..d889e2b
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprConstruct.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = DynExprConstructDeserializer.class)
+public abstract class DynExprConstruct extends ExprConstruct {
+
+    private static final long serialVersionUID = -642012862023177349L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprConstructDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprConstructDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprConstructDeserializer.java
new file mode 100644
index 0000000..bf5eec0
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprConstructDeserializer.java
@@ -0,0 +1,146 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.fasterxml.jackson.core.JsonLocation;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import java.io.IOException;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.ClassUtils;
+
+public class DynExprConstructDeserializer extends AbstractEdmDeserializer<DynExprConstruct> {
+
+    private static final String[] EL_OR_ATTR = { AnnotationPath.class.getSimpleName(), Path.class.getSimpleName() };
+
+    private static final String APPLY = Apply.class.getSimpleName();
+
+    private static final String CAST = Cast.class.getSimpleName();
+
+    private static final String COLLECTION = Collection.class.getSimpleName();
+
+    private static final String IF = If.class.getSimpleName();
+
+    private static final String IS_OF = IsOf.class.getSimpleName();
+
+    private static final String LABELED_ELEMENT = LabeledElement.class.getSimpleName();
+
+    private static final String NULL = Null.class.getSimpleName();
+
+    private static final String RECORD = Record.class.getSimpleName();
+
+    private static final String URL_REF = UrlRef.class.getSimpleName();
+
+    private AbstractElOrAttrConstruct getElOrAttrInstance(final String simpleClassName) throws JsonParseException {
+        try {
+            @SuppressWarnings("unchecked")
+            Class<? extends AbstractElOrAttrConstruct> elOrAttrClass =
+                    (Class<? extends AbstractElOrAttrConstruct>) ClassUtils.getClass(
+                            getClass().getPackage().getName() + "." + simpleClassName);
+            return elOrAttrClass.newInstance();
+        } catch (Exception e) {
+            throw new JsonParseException("Could not instantiate " + simpleClassName, JsonLocation.NA, e);
+        }
+    }
+
+    private ExprConstruct parseConstOrEnumExprConstruct(final JsonParser jp) throws IOException {
+        ExprConstruct result;
+        if (isAnnotationConstExprConstruct(jp)) {
+            result = parseAnnotationConstExprConstruct(jp);
+        } else {
+            result = jp.getCodec().readValue(jp, DynExprConstruct.class);
+        }
+        jp.nextToken();
+
+        return result;
+    }
+
+    @Override
+    protected DynExprConstruct doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        DynExprConstruct construct = null;
+
+        if (DynExprSingleParamOp.Type.fromString(jp.getCurrentName()) != null) {
+            final DynExprSingleParamOp dynExprSingleParamOp = new DynExprSingleParamOp();
+            dynExprSingleParamOp.setType(DynExprSingleParamOp.Type.fromString(jp.getCurrentName()));
+
+            jp.nextToken();
+            jp.nextToken();
+            dynExprSingleParamOp.setExpression(jp.getCodec().readValue(jp, DynExprConstruct.class));
+
+            construct = dynExprSingleParamOp;
+        } else if (DynExprDoubleParamOp.Type.fromString(jp.getCurrentName()) != null) {
+            final DynExprDoubleParamOp dynExprDoubleParamOp = new DynExprDoubleParamOp();
+            dynExprDoubleParamOp.setType(DynExprDoubleParamOp.Type.fromString(jp.getCurrentName()));
+
+            jp.nextToken();
+            jp.nextToken();
+            dynExprDoubleParamOp.setLeft(jp.getCodec().readValue(jp, DynExprConstruct.class));
+            dynExprDoubleParamOp.setRight(jp.getCodec().readValue(jp, DynExprConstruct.class));
+
+            construct = dynExprDoubleParamOp;
+        } else if (ArrayUtils.contains(EL_OR_ATTR, jp.getCurrentName())) {
+            final AbstractElOrAttrConstruct elOrAttr = getElOrAttrInstance(jp.getCurrentName());
+            elOrAttr.setValue(jp.nextTextValue());
+
+            construct = elOrAttr;
+        } else if (APPLY.equals(jp.getCurrentName())) {
+            jp.nextToken();
+            construct = jp.getCodec().readValue(jp, Apply.class);
+        } else if (CAST.equals(jp.getCurrentName())) {
+            jp.nextToken();
+            construct = jp.getCodec().readValue(jp, Cast.class);
+        } else if (COLLECTION.equals(jp.getCurrentName())) {
+            jp.nextToken();
+            construct = jp.getCodec().readValue(jp, Collection.class);
+        } else if (IF.equals(jp.getCurrentName())) {
+            jp.nextToken();
+            jp.nextToken();
+
+            final If _if = new If();
+            _if.setGuard(parseConstOrEnumExprConstruct(jp));
+            _if.setThen(parseConstOrEnumExprConstruct(jp));
+            _if.setElse(parseConstOrEnumExprConstruct(jp));
+
+            construct = _if;
+        } else if (IS_OF.equals(jp.getCurrentName())) {
+            jp.nextToken();
+            construct = jp.getCodec().readValue(jp, IsOf.class);
+        } else if (LABELED_ELEMENT.equals(jp.getCurrentName())) {
+            jp.nextToken();
+            construct = jp.getCodec().readValue(jp, LabeledElement.class);
+        } else if (NULL.equals(jp.getCurrentName())) {
+            jp.nextToken();
+            construct = jp.getCodec().readValue(jp, Null.class);
+        } else if (RECORD.equals(jp.getCurrentName())) {
+            jp.nextToken();
+            construct = jp.getCodec().readValue(jp, Record.class);
+        } else if (URL_REF.equals(jp.getCurrentName())) {
+            jp.nextToken();
+            construct = jp.getCodec().readValue(jp, UrlRef.class);
+        }
+
+        return construct;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprDoubleParamOp.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprDoubleParamOp.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprDoubleParamOp.java
new file mode 100644
index 0000000..0feba10
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprDoubleParamOp.java
@@ -0,0 +1,72 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+public class DynExprDoubleParamOp extends DynExprConstruct {
+
+    private static final long serialVersionUID = -7974475975925167731L;
+
+    public static enum Type {
+
+        And,
+        Or;
+
+        public static Type fromString(final String value) {
+            Type result = null;
+            for (Type type : values()) {
+                if (value.equals(type.name())) {
+                    result = type;
+                }
+            }
+            return result;
+        }
+    }
+
+    private Type type;
+
+    private DynExprConstruct left;
+
+    private DynExprConstruct right;
+
+    public Type getType() {
+        return type;
+    }
+
+    public void setType(final Type type) {
+        this.type = type;
+    }
+
+    public DynExprConstruct getLeft() {
+        return left;
+    }
+
+    public void setLeft(final DynExprConstruct left) {
+        this.left = left;
+    }
+
+    public DynExprConstruct getRight() {
+        return right;
+    }
+
+    public void setRight(final DynExprConstruct right) {
+        this.right = right;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprSingleParamOp.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprSingleParamOp.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprSingleParamOp.java
new file mode 100644
index 0000000..03e8494
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/DynExprSingleParamOp.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+public class DynExprSingleParamOp extends DynExprConstruct {
+
+    private static final long serialVersionUID = -7974475975925167731L;
+
+    public static enum Type {
+
+        Not,
+        Eq,
+        Ne,
+        Gt,
+        Ge,
+        Lt,
+        Le;
+
+        public static Type fromString(final String value) {
+            Type result = null;
+            for (Type type : values()) {
+                if (value.equals(type.name())) {
+                    result = type;
+                }
+            }
+            return result;
+        }
+
+    }
+
+    private Type type;
+
+    private DynExprConstruct expression;
+
+    public Type getType() {
+        return type;
+    }
+
+    public void setType(final Type type) {
+        this.type = type;
+    }
+
+    public DynExprConstruct getExpression() {
+        return expression;
+    }
+
+    public void setExpression(final DynExprConstruct expression) {
+        this.expression = expression;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ExprConstruct.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ExprConstruct.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ExprConstruct.java
new file mode 100644
index 0000000..ccdd321
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/ExprConstruct.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdm;
+
+public abstract class ExprConstruct extends AbstractEdm {
+
+    private static final long serialVersionUID = 7108626008005050492L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/If.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/If.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/If.java
new file mode 100644
index 0000000..39446d0
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/If.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+public class If extends AnnotatedDynExprConstruct {
+
+    private static final long serialVersionUID = 6752952406406218936L;
+
+    private ExprConstruct guard;
+
+    private ExprConstruct _then;
+
+    private ExprConstruct _else;
+
+    public ExprConstruct getGuard() {
+        return guard;
+    }
+
+    public void setGuard(final ExprConstruct guard) {
+        this.guard = guard;
+    }
+
+    public ExprConstruct getThen() {
+        return _then;
+    }
+
+    public void setThen(final ExprConstruct _then) {
+        this._then = _then;
+    }
+
+    public ExprConstruct getElse() {
+        return _else;
+    }
+
+    public void setElse(final ExprConstruct _else) {
+        this._else = _else;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/IsOf.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/IsOf.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/IsOf.java
new file mode 100644
index 0000000..cfaadda
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/IsOf.java
@@ -0,0 +1,90 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.math.BigInteger;
+
+@JsonDeserialize(using = IsOfDeserializer.class)
+public class IsOf extends AnnotatedDynExprConstruct {
+
+    private static final long serialVersionUID = 6958304670385303776L;
+
+    private String type;
+
+    private String maxLength;
+
+    private BigInteger precision;
+
+    private BigInteger scale;
+
+    private String srid;
+
+    private DynExprConstruct value;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(final String type) {
+        this.type = type;
+    }
+
+    public String getMaxLength() {
+        return maxLength;
+    }
+
+    public void setMaxLength(final String maxLength) {
+        this.maxLength = maxLength;
+    }
+
+    public BigInteger getPrecision() {
+        return precision;
+    }
+
+    public void setPrecision(final BigInteger precision) {
+        this.precision = precision;
+    }
+
+    public BigInteger getScale() {
+        return scale;
+    }
+
+    public void setScale(final BigInteger scale) {
+        this.scale = scale;
+    }
+
+    public String getSrid() {
+        return srid;
+    }
+
+    public void setSrid(final String srid) {
+        this.srid = srid;
+    }
+
+    public DynExprConstruct getValue() {
+        return value;
+    }
+
+    public void setValue(final DynExprConstruct value) {
+        this.value = value;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/IsOfDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/IsOfDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/IsOfDeserializer.java
new file mode 100644
index 0000000..7440de2
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/IsOfDeserializer.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.msopentech.odatajclient.engine.metadata.edm.v4.Annotation;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import java.io.IOException;
+import java.math.BigInteger;
+
+public class IsOfDeserializer extends AbstractEdmDeserializer<IsOf> {
+
+    @Override
+    protected IsOf doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        final IsOf isof = new IsOf();
+
+        for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+            final JsonToken token = jp.getCurrentToken();
+            if (token == JsonToken.FIELD_NAME) {
+                if ("Type".equals(jp.getCurrentName())) {
+                    isof.setType(jp.nextTextValue());
+                } else if ("Annotation".equals(jp.getCurrentName())) {
+                    isof.setAnnotation(jp.getCodec().readValue(jp, Annotation.class));
+                } else if ("MaxLength".equals(jp.getCurrentName())) {
+                    isof.setMaxLength(jp.nextTextValue());
+                } else if ("Precision".equals(jp.getCurrentName())) {
+                    isof.setPrecision(BigInteger.valueOf(jp.nextLongValue(0L)));
+                } else if ("Scale".equals(jp.getCurrentName())) {
+                    isof.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
+                } else if ("SRID".equals(jp.getCurrentName())) {
+                    isof.setSrid(jp.nextTextValue());
+                } else {
+                    isof.setValue(jp.getCodec().readValue(jp, DynExprConstruct.class));
+                }
+            }
+        }
+
+        return isof;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElement.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElement.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElement.java
new file mode 100644
index 0000000..86fa63d
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElement.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = LabeledElementDeserializer.class)
+public class LabeledElement extends AnnotatedDynExprConstruct {
+
+    private static final long serialVersionUID = 6938971787086282939L;
+
+    private String name;
+
+    private DynExprConstruct value;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    public DynExprConstruct getValue() {
+        return value;
+    }
+
+    public void setValue(final DynExprConstruct value) {
+        this.value = value;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElementDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElementDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElementDeserializer.java
new file mode 100644
index 0000000..8984af7
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElementDeserializer.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.msopentech.odatajclient.engine.metadata.edm.v4.Annotation;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import java.io.IOException;
+
+public class LabeledElementDeserializer extends AbstractEdmDeserializer<LabeledElement> {
+
+    @Override
+    protected LabeledElement doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        final LabeledElement element = new LabeledElement();
+
+        for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+            final JsonToken token = jp.getCurrentToken();
+            if (token == JsonToken.FIELD_NAME) {
+                if ("Name".equals(jp.getCurrentName())) {
+                    element.setName(jp.nextTextValue());
+                } else if ("Annotation".equals(jp.getCurrentName())) {
+                    element.setAnnotation(jp.getCodec().readValue(jp, Annotation.class));
+                } else {
+                    element.setValue(jp.getCodec().readValue(jp, DynExprConstruct.class));
+                }
+            }
+        }
+
+        return element;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElementReference.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElementReference.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElementReference.java
new file mode 100644
index 0000000..e42522d
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/LabeledElementReference.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+public class LabeledElementReference extends AbstractElOrAttrConstruct {
+
+    private static final long serialVersionUID = 3649068436729494270L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/NavigationPropertyPath.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/NavigationPropertyPath.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/NavigationPropertyPath.java
new file mode 100644
index 0000000..ee9bc24
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/NavigationPropertyPath.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+public class NavigationPropertyPath extends AbstractElOrAttrConstruct {
+
+    private static final long serialVersionUID = -8066400142504963043L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Null.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Null.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Null.java
new file mode 100644
index 0000000..a36cb3c
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/Null.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+@JsonDeserialize(using = NullDeserializer.class)
+public class Null extends AnnotatedDynExprConstruct {
+
+    private static final long serialVersionUID = -3611384710172781951L;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/7baecb90/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/NullDeserializer.java
----------------------------------------------------------------------
diff --git a/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/NullDeserializer.java b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/NullDeserializer.java
new file mode 100644
index 0000000..02ece69
--- /dev/null
+++ b/ODataJClient/engine/src/main/java/com/msopentech/odatajclient/engine/metadata/edm/v4/annotation/NullDeserializer.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright © Microsoft Open Technologies, Inc.
+ *
+ * All Rights Reserved
+ *
+ * Licensed 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
+ *
+ * THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
+ * ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
+ * PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
+ *
+ * See the Apache License, Version 2.0 for the specific language
+ * governing permissions and limitations under the License.
+ */
+package com.msopentech.odatajclient.engine.metadata.edm.v4.annotation;
+
+import com.msopentech.odatajclient.engine.metadata.edm.v4.Annotation;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.msopentech.odatajclient.engine.metadata.edm.AbstractEdmDeserializer;
+import java.io.IOException;
+
+public class NullDeserializer extends AbstractEdmDeserializer<Null> {
+
+    @Override
+    protected Null doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+            throws IOException, JsonProcessingException {
+
+        final Null _null = new Null();
+
+        for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+            final JsonToken token = jp.getCurrentToken();
+            if (token == JsonToken.FIELD_NAME) {
+                if ("Annotation".equals(jp.getCurrentName())) {
+                    _null.setAnnotation(jp.getCodec().readValue(jp, Annotation.class));
+                }
+            }
+        }
+
+        return _null;
+    }
+
+}