You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/03/07 10:09:33 UTC
[44/57] [abbrv] [OLINGO-186] client-side implementation of commons
Edm interfaces completed: some refactoring on server-side performed to
extract common abstract implementation
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyImpl.java
index b4bf986..8c52101 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/PropertyImpl.java
@@ -18,7 +18,6 @@
*/
package org.apache.olingo.odata4.client.core.edm.xml.v3;
-import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.olingo.odata4.client.api.edm.xml.v3.Property;
import org.apache.olingo.odata4.client.core.edm.xml.AbstractProperty;
import org.apache.olingo.odata4.commons.api.edm.constants.EdmContentKind;
@@ -27,68 +26,74 @@ public class PropertyImpl extends AbstractProperty implements Property {
private static final long serialVersionUID = 6224524803474652100L;
- @JsonProperty("FC_SourcePath")
private String fcSourcePath;
- @JsonProperty("FC_TargetPath")
private String fcTargetPath;
- @JsonProperty("FC_ContentKind")
private EdmContentKind fcContentKind = EdmContentKind.text;
- @JsonProperty("FC_NsPrefix")
private String fcNSPrefix;
- @JsonProperty("FC_NsUri")
private String fcNSURI;
- @JsonProperty("FC_KeepInContent")
private boolean fcKeepInContent = true;
+ @Override
public String getFcSourcePath() {
return fcSourcePath;
}
+ @Override
public void setFcSourcePath(final String fcSourcePath) {
this.fcSourcePath = fcSourcePath;
}
+ @Override
public String getFcTargetPath() {
return fcTargetPath;
}
+ @Override
public void setFcTargetPath(final String fcTargetPath) {
this.fcTargetPath = fcTargetPath;
}
+ @Override
public EdmContentKind getFcContentKind() {
return fcContentKind;
}
+ @Override
public void setFcContentKind(final EdmContentKind fcContentKind) {
this.fcContentKind = fcContentKind;
}
+ @Override
public String getFcNSPrefix() {
return fcNSPrefix;
}
+ @Override
public void setFcNSPrefix(final String fcNSPrefix) {
this.fcNSPrefix = fcNSPrefix;
}
+ @Override
public String getFcNSURI() {
return fcNSURI;
}
+ @Override
public void setFcNSURI(final String fcNSURI) {
this.fcNSURI = fcNSURI;
}
+ @Override
public boolean isFcKeepInContent() {
return fcKeepInContent;
}
+ @Override
public void setFcKeepInContent(final boolean fcKeepInContent) {
this.fcKeepInContent = fcKeepInContent;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/XMLMetadataImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/XMLMetadataImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/XMLMetadataImpl.java
new file mode 100644
index 0000000..b5399ce
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v3/XMLMetadataImpl.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v3;
+
+import java.util.List;
+import org.apache.olingo.odata4.client.core.edm.xml.AbstractXMLMetadata;
+
+public class XMLMetadataImpl extends AbstractXMLMetadata {
+
+ private static final long serialVersionUID = -7765327879691528010L;
+
+ public XMLMetadataImpl(final EdmxImpl edmx) {
+ super(edmx);
+ }
+
+ @Override
+ public SchemaImpl getSchema(final int index) {
+ return (SchemaImpl) super.getSchema(index);
+ }
+
+ @Override
+ public SchemaImpl getSchema(final String key) {
+ return (SchemaImpl) super.getSchema(key);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<SchemaImpl> getSchemas() {
+ return (List<SchemaImpl>) super.getSchemas();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationDeserializer.java
index b449bdf..6a4332a 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationDeserializer.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationDeserializer.java
@@ -24,7 +24,7 @@ import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
-import org.apache.olingo.odata4.client.core.edm.v4.annotation.DynExprConstructImpl;
+import org.apache.olingo.odata4.client.core.edm.xml.v4.annotation.DynExprConstructImpl;
public class AnnotationDeserializer extends AbstractEdmDeserializer<AnnotationImpl> {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationImpl.java
index 47bc2ad..d21f846 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/AnnotationImpl.java
@@ -23,8 +23,8 @@ import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ConstExprConstruct;
import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
-import org.apache.olingo.odata4.client.core.edm.v4.annotation.ConstExprConstructImpl;
-import org.apache.olingo.odata4.client.core.edm.v4.annotation.DynExprConstructImpl;
+import org.apache.olingo.odata4.client.core.edm.xml.v4.annotation.ConstExprConstructImpl;
+import org.apache.olingo.odata4.client.core.edm.xml.v4.annotation.DynExprConstructImpl;
@JsonDeserialize(using = AnnotationDeserializer.class)
public class AnnotationImpl extends AbstractEdmItem implements Annotation {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityContainerImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityContainerImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityContainerImpl.java
index 40bab7c..93a04b9 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityContainerImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntityContainerImpl.java
@@ -59,10 +59,12 @@ public class EntityContainerImpl extends AbstractEntityContainer implements Anno
return entitySets;
}
+ @Override
public List<SingletonImpl> getSingletons() {
return singletons;
}
+ @Override
public SingletonImpl getSingleton(final String name) {
return getOneByName(name, getSingletons());
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntitySetImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntitySetImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntitySetImpl.java
index b0451f5..8160193 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntitySetImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/EntitySetImpl.java
@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
import org.apache.olingo.odata4.client.api.edm.xml.v4.EntitySet;
+import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationPropertyBinding;
import org.apache.olingo.odata4.client.core.edm.xml.AbstractEntitySet;
public class EntitySetImpl extends AbstractEntitySet implements EntitySet {
@@ -32,8 +33,7 @@ public class EntitySetImpl extends AbstractEntitySet implements EntitySet {
private AnnotationImpl annotation;
- private final List<NavigationPropertyBindingImpl> navigationPropertyBindings
- = new ArrayList<NavigationPropertyBindingImpl>();
+ private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
@Override
public boolean isIncludeInServiceDocument() {
@@ -46,7 +46,7 @@ public class EntitySetImpl extends AbstractEntitySet implements EntitySet {
}
@Override
- public List<NavigationPropertyBindingImpl> getNavigationPropertyBindings() {
+ public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
return navigationPropertyBindings;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ParameterImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ParameterImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ParameterImpl.java
index cf54d9e..ed731c3 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ParameterImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ParameterImpl.java
@@ -18,7 +18,6 @@
*/
package org.apache.olingo.odata4.client.core.edm.xml.v4;
-import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.olingo.odata4.client.api.edm.xml.v4.Parameter;
import org.apache.olingo.odata4.client.core.edm.xml.AbstractParameter;
@@ -26,7 +25,6 @@ public class ParameterImpl extends AbstractParameter implements Parameter {
private static final long serialVersionUID = -1067642515116697747L;
- @JsonProperty(value = "SRID")
private String srid;
@Override
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/PropertyImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/PropertyImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/PropertyImpl.java
index ae2e4d1..0655061 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/PropertyImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/PropertyImpl.java
@@ -19,7 +19,6 @@
package org.apache.olingo.odata4.client.core.edm.xml.v4;
import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
import org.apache.olingo.odata4.client.api.edm.xml.v4.Property;
import org.apache.olingo.odata4.client.core.edm.xml.AbstractProperty;
@@ -28,7 +27,6 @@ public class PropertyImpl extends AbstractProperty implements Property {
private static final long serialVersionUID = -5541908235094985412L;
- @JsonProperty("Annotation")
private AnnotationImpl annotation;
@Override
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeDeserializer.java
new file mode 100644
index 0000000..d3e426f
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeDeserializer.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.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 java.io.IOException;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
+
+public class ReturnTypeDeserializer extends AbstractEdmDeserializer<ReturnTypeImpl> {
+
+ @Override
+ protected ReturnTypeImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final ReturnTypeImpl returnType = new ReturnTypeImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Type".equals(jp.getCurrentName())) {
+ returnType.setType(jp.nextTextValue());
+ } else if ("Nullable".equals(jp.getCurrentName())) {
+ returnType.setNullable(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("MaxLength".equals(jp.getCurrentName())) {
+ final String maxLenght = jp.nextTextValue();
+ returnType.setMaxLength(maxLenght.equalsIgnoreCase("max") ? Integer.MAX_VALUE : Integer.valueOf(maxLenght));
+ } else if ("Precision".equals(jp.getCurrentName())) {
+ returnType.setPrecision(Integer.valueOf(jp.nextTextValue()));
+ } else if ("Scale".equals(jp.getCurrentName())) {
+ returnType.setScale(Integer.valueOf(jp.nextTextValue()));
+ } else if ("SRID".equals(jp.getCurrentName())) {
+ returnType.setSrid(jp.nextTextValue());
+ }
+ }
+ }
+
+ return returnType;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeImpl.java
index 6fcf691..02eb54a 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/ReturnTypeImpl.java
@@ -18,31 +18,25 @@
*/
package org.apache.olingo.odata4.client.core.edm.xml.v4;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.math.BigInteger;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.apache.olingo.odata4.client.api.edm.xml.v4.ReturnType;
import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
+@JsonDeserialize(using = ReturnTypeDeserializer.class)
public class ReturnTypeImpl extends AbstractEdmItem implements ReturnType {
private static final long serialVersionUID = -5888231162358116515L;
- @JsonProperty(value = "Type")
private String type;
- @JsonProperty(value = "Nullable")
private boolean nullable = true;
- @JsonProperty(value = "MaxLength")
- private String maxLength;
+ private Integer maxLength;
- @JsonProperty(value = "Precision")
- private BigInteger precision;
+ private Integer precision;
- @JsonProperty(value = "Scale")
- private BigInteger scale;
+ private Integer scale;
- @JsonProperty(value = "SRID")
private String srid;
@Override
@@ -66,32 +60,32 @@ public class ReturnTypeImpl extends AbstractEdmItem implements ReturnType {
}
@Override
- public String getMaxLength() {
+ public Integer getMaxLength() {
return maxLength;
}
@Override
- public void setMaxLength(final String maxLength) {
+ public void setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
}
@Override
- public BigInteger getPrecision() {
+ public Integer getPrecision() {
return precision;
}
@Override
- public void setPrecision(final BigInteger precision) {
+ public void setPrecision(final Integer precision) {
this.precision = precision;
}
@Override
- public BigInteger getScale() {
+ public Integer getScale() {
return scale;
}
@Override
- public void setScale(final BigInteger scale) {
+ public void setScale(final Integer scale) {
this.scale = scale;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SchemaImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SchemaImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SchemaImpl.java
index d37e9fb..3987d3c 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SchemaImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SchemaImpl.java
@@ -92,6 +92,10 @@ public class SchemaImpl extends AbstractSchema implements Schema, AnnotatedEdmIt
return terms;
}
+ public TypeDefinitionImpl getTypeDefinition(final String name) {
+ return getOneByName(name, getTypeDefinitions());
+ }
+
public List<TypeDefinitionImpl> getTypeDefinitions() {
return typeDefinitions;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonDeserializer.java
index 06385db..77b7889 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonDeserializer.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonDeserializer.java
@@ -39,7 +39,7 @@ public class SingletonDeserializer extends AbstractEdmDeserializer<SingletonImpl
if ("Name".equals(jp.getCurrentName())) {
singleton.setName(jp.nextTextValue());
} else if ("Type".equals(jp.getCurrentName())) {
- singleton.setType(jp.nextTextValue());
+ singleton.setEntityType(jp.nextTextValue());
} else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
jp.nextToken();
singleton.getNavigationPropertyBindings().add(
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonImpl.java
index 09044bc..21f2fb6 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/SingletonImpl.java
@@ -21,6 +21,7 @@ package org.apache.olingo.odata4.client.core.edm.xml.v4;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.ArrayList;
import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.xml.v4.NavigationPropertyBinding;
import org.apache.olingo.odata4.client.api.edm.xml.v4.Singleton;
@JsonDeserialize(using = SingletonDeserializer.class)
@@ -30,10 +31,9 @@ public class SingletonImpl extends AbstractAnnotatedEdmItem implements Singleton
private String name;
- private String type;
+ private String entityType;
- private final List<NavigationPropertyBindingImpl> navigationPropertyBindings
- = new ArrayList<NavigationPropertyBindingImpl>();
+ private final List<NavigationPropertyBinding> navigationPropertyBindings = new ArrayList<NavigationPropertyBinding>();
@Override
public String getName() {
@@ -46,17 +46,17 @@ public class SingletonImpl extends AbstractAnnotatedEdmItem implements Singleton
}
@Override
- public String getType() {
- return type;
+ public String getEntityType() {
+ return entityType;
}
@Override
- public void setType(final String type) {
- this.type = type;
+ public void setEntityType(final String entityType) {
+ this.entityType = entityType;
}
@Override
- public List<NavigationPropertyBindingImpl> getNavigationPropertyBindings() {
+ public List<NavigationPropertyBinding> getNavigationPropertyBindings() {
return navigationPropertyBindings;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
index 36b4cbe..07d2589 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
@@ -23,7 +23,6 @@ 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.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
@@ -43,18 +42,18 @@ public class TypeDefinitionDeserializer extends AbstractEdmDeserializer<TypeDefi
} else if ("UnderlyingType".equals(jp.getCurrentName())) {
typeDefinition.setUnderlyingType(jp.nextTextValue());
} else if ("MaxLength".equals(jp.getCurrentName())) {
- typeDefinition.setMaxLength(jp.nextTextValue());
+ typeDefinition.setMaxLength(jp.nextIntValue(0));
} 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)));
+ typeDefinition.setPrecision(jp.nextIntValue(0));
} else if ("Scale".equals(jp.getCurrentName())) {
- typeDefinition.setScale(BigInteger.valueOf(jp.nextLongValue(0L)));
+ typeDefinition.setScale(jp.nextIntValue(0));
} else if ("SRID".equals(jp.getCurrentName())) {
typeDefinition.setSrid(jp.nextTextValue());
} else if ("Annotation".equals(jp.getCurrentName())) {
jp.nextToken();
- typeDefinition.getAnnotations().add(jp.readValueAs( AnnotationImpl.class));
+ typeDefinition.getAnnotations().add(jp.readValueAs(AnnotationImpl.class));
}
}
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionImpl.java
index 061a4a6..cbccf9e 100644
--- a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionImpl.java
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/TypeDefinitionImpl.java
@@ -18,12 +18,13 @@
*/
package org.apache.olingo.odata4.client.core.edm.xml.v4;
-import java.math.BigInteger;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.ArrayList;
import java.util.List;
import org.apache.olingo.odata4.client.api.edm.xml.v4.TypeDefinition;
import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
+@JsonDeserialize(using = TypeDefinitionDeserializer.class)
public class TypeDefinitionImpl extends AbstractEdmItem implements TypeDefinition {
private static final long serialVersionUID = -5888231162358116515L;
@@ -32,11 +33,11 @@ public class TypeDefinitionImpl extends AbstractEdmItem implements TypeDefinitio
private String underlyingType;
- private String maxLength;
+ private Integer maxLength;
- private BigInteger precision;
+ private Integer precision;
- private BigInteger scale;
+ private Integer scale;
private boolean unicode = true;
@@ -65,32 +66,32 @@ public class TypeDefinitionImpl extends AbstractEdmItem implements TypeDefinitio
}
@Override
- public String getMaxLength() {
+ public Integer getMaxLength() {
return maxLength;
}
@Override
- public void setMaxLength(final String maxLength) {
+ public void setMaxLength(final Integer maxLength) {
this.maxLength = maxLength;
}
@Override
- public BigInteger getPrecision() {
+ public Integer getPrecision() {
return precision;
}
@Override
- public void setPrecision(final BigInteger precision) {
+ public void setPrecision(final Integer precision) {
this.precision = precision;
}
@Override
- public BigInteger getScale() {
+ public Integer getScale() {
return scale;
}
@Override
- public void setScale(final BigInteger scale) {
+ public void setScale(final Integer scale) {
this.scale = scale;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/XMLMetadataImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/XMLMetadataImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/XMLMetadataImpl.java
new file mode 100644
index 0000000..98c8914
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/XMLMetadataImpl.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4;
+
+import java.util.List;
+import org.apache.olingo.odata4.client.core.edm.xml.AbstractXMLMetadata;
+
+public class XMLMetadataImpl extends AbstractXMLMetadata {
+
+ private static final long serialVersionUID = -7765327879691528010L;
+
+ public XMLMetadataImpl(final EdmxImpl edmx) {
+ super(edmx);
+ }
+
+ @Override
+ public SchemaImpl getSchema(final int index) {
+ return (SchemaImpl) super.getSchema(index);
+ }
+
+ @Override
+ public SchemaImpl getSchema(final String key) {
+ return (SchemaImpl) super.getSchema(key);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public List<SchemaImpl> getSchemas() {
+ return (List<SchemaImpl>) super.getSchemas();
+ }
+
+ public List<ReferenceImpl> getReferences() {
+ return ((EdmxImpl) this.edmx).getReferences();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java
new file mode 100644
index 0000000..fe871b3
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AbstractElOrAttrConstruct.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+/**
+ * Groups dynamic expressions that may be provided using element notation or attribute notation.
+ */
+abstract class AbstractElOrAttrConstruct extends DynExprConstructImpl {
+
+ 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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java
new file mode 100644
index 0000000..4fe94f9
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotatedDynExprConstruct.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import org.apache.olingo.odata4.client.api.edm.xml.v4.Annotation;
+import org.apache.olingo.odata4.client.api.edm.xml.v4.AnnotatedEdmItem;
+import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
+
+abstract class AnnotatedDynExprConstruct extends DynExprConstructImpl implements AnnotatedEdmItem {
+
+ private static final long serialVersionUID = -8117155475397749038L;
+
+ private AnnotationImpl annotation;
+
+ @Override
+ public AnnotationImpl getAnnotation() {
+ return annotation;
+ }
+
+ @Override
+ public void setAnnotation(final Annotation annotation) {
+ this.annotation = (AnnotationImpl) annotation;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotationPath.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotationPath.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotationPath.java
new file mode 100644
index 0000000..b6a4c7d
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/AnnotationPath.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Apply.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Apply.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Apply.java
new file mode 100644
index 0000000..362fbc2
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Apply.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
+
+@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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ApplyDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
new file mode 100644
index 0000000..56378dc
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.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 java.io.IOException;
+import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
+
+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.readValueAs(AnnotationImpl.class));
+ } else if (isAnnotationConstExprConstruct(jp)) {
+ apply.getParameters().add(parseAnnotationConstExprConstruct(jp));
+ } else {
+ apply.getParameters().add(jp.readValueAs(DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return apply;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Cast.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Cast.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Cast.java
new file mode 100644
index 0000000..b3e3127
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Cast.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.math.BigInteger;
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+@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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CastDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CastDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CastDeserializer.java
new file mode 100644
index 0000000..4430bc0
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CastDeserializer.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.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 java.io.IOException;
+import java.math.BigInteger;
+import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
+
+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.readValueAs(AnnotationImpl.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.readValueAs(DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return cast;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Collection.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Collection.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Collection.java
new file mode 100644
index 0000000..3583a5c
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/Collection.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
+
+@JsonDeserialize(using = CollectionDeserializer.class)
+public class Collection extends DynExprConstructImpl {
+
+ 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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CollectionDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
new file mode 100644
index 0000000..20b0f56
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.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 java.io.IOException;
+import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
+
+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.readValueAs( DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return collection;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java
new file mode 100644
index 0000000..d701d06
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ConstExprConstructImpl.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ConstExprConstruct;
+
+public class ConstExprConstructImpl extends ExprConstructImpl implements ConstExprConstruct {
+
+ private static final long serialVersionUID = 2250072064504668969L;
+
+ private Type type;
+
+ private String value;
+
+ @Override
+ public Type getType() {
+ return type;
+ }
+
+ @Override
+ public void setType(final Type type) {
+ this.type = type;
+ }
+
+ @Override
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public void setValue(final String value) {
+ this.value = value;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
new file mode 100644
index 0000000..e881c39
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.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 java.io.IOException;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.ClassUtils;
+import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
+
+public class DynExprConstructDeserializer extends AbstractEdmDeserializer<DynExprConstructImpl> {
+
+ 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 ExprConstructImpl parseConstOrEnumExprConstruct(final JsonParser jp) throws IOException {
+ ExprConstructImpl result;
+ if (isAnnotationConstExprConstruct(jp)) {
+ result = parseAnnotationConstExprConstruct(jp);
+ } else {
+ result = jp.readValueAs( DynExprConstructImpl.class);
+ }
+ jp.nextToken();
+
+ return result;
+ }
+
+ @Override
+ protected DynExprConstructImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ DynExprConstructImpl 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.readValueAs( DynExprConstructImpl.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.readValueAs( DynExprConstructImpl.class));
+ dynExprDoubleParamOp.setRight(jp.readValueAs( DynExprConstructImpl.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.readValueAs( Apply.class);
+ } else if (CAST.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( Cast.class);
+ } else if (COLLECTION.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( 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.readValueAs( IsOf.class);
+ } else if (LABELED_ELEMENT.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( LabeledElement.class);
+ } else if (NULL.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( Null.class);
+ } else if (RECORD.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( Record.class);
+ } else if (URL_REF.equals(jp.getCurrentName())) {
+ jp.nextToken();
+ construct = jp.readValueAs( UrlRef.class);
+ }
+
+ return construct;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java
new file mode 100644
index 0000000..862b322
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprConstructImpl.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+@JsonDeserialize(using = DynExprConstructDeserializer.class)
+public abstract class DynExprConstructImpl extends ExprConstructImpl implements DynExprConstruct {
+
+ private static final long serialVersionUID = -642012862023177349L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java
new file mode 100644
index 0000000..6fd83d3
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprDoubleParamOp.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+public class DynExprDoubleParamOp extends DynExprConstructImpl {
+
+ 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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java
new file mode 100644
index 0000000..7fc34e2
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/DynExprSingleParamOp.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+public class DynExprSingleParamOp extends DynExprConstructImpl {
+
+ 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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ExprConstructImpl.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ExprConstructImpl.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ExprConstructImpl.java
new file mode 100644
index 0000000..960c730
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/ExprConstructImpl.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
+import org.apache.olingo.odata4.client.core.edm.xml.AbstractEdmItem;
+
+public abstract class ExprConstructImpl extends AbstractEdmItem implements ExprConstruct {
+
+ private static final long serialVersionUID = 7108626008005050492L;
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/If.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/If.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/If.java
new file mode 100644
index 0000000..e6ea91d
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/If.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.ExprConstruct;
+
+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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOf.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOf.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOf.java
new file mode 100644
index 0000000..d327964
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOf.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import java.math.BigInteger;
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+@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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOfDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
new file mode 100644
index 0000000..283997e
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.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 java.io.IOException;
+import java.math.BigInteger;
+import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
+
+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.readValueAs(AnnotationImpl.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.readValueAs(DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return isof;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElement.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElement.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElement.java
new file mode 100644
index 0000000..15321d2
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElement.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.v4.annotation;
+
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import org.apache.olingo.odata4.client.api.edm.xml.v4.annotation.DynExprConstruct;
+
+@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/bae3d847/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
----------------------------------------------------------------------
diff --git a/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
new file mode 100644
index 0000000..440b08b
--- /dev/null
+++ b/odata4-lib/odata4-client-core/src/main/java/org/apache/olingo/odata4/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.odata4.client.core.edm.xml.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 java.io.IOException;
+import org.apache.olingo.odata4.client.core.op.impl.AbstractEdmDeserializer;
+import org.apache.olingo.odata4.client.core.edm.xml.v4.AnnotationImpl;
+
+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.readValueAs(AnnotationImpl.class));
+ } else {
+ element.setValue(jp.readValueAs(DynExprConstructImpl.class));
+ }
+ }
+ }
+
+ return element;
+ }
+
+}