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:37 UTC
[25/52] [abbrv] Moving some classes to more appropriate packages
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/9b3e4ebf/lib/client-core/src/main/java/org/apache/olingo/client/core/op/ComplexTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/ComplexTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/ComplexTypeDeserializer.java
deleted file mode 100644
index 754bad4..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/ComplexTypeDeserializer.java
+++ /dev/null
@@ -1,83 +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.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.AbstractComplexType;
-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/op/EntityContainerDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntityContainerDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntityContainerDeserializer.java
deleted file mode 100644
index 131ba9e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntityContainerDeserializer.java
+++ /dev/null
@@ -1,102 +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.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.AbstractEntityContainer;
-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/op/EntityKeyDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntityKeyDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntityKeyDeserializer.java
deleted file mode 100644
index 8462f4a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntityKeyDeserializer.java
+++ /dev/null
@@ -1,50 +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.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-
-import java.io.IOException;
-
-import org.apache.olingo.client.core.edm.xml.EntityKeyImpl;
-import org.apache.olingo.client.core.edm.xml.PropertyRefImpl;
-
-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/op/EntitySetDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntitySetDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntitySetDeserializer.java
deleted file mode 100644
index d11206e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntitySetDeserializer.java
+++ /dev/null
@@ -1,70 +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.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.AbstractEntitySet;
-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/op/EntityTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntityTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntityTypeDeserializer.java
deleted file mode 100644
index b2775e5..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EntityTypeDeserializer.java
+++ /dev/null
@@ -1,92 +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.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.AbstractEntityType;
-import org.apache.olingo.client.core.edm.xml.EntityKeyImpl;
-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/op/EnumTypeDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EnumTypeDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EnumTypeDeserializer.java
deleted file mode 100644
index f2b891c..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/EnumTypeDeserializer.java
+++ /dev/null
@@ -1,73 +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.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.AbstractEnumType;
-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/op/SchemaDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/SchemaDeserializer.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/SchemaDeserializer.java
deleted file mode 100644
index 47eb195..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/SchemaDeserializer.java
+++ /dev/null
@@ -1,149 +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.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationContext;
-
-import java.io.IOException;
-
-import org.apache.olingo.client.core.edm.xml.AbstractSchema;
-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;
- }
-}