You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/04/01 11:00:38 UTC
[26/52] [abbrv] git commit: Moving some classes to more appropriate
packages
Moving some classes to more appropriate packages
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/9b3e4ebf
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/9b3e4ebf
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/9b3e4ebf
Branch: refs/heads/olingo-206-validator
Commit: 9b3e4ebfc966ccac244f0e01d96c95931708b98d
Parents: c876e67
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Mar 24 08:24:39 2014 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Mar 24 08:24:39 2014 +0100
----------------------------------------------------------------------
.../olingo/client/core/data/JSONEntryImpl.java | 4 +-
.../core/edm/xml/AbstractComplexType.java | 1 -
.../core/edm/xml/AbstractEdmDeserializer.java | 71 +++++++++
.../core/edm/xml/AbstractEntityContainer.java | 1 -
.../client/core/edm/xml/AbstractEntitySet.java | 1 -
.../client/core/edm/xml/AbstractEntityType.java | 1 -
.../client/core/edm/xml/AbstractEnumType.java | 1 -
.../client/core/edm/xml/AbstractSchema.java | 1 -
.../core/edm/xml/ComplexTypeDeserializer.java | 82 ++++++++++
.../core/edm/xml/DataServicesDeserializer.java | 1 -
.../client/core/edm/xml/EdmxDeserializer.java | 1 -
.../edm/xml/EntityContainerDeserializer.java | 101 +++++++++++++
.../core/edm/xml/EntityKeyDeserializer.java | 47 ++++++
.../client/core/edm/xml/EntityKeyImpl.java | 1 -
.../core/edm/xml/EntitySetDeserializer.java | 69 +++++++++
.../core/edm/xml/EntityTypeDeserializer.java | 90 +++++++++++
.../core/edm/xml/EnumTypeDeserializer.java | 72 +++++++++
.../core/edm/xml/ParameterDeserializer.java | 1 -
.../core/edm/xml/PropertyDeserializer.java | 1 -
.../client/core/edm/xml/SchemaDeserializer.java | 148 ++++++++++++++++++
.../edm/xml/v3/AnnotationsDeserializer.java | 2 +-
.../edm/xml/v3/AssociationDeserializer.java | 2 +-
.../edm/xml/v3/AssociationSetDeserializer.java | 2 +-
.../edm/xml/v3/FunctionImportDeserializer.java | 2 +-
.../ReferentialConstraintRoleDeserializer.java | 2 +-
.../edm/xml/v3/TypeAnnotationDeserializer.java | 2 +-
.../core/edm/xml/v4/ActionDeserializer.java | 2 +-
.../core/edm/xml/v4/AnnotationDeserializer.java | 2 +-
.../edm/xml/v4/AnnotationsDeserializer.java | 2 +-
.../core/edm/xml/v4/FunctionDeserializer.java | 2 +-
.../xml/v4/NavigationPropertyDeserializer.java | 2 +-
.../core/edm/xml/v4/ReferenceDeserializer.java | 2 +-
.../core/edm/xml/v4/ReturnTypeDeserializer.java | 2 +-
.../core/edm/xml/v4/SingletonDeserializer.java | 2 +-
.../core/edm/xml/v4/TermDeserializer.java | 2 +-
.../edm/xml/v4/TypeDefinitionDeserializer.java | 2 +-
.../xml/v4/annotation/ApplyDeserializer.java | 2 +-
.../edm/xml/v4/annotation/CastDeserializer.java | 2 +-
.../v4/annotation/CollectionDeserializer.java | 2 +-
.../DynExprConstructDeserializer.java | 2 +-
.../edm/xml/v4/annotation/IsOfDeserializer.java | 2 +-
.../annotation/LabeledElementDeserializer.java | 2 +-
.../edm/xml/v4/annotation/NullDeserializer.java | 2 +-
.../annotation/PropertyValueDeserializer.java | 2 +-
.../xml/v4/annotation/RecordDeserializer.java | 2 +-
.../xml/v4/annotation/UrlRefDeserializer.java | 2 +-
.../client/core/op/AbstractEdmDeserializer.java | 71 ---------
.../client/core/op/ComplexTypeDeserializer.java | 83 -----------
.../core/op/EntityContainerDeserializer.java | 102 -------------
.../client/core/op/EntityKeyDeserializer.java | 50 -------
.../client/core/op/EntitySetDeserializer.java | 70 ---------
.../client/core/op/EntityTypeDeserializer.java | 92 ------------
.../client/core/op/EnumTypeDeserializer.java | 73 ---------
.../client/core/op/SchemaDeserializer.java | 149 -------------------
54 files changed, 707 insertions(+), 730 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/data/JSONEntryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/JSONEntryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/JSONEntryImpl.java
index f82ac12..cafe289 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/data/JSONEntryImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/data/JSONEntryImpl.java
@@ -18,7 +18,6 @@
*/
package org.apache.olingo.client.core.data;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.net.URI;
@@ -38,11 +37,10 @@ public class JSONEntryImpl extends AbstractEntry {
private String mediaETag;
- public void setId(String id) throws ParseException {
+ public void setId(final String id) throws ParseException {
this.setCommonProperty("id", id);
}
- @JsonIgnore
@Override
public URI getBaseURI() {
URI baseURI = null;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
index 0630a59..e09250c 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractComplexType.java
@@ -23,7 +23,6 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.apache.olingo.client.api.edm.xml.CommonNavigationProperty;
import org.apache.olingo.client.api.edm.xml.CommonProperty;
import org.apache.olingo.client.api.edm.xml.ComplexType;
-import org.apache.olingo.client.core.op.ComplexTypeDeserializer;
@JsonDeserialize(using = ComplexTypeDeserializer.class)
public abstract class AbstractComplexType extends AbstractEdmItem implements ComplexType {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmDeserializer.java
new file mode 100644
index 0000000..c3ff9c4
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEdmDeserializer.java
@@ -0,0 +1,71 @@
+/*
+ * 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.client.core.edm.xml;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser;
+
+import java.io.IOException;
+
+import org.apache.olingo.client.api.CommonODataClient;
+import org.apache.olingo.client.core.edm.xml.v4.ReturnTypeImpl;
+import org.apache.olingo.client.core.edm.xml.v4.annotation.ConstExprConstructImpl;
+
+public abstract class AbstractEdmDeserializer<T> extends JsonDeserializer<T> {
+
+ protected CommonODataClient client;
+
+ protected boolean isAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
+ return ConstExprConstructImpl.Type.fromString(jp.getCurrentName()) != null;
+ }
+
+ protected ConstExprConstructImpl parseAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
+ final ConstExprConstructImpl constExpr = new ConstExprConstructImpl();
+ constExpr.setType(ConstExprConstructImpl.Type.fromString(jp.getCurrentName()));
+ constExpr.setValue(jp.nextTextValue());
+ return constExpr;
+ }
+
+ protected ReturnTypeImpl parseReturnType(final JsonParser jp, final String elementName) throws IOException {
+ ReturnTypeImpl returnType;
+ if (elementName.equals(((FromXmlParser) jp).getStaxReader().getLocalName())) {
+ returnType = new ReturnTypeImpl();
+ returnType.setType(jp.nextTextValue());
+ } else {
+ jp.nextToken();
+ returnType = jp.readValueAs( ReturnTypeImpl.class);
+ }
+ return returnType;
+ }
+
+ protected abstract T doDeserialize(JsonParser jp, DeserializationContext ctxt)
+ throws IOException, JsonProcessingException;
+
+ @Override
+ public T deserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ client = (CommonODataClient) ctxt.findInjectableValue(CommonODataClient.class.getName(), null, null);
+ return doDeserialize(jp, ctxt);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
index c15266e..fb6b229 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityContainer.java
@@ -25,7 +25,6 @@ import java.util.List;
import org.apache.olingo.client.api.edm.xml.CommonFunctionImport;
import org.apache.olingo.client.api.edm.xml.EntityContainer;
import org.apache.olingo.client.api.edm.xml.EntitySet;
-import org.apache.olingo.client.core.op.EntityContainerDeserializer;
@JsonDeserialize(using = EntityContainerDeserializer.class)
public abstract class AbstractEntityContainer extends AbstractEdmItem implements EntityContainer {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntitySet.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntitySet.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntitySet.java
index 65650f3..d2762ad 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntitySet.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntitySet.java
@@ -21,7 +21,6 @@ package org.apache.olingo.client.core.edm.xml;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.apache.olingo.client.api.edm.xml.EntitySet;
-import org.apache.olingo.client.core.op.EntitySetDeserializer;
@JsonDeserialize(using = EntitySetDeserializer.class)
public abstract class AbstractEntitySet extends AbstractEdmItem implements EntitySet {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityType.java
index e375323..649dbe8 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityType.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEntityType.java
@@ -22,7 +22,6 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.apache.olingo.client.api.edm.xml.EntityKey;
import org.apache.olingo.client.api.edm.xml.EntityType;
-import org.apache.olingo.client.core.op.EntityTypeDeserializer;
@JsonDeserialize(using = EntityTypeDeserializer.class)
public abstract class AbstractEntityType extends AbstractComplexType implements EntityType {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEnumType.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEnumType.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEnumType.java
index 3730fad..d84bfbd 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEnumType.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractEnumType.java
@@ -25,7 +25,6 @@ import java.util.List;
import org.apache.olingo.client.api.edm.xml.EnumType;
import org.apache.olingo.client.api.edm.xml.Member;
-import org.apache.olingo.client.core.op.EnumTypeDeserializer;
@JsonDeserialize(using = EnumTypeDeserializer.class)
public abstract class AbstractEnumType extends AbstractEdmItem implements EnumType {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractSchema.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractSchema.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractSchema.java
index 6cc2915..83ac0ac 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractSchema.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/AbstractSchema.java
@@ -24,7 +24,6 @@ import org.apache.olingo.client.api.edm.xml.ComplexType;
import org.apache.olingo.client.api.edm.xml.EntityType;
import org.apache.olingo.client.api.edm.xml.EnumType;
import org.apache.olingo.client.api.edm.xml.Schema;
-import org.apache.olingo.client.core.op.SchemaDeserializer;
@JsonDeserialize(using = SchemaDeserializer.class)
public abstract class AbstractSchema extends AbstractEdmItem implements Schema {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
new file mode 100644
index 0000000..c9730cb
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ComplexTypeDeserializer.java
@@ -0,0 +1,82 @@
+/*
+ * 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.client.core.edm.xml;
+
+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.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class ComplexTypeDeserializer extends AbstractEdmDeserializer<AbstractComplexType> {
+
+ @Override
+ protected AbstractComplexType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractComplexType complexType = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ complexType.setName(jp.nextTextValue());
+ } else if ("Abstract".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("BaseType".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ setBaseType(jp.nextTextValue());
+ } else if ("OpenType".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Property".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (complexType instanceof org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl) complexType).
+ getProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.PropertyImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ getProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.PropertyImpl.class));
+ }
+ } else if ("NavigationProperty".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ getNavigationProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl) complexType).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return complexType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
index 94ec6bb..ef2e201 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/DataServicesDeserializer.java
@@ -18,7 +18,6 @@
*/
package org.apache.olingo.client.core.edm.xml;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import com.fasterxml.jackson.core.JsonParser;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
index a3041f0..f617d5b 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EdmxDeserializer.java
@@ -19,7 +19,6 @@
package org.apache.olingo.client.core.edm.xml;
import org.apache.olingo.client.core.edm.xml.v4.ReferenceImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import com.fasterxml.jackson.core.JsonParser;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
new file mode 100644
index 0000000..67735a8
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityContainerDeserializer.java
@@ -0,0 +1,101 @@
+/*
+ * 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.client.core.edm.xml;
+
+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.client.core.edm.xml.v3.AssociationSetImpl;
+import org.apache.olingo.client.core.edm.xml.v4.ActionImportImpl;
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.edm.xml.v4.SingletonImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+@SuppressWarnings("rawtypes")
+public class EntityContainerDeserializer extends AbstractEdmDeserializer<AbstractEntityContainer> {
+
+ @Override
+ protected AbstractEntityContainer doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractEntityContainer entityContainer = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ entityContainer.setName(jp.nextTextValue());
+ } else if ("Extends".equals(jp.getCurrentName())) {
+ entityContainer.setExtends(jp.nextTextValue());
+ } else if ("LazyLoadingEnabled".equals(jp.getCurrentName())) {
+ entityContainer.setLazyLoadingEnabled(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("IsDefaultEntityContainer".equals(jp.getCurrentName())) {
+ entityContainer.setDefaultEntityContainer(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("EntitySet".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (entityContainer instanceof org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) entityContainer).
+ getEntitySets().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.EntitySetImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ getEntitySets().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl.class));
+ }
+ } else if ("AssociationSet".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) entityContainer).
+ getAssociationSets().add(jp.readValueAs(AssociationSetImpl.class));
+ } else if ("Singleton".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ getSingletons().add(jp.readValueAs(SingletonImpl.class));
+ } else if ("ActionImport".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ getActionImports().add(jp.readValueAs(ActionImportImpl.class));
+ } else if ("FunctionImport".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (entityContainer instanceof org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl) entityContainer).
+ getFunctionImports().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.FunctionImportImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ getFunctionImports().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.FunctionImportImpl.class));
+ }
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl) entityContainer).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return entityContainer;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyDeserializer.java
new file mode 100644
index 0000000..4e5435d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyDeserializer.java
@@ -0,0 +1,47 @@
+/*
+ * 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.client.core.edm.xml;
+
+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 EntityKeyDeserializer extends AbstractEdmDeserializer<EntityKeyImpl> {
+
+ @Override
+ protected EntityKeyImpl doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final EntityKeyImpl entityKey = new EntityKeyImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+
+ if (token == JsonToken.FIELD_NAME && "PropertyRef".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityKey.getPropertyRefs().add(jp.readValueAs( PropertyRefImpl.class));
+ }
+ }
+
+ return entityKey;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyImpl.java
index 8074e69..b47e0fc 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityKeyImpl.java
@@ -25,7 +25,6 @@ import java.util.List;
import org.apache.olingo.client.api.edm.xml.EntityKey;
import org.apache.olingo.client.api.edm.xml.PropertyRef;
-import org.apache.olingo.client.core.op.EntityKeyDeserializer;
@JsonDeserialize(using = EntityKeyDeserializer.class)
public class EntityKeyImpl extends AbstractEdmItem implements EntityKey {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.java
new file mode 100644
index 0000000..861ea2f
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntitySetDeserializer.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.client.core.edm.xml;
+
+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.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyBindingImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class EntitySetDeserializer extends AbstractEdmDeserializer<AbstractEntitySet> {
+
+ @Override
+ protected AbstractEntitySet doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractEntitySet entitySet = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.EntitySetImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ entitySet.setName(jp.nextTextValue());
+ } else if ("EntityType".equals(jp.getCurrentName())) {
+ entitySet.setEntityType(jp.nextTextValue());
+ } else if ("IncludeInServiceDocument".equals(jp.getCurrentName())) {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).
+ setIncludeInServiceDocument(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("NavigationPropertyBinding".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).
+ getNavigationPropertyBindings().add(
+ jp.readValueAs(NavigationPropertyBindingImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntitySetImpl) entitySet).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return entitySet;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.java
new file mode 100644
index 0000000..8f3c60d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EntityTypeDeserializer.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.client.core.edm.xml;
+
+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.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class EntityTypeDeserializer extends AbstractEdmDeserializer<AbstractEntityType> {
+
+ @Override
+ protected AbstractEntityType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractEntityType entityType = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ entityType.setName(jp.nextTextValue());
+ } else if ("Abstract".equals(jp.getCurrentName())) {
+ entityType.setAbstractEntityType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("BaseType".equals(jp.getCurrentName())) {
+ entityType.setBaseType(jp.nextTextValue());
+ } else if ("OpenType".equals(jp.getCurrentName())) {
+ entityType.setOpenType(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("HasStream".equals(jp.getCurrentName())) {
+ entityType.setHasStream(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Key".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ entityType.setKey(jp.readValueAs(EntityKeyImpl.class));
+ } else if ("Property".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (entityType instanceof org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) entityType).
+ getProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.PropertyImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).
+ getProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.PropertyImpl.class));
+ }
+ } else if ("NavigationProperty".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (entityType instanceof org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl) entityType).
+ getNavigationProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.NavigationPropertyImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).
+ getNavigationProperties().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.NavigationPropertyImpl.class));
+ }
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl) entityType).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return entityType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
new file mode 100644
index 0000000..9c99ea2
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/EnumTypeDeserializer.java
@@ -0,0 +1,72 @@
+/*
+ * 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.client.core.edm.xml;
+
+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.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class EnumTypeDeserializer extends AbstractEdmDeserializer<AbstractEnumType> {
+
+ @Override
+ protected AbstractEnumType doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractEnumType enumType = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Name".equals(jp.getCurrentName())) {
+ enumType.setName(jp.nextTextValue());
+ } else if ("UnderlyingType".equals(jp.getCurrentName())) {
+ enumType.setUnderlyingType(jp.nextTextValue());
+ } else if ("IsFlags".equals(jp.getCurrentName())) {
+ enumType.setFlags(BooleanUtils.toBoolean(jp.nextTextValue()));
+ } else if ("Member".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (enumType instanceof org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl) enumType).
+ getMembers().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.MemberImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl) enumType).
+ getMembers().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.MemberImpl.class));
+ }
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl) enumType).
+ setAnnotation(jp.readValueAs(AnnotationImpl.class));
+ }
+ }
+ }
+
+ return enumType;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
index cb0178d..2aa3cdd 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/ParameterDeserializer.java
@@ -27,7 +27,6 @@ import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.olingo.client.api.edm.xml.v3.ParameterMode;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
public class ParameterDeserializer extends AbstractEdmDeserializer<AbstractParameter> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
index ec40746..8815e44 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/PropertyDeserializer.java
@@ -24,7 +24,6 @@ import org.apache.commons.lang3.BooleanUtils;
import org.apache.olingo.client.api.edm.ConcurrencyMode;
import org.apache.olingo.client.api.edm.StoreGeneratedPattern;
import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
import org.apache.olingo.commons.api.edm.constants.EdmContentKind;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
new file mode 100644
index 0000000..afa0a84
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/SchemaDeserializer.java
@@ -0,0 +1,148 @@
+/*
+ * 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.client.core.edm.xml;
+
+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.client.core.edm.xml.v3.AssociationImpl;
+import org.apache.olingo.client.core.edm.xml.v3.UsingImpl;
+import org.apache.olingo.client.core.edm.xml.v3.ValueTermImpl;
+import org.apache.olingo.client.core.edm.xml.v4.ActionImpl;
+import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
+import org.apache.olingo.client.core.edm.xml.v4.FunctionImpl;
+import org.apache.olingo.client.core.edm.xml.v4.TypeDefinitionImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+@SuppressWarnings("rawtypes")
+public class SchemaDeserializer extends AbstractEdmDeserializer<AbstractSchema> {
+
+ @Override
+ protected AbstractSchema doDeserialize(final JsonParser jp, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final AbstractSchema schema = ODataServiceVersion.V30 == client.getServiceVersion()
+ ? new org.apache.olingo.client.core.edm.xml.v3.SchemaImpl()
+ : new org.apache.olingo.client.core.edm.xml.v4.SchemaImpl();
+
+ for (; jp.getCurrentToken() != JsonToken.END_OBJECT; jp.nextToken()) {
+ final JsonToken token = jp.getCurrentToken();
+ if (token == JsonToken.FIELD_NAME) {
+ if ("Namespace".equals(jp.getCurrentName())) {
+ schema.setNamespace(jp.nextTextValue());
+ } else if ("Alias".equals(jp.getCurrentName())) {
+ schema.setAlias(jp.nextTextValue());
+ } else if ("Using".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getUsings().add(jp.readValueAs( UsingImpl.class));
+ } else if ("Association".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getAssociations().add(jp.readValueAs( AssociationImpl.class));
+ } else if ("ComplexType".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getComplexTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.ComplexTypeImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ getComplexTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.ComplexTypeImpl.class));
+ }
+ } else if ("EntityType".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getEntityTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.EntityTypeImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ getEntityTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.EntityTypeImpl.class));
+ }
+ } else if ("EnumType".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getEnumTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.EnumTypeImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ getEnumTypes().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.EnumTypeImpl.class));
+ }
+ } else if ("ValueTerm".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getValueTerms().add(jp.readValueAs( ValueTermImpl.class));
+ } else if ("EntityContainer".equals(jp.getCurrentName())) {
+ jp.nextToken();
+
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).
+ getEntityContainers().add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.EntityContainerImpl.class));
+ } else {
+ org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl entityContainer
+ = jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.EntityContainerImpl.class);
+ entityContainer.setDefaultEntityContainer(true);
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ setEntityContainer(entityContainer);
+ }
+ } else if ("Annotations".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ if (schema instanceof org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) {
+ ((org.apache.olingo.client.core.edm.xml.v3.SchemaImpl) schema).getAnnotationsList().
+ add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v3.AnnotationsImpl.class));
+ } else {
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotationsList().
+ add(jp.readValueAs(
+ org.apache.olingo.client.core.edm.xml.v4.AnnotationsImpl.class));
+ }
+ } else if ("Action".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getActions().
+ add(jp.readValueAs( ActionImpl.class));
+ } else if ("Annotation".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getAnnotations().
+ add(jp.readValueAs( AnnotationImpl.class));
+ } else if ("Function".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).getFunctions().
+ add(jp.readValueAs( FunctionImpl.class));
+ } else if ("TypeDefinition".equals(jp.getCurrentName())) {
+ jp.nextToken();
+ ((org.apache.olingo.client.core.edm.xml.v4.SchemaImpl) schema).
+ getTypeDefinitions().add(jp.readValueAs( TypeDefinitionImpl.class));
+ }
+ }
+ }
+
+ return schema;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsDeserializer.java
index b1e7624..a8a88eb 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AnnotationsDeserializer.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class AnnotationsDeserializer extends AbstractEdmDeserializer<AnnotationsImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationDeserializer.java
index 7031453..c1d422d 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationDeserializer.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class AssociationDeserializer extends AbstractEdmDeserializer<AssociationImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetDeserializer.java
index 1f74893..f7268c2 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/AssociationSetDeserializer.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class AssociationSetDeserializer extends AbstractEdmDeserializer<AssociationSetImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportDeserializer.java
index e0539f5..3b7c4c7 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/FunctionImportDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class FunctionImportDeserializer extends AbstractEdmDeserializer<FunctionImportImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java
index 7212767..4bd4e1a 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/ReferentialConstraintRoleDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.olingo.client.core.edm.xml.PropertyRefImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class ReferentialConstraintRoleDeserializer extends AbstractEdmDeserializer<ReferentialConstraintRoleImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationDeserializer.java
index e111a3c..fd2aac3 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v3/TypeAnnotationDeserializer.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class TypeAnnotationDeserializer extends AbstractEdmDeserializer<TypeAnnotationImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionDeserializer.java
index e3d0b6a..fd0c214 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ActionDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class ActionDeserializer extends AbstractEdmDeserializer<ActionImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationDeserializer.java
index a12b396..129926d 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.olingo.client.core.edm.xml.v4.annotation.DynExprConstructImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class AnnotationDeserializer extends AbstractEdmDeserializer<AnnotationImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsDeserializer.java
index 9ff511b..6c8a4f6 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/AnnotationsDeserializer.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class AnnotationsDeserializer extends AbstractEdmDeserializer<AnnotationsImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionDeserializer.java
index cd55f1d..e1e0707 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/FunctionDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class FunctionDeserializer extends AbstractEdmDeserializer<FunctionImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyDeserializer.java
index d864361..8ed9669 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/NavigationPropertyDeserializer.java
@@ -19,7 +19,7 @@
package org.apache.olingo.client.core.edm.xml.v4;
import org.apache.olingo.client.core.edm.xml.OnDeleteImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceDeserializer.java
index 1b9f971..94f1ed7 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReferenceDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import java.net.URI;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class ReferenceDeserializer extends AbstractEdmDeserializer<ReferenceImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeDeserializer.java
index 24ef200..85ecc6c 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/ReturnTypeDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class ReturnTypeDeserializer extends AbstractEdmDeserializer<ReturnTypeImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonDeserializer.java
index cfd4324..d79bd22 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/SingletonDeserializer.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class SingletonDeserializer extends AbstractEdmDeserializer<SingletonImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java
index 4e3d89b..feb85e5 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TermDeserializer.java
@@ -28,7 +28,7 @@ import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.edm.xml.v4.CSDLElement;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class TermDeserializer extends AbstractEdmDeserializer<TermImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
index c270cae..8fe9025 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/TypeDefinitionDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.commons.lang3.BooleanUtils;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class TypeDefinitionDeserializer extends AbstractEdmDeserializer<TypeDefinitionImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
index 68aec7d..56251a3 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/ApplyDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class ApplyDeserializer extends AbstractEdmDeserializer<Apply> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java
index d2ba56c..25ea594 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CastDeserializer.java
@@ -27,7 +27,7 @@ import java.io.IOException;
import java.math.BigInteger;
import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class CastDeserializer extends AbstractEdmDeserializer<Cast> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
index 52ad3c1..8ef4018 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/CollectionDeserializer.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class CollectionDeserializer extends AbstractEdmDeserializer<Collection> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
index b7b7c66..59266a5 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/DynExprConstructDeserializer.java
@@ -28,7 +28,7 @@ import java.io.IOException;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.ClassUtils;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class DynExprConstructDeserializer extends AbstractEdmDeserializer<DynExprConstructImpl> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
index a929563..160ce63 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/IsOfDeserializer.java
@@ -27,7 +27,7 @@ import java.io.IOException;
import java.math.BigInteger;
import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class IsOfDeserializer extends AbstractEdmDeserializer<IsOf> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
index 7f3615f..df3f747 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/LabeledElementDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class LabeledElementDeserializer extends AbstractEdmDeserializer<LabeledElement> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java
index 2bdb288..36c6791 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/NullDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class NullDeserializer extends AbstractEdmDeserializer<Null> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java
index a329658..6841c6e 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/PropertyValueDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class PropertyValueDeserializer extends AbstractEdmDeserializer<PropertyValue> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/RecordDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/RecordDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/RecordDeserializer.java
index 32ae5ba..279eb8c 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/RecordDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/RecordDeserializer.java
@@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
import org.apache.olingo.client.core.edm.xml.v4.AnnotationImpl;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class RecordDeserializer extends AbstractEdmDeserializer<Record> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java
index 804a08d..e2fcfbb 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/xml/v4/annotation/UrlRefDeserializer.java
@@ -25,7 +25,7 @@ import com.fasterxml.jackson.databind.DeserializationContext;
import java.io.IOException;
-import org.apache.olingo.client.core.op.AbstractEdmDeserializer;
+import org.apache.olingo.client.core.edm.xml.AbstractEdmDeserializer;
public class UrlRefDeserializer extends AbstractEdmDeserializer<UrlRef> {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractEdmDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractEdmDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractEdmDeserializer.java
deleted file mode 100644
index ac00cf3..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/AbstractEdmDeserializer.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.op;
-
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.JsonDeserializer;
-import com.fasterxml.jackson.dataformat.xml.deser.FromXmlParser;
-
-import java.io.IOException;
-
-import org.apache.olingo.client.api.CommonODataClient;
-import org.apache.olingo.client.core.edm.xml.v4.ReturnTypeImpl;
-import org.apache.olingo.client.core.edm.xml.v4.annotation.ConstExprConstructImpl;
-
-public abstract class AbstractEdmDeserializer<T> extends JsonDeserializer<T> {
-
- protected CommonODataClient client;
-
- protected boolean isAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
- return ConstExprConstructImpl.Type.fromString(jp.getCurrentName()) != null;
- }
-
- protected ConstExprConstructImpl parseAnnotationConstExprConstruct(final JsonParser jp) throws IOException {
- final ConstExprConstructImpl constExpr = new ConstExprConstructImpl();
- constExpr.setType(ConstExprConstructImpl.Type.fromString(jp.getCurrentName()));
- constExpr.setValue(jp.nextTextValue());
- return constExpr;
- }
-
- protected ReturnTypeImpl parseReturnType(final JsonParser jp, final String elementName) throws IOException {
- ReturnTypeImpl returnType;
- if (elementName.equals(((FromXmlParser) jp).getStaxReader().getLocalName())) {
- returnType = new ReturnTypeImpl();
- returnType.setType(jp.nextTextValue());
- } else {
- jp.nextToken();
- returnType = jp.readValueAs( ReturnTypeImpl.class);
- }
- return returnType;
- }
-
- protected abstract T doDeserialize(JsonParser jp, DeserializationContext ctxt)
- throws IOException, JsonProcessingException;
-
- @Override
- public T deserialize(final JsonParser jp, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
-
- client = (CommonODataClient) ctxt.findInjectableValue(CommonODataClient.class.getName(), null, null);
- return doDeserialize(jp, ctxt);
- }
-
-}