olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chr...@apache.org
Subject [03/10] olingo-odata4 git commit: [OLINGO-690] ODataSerializer and ODataDeserializer are created by contentType instead of ODataFormat
Date Wed, 17 Jun 2015 15:55:27 GMT
[OLINGO-690] ODataSerializer and ODataDeserializer are created by contentType instead of ODataFormat


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

Branch: refs/heads/IEE754Compatible
Commit: 0043bd9c2e347ce42794755f153d34b8f810b5a1
Parents: 974abcb
Author: Christian Holzer <c.holzer@sap.com>
Authored: Tue Jun 9 15:54:37 2015 +0200
Committer: Christian Holzer <c.holzer@sap.com>
Committed: Wed Jun 17 17:48:13 2015 +0200

----------------------------------------------------------------------
 .../olingo/commons/api/format/ContentType.java  |   5 +-
 .../org/apache/olingo/server/api/OData.java     |  10 +-
 .../server/api/processor/DefaultProcessor.java  |   7 +-
 .../serializer/ComplexSerializerOptions.java    |  12 --
 .../EntityCollectionSerializerOptions.java      |  12 --
 .../api/serializer/EntitySerializerOptions.java |  12 --
 .../serializer/PrimitiveSerializerOptions.java  |  12 --
 .../ReferenceCollectionSerializerOptions.java   |  12 --
 .../apache/olingo/server/core/ErrorHandler.java |   3 +-
 .../olingo/server/core/ServiceRequest.java      |   3 +-
 .../server/core/requests/DataRequest.java       |  11 +-
 .../server/core/responses/PropertyResponse.java |   4 +-
 .../core/responses/ServiceDocumentResponse.java |   2 +-
 .../olingo/server/example/TripPinDataModel.java |   3 +-
 .../olingo/server/core/ContentNegotiator.java   |   6 +-
 .../apache/olingo/server/core/ODataImpl.java    |  13 +-
 .../json/ODataJsonDeserializer.java             |   5 +-
 .../serializer/json/ODataJsonSerializer.java    | 121 +++++++++----------
 .../json/ODataJsonDeserializerBasicTest.java    |  26 ++--
 .../json/ODataJsonSerializerTest.java           |   2 +-
 .../json/ServerErrorSerializerTest.java         |   2 +-
 .../xml/MetadataDocumentXmlSerializerTest.java  |   2 +-
 .../processor/TechnicalActionProcessor.java     |  43 +++----
 .../processor/TechnicalEntityProcessor.java     |  58 ++++-----
 .../TechnicalPrimitiveComplexProcessor.java     |  14 +--
 .../json/AbstractODataDeserializerTest.java     |   4 +-
 .../json/ODataDeserializerDeepInsertTest.java   |  24 ++--
 .../ODataDeserializerEntityCollectionTest.java  |  31 +++--
 ...ataJsonDeserializerActionParametersTest.java |   5 +-
 .../json/ODataJsonDeserializerEntityTest.java   | 120 +++++++++---------
 .../json/ODataJsonSerializerTest.java           |  49 ++++----
 .../serializer/json/ServiceDocumentTest.java    |   4 +-
 .../serializer/xml/MetadataDocumentTest.java    |   2 +-
 .../server/sample/processor/CarsProcessor.java  |   6 +-
 34 files changed, 279 insertions(+), 366 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/ContentType.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/ContentType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/ContentType.java
index 6949538..6ab29b6 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/ContentType.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/format/ContentType.java
@@ -74,9 +74,8 @@ public final class ContentType {
 
   public static final ContentType MULTIPART_FORM_DATA = new ContentType(MULTIPART, "form-data", null);
 
-  public static final String PARAMETER_CHARSET_UTF8 = "charset=utf-8";
-  public static final String PARAMETER_IEEE754_COMPATIBLE = "IEEE754Compatible=true";
-  public static final String PARAMETER_IEEE754_COMPATIBLE_FALSE = "IEEE754Compatible=false";
+  public static final String PARAMETER_CHARSET= "charset";
+  public static final String PARAMETER_IEEE754_COMPATIBLE = "IEEE754Compatible";
   
   private final String type;
   private final String subtype;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
index 3a9c1cb..8599982 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/OData.java
@@ -24,7 +24,7 @@ import org.apache.olingo.commons.api.ODataRuntimeException;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider;
-import org.apache.olingo.commons.api.format.ODataFormat;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.server.api.deserializer.DeserializerException;
 import org.apache.olingo.server.api.deserializer.FixedFormatDeserializer;
 import org.apache.olingo.server.api.deserializer.ODataDeserializer;
@@ -66,9 +66,9 @@ public abstract class OData {
    * Creates a new serializer object for rendering content in the specified format.
    * Serializers are used in Processor implementations.
    *
-   * @param format any format supported by Olingo (XML, JSON ...)
+   * @param contentType any format supported by Olingo (XML, JSON ...)
    */
-  public abstract ODataSerializer createSerializer(ODataFormat format) throws SerializerException;
+  public abstract ODataSerializer createSerializer(ContentType contentType) throws SerializerException;
 
   /**
    * Creates a new serializer object for rendering content in a fixed format, e.g., for binary output.
@@ -119,9 +119,9 @@ public abstract class OData {
    * Creates a new deserializer object for reading content in the specified format.
    * Deserializer are used in Processor implementations.
    *
-   * @param format any format supported by Olingo (XML, JSON ...)
+   * @param format any content type supported by Olingo (XML, JSON ...)
    */
-  public abstract ODataDeserializer createDeserializer(ODataFormat format) throws DeserializerException;
+  public abstract ODataDeserializer createDeserializer(ContentType contentType) throws DeserializerException;
 
   /**
    * Creates a primitive-type instance.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java
index c209764..c8481c5 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/processor/DefaultProcessor.java
@@ -21,7 +21,6 @@ package org.apache.olingo.server.api.processor;
 import java.io.ByteArrayInputStream;
 
 import org.apache.olingo.commons.api.format.ContentType;
-import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.api.http.HttpHeader;
 import org.apache.olingo.commons.api.http.HttpStatusCode;
 import org.apache.olingo.server.api.OData;
@@ -72,7 +71,7 @@ public class DefaultProcessor implements MetadataProcessor, ServiceDocumentProce
     if (isNotModified) {
       response.setStatusCode(HttpStatusCode.NOT_MODIFIED.getStatusCode());
     } else {
-      ODataSerializer serializer = odata.createSerializer(ODataFormat.fromContentType(requestedContentType));
+      ODataSerializer serializer = odata.createSerializer(requestedContentType);
       response.setContent(serializer.serviceDocument(serviceMetadata, null).getContent());
       response.setStatusCode(HttpStatusCode.OK.getStatusCode());
       response.setHeader(HttpHeader.CONTENT_TYPE, requestedContentType.toContentTypeString());
@@ -97,7 +96,7 @@ public class DefaultProcessor implements MetadataProcessor, ServiceDocumentProce
     if (isNotModified) {
       response.setStatusCode(HttpStatusCode.NOT_MODIFIED.getStatusCode());
     } else {
-      ODataSerializer serializer = odata.createSerializer(ODataFormat.fromContentType(requestedContentType));
+      ODataSerializer serializer = odata.createSerializer(requestedContentType);
       response.setContent(serializer.metadataDocument(serviceMetadata).getContent());
       response.setStatusCode(HttpStatusCode.OK.getStatusCode());
       response.setHeader(HttpHeader.CONTENT_TYPE, requestedContentType.toContentTypeString());
@@ -109,7 +108,7 @@ public class DefaultProcessor implements MetadataProcessor, ServiceDocumentProce
       final ODataServerError serverError,
       final ContentType requestedContentType) {
     try {
-      ODataSerializer serializer = odata.createSerializer(ODataFormat.fromContentType(requestedContentType));
+      ODataSerializer serializer = odata.createSerializer(requestedContentType);
       response.setContent(serializer.error(serverError).getContent());
       response.setStatusCode(serverError.getStatusCode());
       response.setHeader(HttpHeader.CONTENT_TYPE, requestedContentType.toContentTypeString());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java
index 79e4400..99c6926 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ComplexSerializerOptions.java
@@ -28,7 +28,6 @@ public class ComplexSerializerOptions {
   private ContextURL contextURL;
   private ExpandOption expand;
   private SelectOption select;
-  private boolean isIEEE754Compatible;
   
   /** Gets the {@link ContextURL}. */
   public ContextURL getContextURL() {
@@ -45,11 +44,6 @@ public class ComplexSerializerOptions {
     return select;
   }
   
-  /** Serialize Edm.Int64 and Edm.Durration as strings **/
-  public boolean isIEEE754Compatible() {
-    return isIEEE754Compatible;
-  }
-  
   private ComplexSerializerOptions() {}
 
   /** Initializes the options builder. */
@@ -84,12 +78,6 @@ public class ComplexSerializerOptions {
       return this;
     }
     
-    /** Set to serialize Edm.Int64 and Edm.Decimal as strings */
-    public Builder setIEEE754Compatible(final boolean isIEEE754Compatible) {
-      options.isIEEE754Compatible = isIEEE754Compatible;
-      return this;
-    }
-    
     /** Builds the OData serializer options. */
     public ComplexSerializerOptions build() {
       return options;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java
index 996a086..d81530f 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntityCollectionSerializerOptions.java
@@ -31,7 +31,6 @@ public class EntityCollectionSerializerOptions {
   private ExpandOption expand;
   private SelectOption select;
   private boolean onlyReferences;
-  private boolean isIEEE754Compatible;
   
   /** Gets the {@link ContextURL}. */
   public ContextURL getContextURL() {
@@ -58,11 +57,6 @@ public class EntityCollectionSerializerOptions {
     return onlyReferences;
   }
 
-  /** Serialize Edm.Int64 and Edm.Durration as strings **/
-  public boolean isIEEE754Compatible() {
-    return isIEEE754Compatible;
-  }
-  
   /** Initializes the options builder. */
   public static Builder with() {
     return new Builder();
@@ -107,12 +101,6 @@ public class EntityCollectionSerializerOptions {
       return this;
     }
     
-    /** Set to serialize Edm.Int64 and Edm.Decimal as strings */
-    public Builder setIEEE754Compatible(final boolean isIEEE754Compatible) {
-      options.isIEEE754Compatible = isIEEE754Compatible;
-      return this;
-    }
-    
     /** Builds the OData serializer options. */
     public EntityCollectionSerializerOptions build() {
       return options;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java
index 208bcdd..db73c43 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/EntitySerializerOptions.java
@@ -28,7 +28,6 @@ public class EntitySerializerOptions {
   private ExpandOption expand;
   private SelectOption select;
   private boolean onlyReferences;
-  private boolean isIEEE754Compatible;
   
   /** Gets the {@link ContextURL}. */
   public ContextURL getContextURL() {
@@ -50,11 +49,6 @@ public class EntitySerializerOptions {
     return onlyReferences;
   }
 
-  /** Serialize Edm.Int64 and Edm.Durration as strings **/
-  public boolean isIEEE754Compatible() {
-    return isIEEE754Compatible;
-  }
-  
   private EntitySerializerOptions() {}
 
   /** Initializes the options builder. */
@@ -95,12 +89,6 @@ public class EntitySerializerOptions {
       return this;
     }
     
-    /** Set to serialize Edm.Int64 and Edm.Decimal as strings */
-    public Builder setIEEE754Compatible(final boolean isIEEE754Compatible) {
-      options.isIEEE754Compatible = isIEEE754Compatible;
-      return this;
-    }
-    
     /** Builds the OData serializer options. */
     public EntitySerializerOptions build() {
       return options;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java
index 2b586e1..aa88b66 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/PrimitiveSerializerOptions.java
@@ -30,7 +30,6 @@ public class PrimitiveSerializerOptions {
   private Integer precision;
   private Integer scale;
   private Boolean isUnicode;
-  private boolean isIEEE754Compatible;
   
   /** Gets the {@link ContextURL}. */
   public ContextURL getContextURL() {
@@ -62,11 +61,6 @@ public class PrimitiveSerializerOptions {
     return isUnicode;
   }
   
-  /** Serialize Edm.Int64 and Edm.Durration as strings **/
-  public boolean isIEEE754Compatible() {
-    return isIEEE754Compatible;
-  }
-  
   private PrimitiveSerializerOptions() {}
 
   /** Initializes the options builder. */
@@ -119,12 +113,6 @@ public class PrimitiveSerializerOptions {
       return this;
     }
     
-    /** Set to serialize Edm.Int64 and Edm.Decimal as strings */
-    public Builder setIEEE754Compatible(final boolean isIEEE754Compatible) {
-      options.isIEEE754Compatible = isIEEE754Compatible;
-      return this;
-    }
-    
     /** Sets all facets from an EDM property. */
     public Builder facetsFrom(final EdmProperty property) {
       options.isNullable = property.isNullable();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java
----------------------------------------------------------------------
diff --git a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java
index 4d88895..b889595 100644
--- a/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java
+++ b/lib/server-api/src/main/java/org/apache/olingo/server/api/serializer/ReferenceCollectionSerializerOptions.java
@@ -24,7 +24,6 @@ import org.apache.olingo.server.api.uri.queryoption.CountOption;
 /** Options for the OData serializer. */
 public class ReferenceCollectionSerializerOptions {
   private ContextURL contextURL;
-  private boolean isIEEE754Compatible;
   private CountOption count;
   
   /** Gets the {@link ContextURL}. */
@@ -37,11 +36,6 @@ public class ReferenceCollectionSerializerOptions {
     return count;
   }
   
-  /** Serialize Edm.Int64 and Edm.Durration as strings **/
-  public boolean isIEEE754Compatible() {
-    return isIEEE754Compatible;
-  }
-  
   private ReferenceCollectionSerializerOptions() {}
 
   /** Initializes the options builder. */
@@ -69,12 +63,6 @@ public class ReferenceCollectionSerializerOptions {
       return this;
     }
     
-    /** Set to serialize Edm.Int64 and Edm.Decimal as strings */
-    public Builder setIEEE754Compatible(final boolean isIEEE754Compatible) {
-      options.isIEEE754Compatible = isIEEE754Compatible;
-      return this;
-    }
-
     /** Builds the OData serializer options. */
     public ReferenceCollectionSerializerOptions build() {
       return options;

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ErrorHandler.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ErrorHandler.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ErrorHandler.java
index b83d383..6584262 100644
--- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ErrorHandler.java
+++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ErrorHandler.java
@@ -106,8 +106,7 @@ public class ErrorHandler {
   void processError(ODataResponse response, ODataServerError serverError,
       ContentType requestedContentType) {
     try {
-      ODataSerializer serializer = this.odata.createSerializer(ODataFormat
-          .fromContentType(requestedContentType));
+      ODataSerializer serializer = this.odata.createSerializer(requestedContentType);
       response.setContent(serializer.error(serverError).getContent());
       response.setStatusCode(serverError.getStatusCode());
       response.setHeader(HttpHeader.CONTENT_TYPE, requestedContentType.toContentTypeString());

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ServiceRequest.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ServiceRequest.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ServiceRequest.java
index 53db4c8..c0428d4 100644
--- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ServiceRequest.java
+++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/ServiceRequest.java
@@ -191,8 +191,7 @@ public abstract class ServiceRequest {
 
   public ODataSerializer getSerializer() throws ContentNegotiatorException,
       SerializerException {
-    ODataFormat format = ODataFormat.fromContentType(getResponseContentType());
-    return this.odata.createSerializer(format);
+    return this.odata.createSerializer(getResponseContentType());
   }
 
   public Map<String, String> getPreferences(){

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/requests/DataRequest.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/requests/DataRequest.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/requests/DataRequest.java
index 0d98de5..e1dddb8 100644
--- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/requests/DataRequest.java
+++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/requests/DataRequest.java
@@ -331,8 +331,7 @@ public class DataRequest extends ServiceRequest {
     }
 
     private Entity getEntityFromClient() throws DeserializerException {
-      ODataDeserializer deserializer = odata.createDeserializer(ODataFormat
-          .fromContentType(getRequestContentType()));
+      ODataDeserializer deserializer = odata.createDeserializer(getRequestContentType());
       return deserializer.entity(getODataRequest().getBody(), getEntitySet().getEntityType()).getEntity();
     }
 
@@ -441,7 +440,7 @@ public class DataRequest extends ServiceRequest {
             handler.deleteReference(DataRequest.this, new URI(id), getETag(), new NoContentResponse(
                 getServiceMetaData(), response));
           } catch (URISyntaxException e) {
-            throw new DeserializerException("failed to read $id", e, MessageKeys.UNKNOWN_CONTENT);
+            throw new DeserializerException("failed to read $id", e, MessageKeys.UNKOWN_CONTENT);
           }
         }
       } else if (isPUT()) {
@@ -459,8 +458,7 @@ public class DataRequest extends ServiceRequest {
     // /odata-json-format-v4.0-errata02-os-complete.html#_Toc403940643
     // The below code reads as property and converts to an URI
     private List<URI> getPayload() throws DeserializerException {
-      ODataDeserializer deserializer = odata.createDeserializer(ODataFormat
-          .fromContentType(getRequestContentType()));
+      ODataDeserializer deserializer = odata.createDeserializer(getRequestContentType());
       return deserializer.entityReferences(getODataRequest().getBody()).getEntityReferences();
     }
 
@@ -700,8 +698,7 @@ public class DataRequest extends ServiceRequest {
 
   private org.apache.olingo.commons.api.data.Property getPropertyValueFromClient(
       EdmProperty edmProperty) throws DeserializerException {
-    ODataDeserializer deserializer = odata.createDeserializer(ODataFormat
-        .fromContentType(getRequestContentType()));
+    ODataDeserializer deserializer = odata.createDeserializer(getRequestContentType());
     return deserializer.property(getODataRequest().getBody(), edmProperty).getProperty();
   }
   

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/PropertyResponse.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/PropertyResponse.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/PropertyResponse.java
index 0cf4ff2..42a275d 100644
--- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/PropertyResponse.java
+++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/PropertyResponse.java
@@ -121,10 +121,10 @@ public class PropertyResponse extends ServiceResponse {
       throws SerializerException {
     if(this.collection) {
       this.response.setContent(
-          this.serializer.primitiveCollection(metadata, type, property, this.primitiveOptions).getContent());
+          this.serializer.primitiveCollection(type, property, this.primitiveOptions).getContent());
     } else {
       this.response.setContent(
-          this.serializer.primitive(metadata, type, property, this.primitiveOptions).getContent());
+          this.serializer.primitive(type, property, this.primitiveOptions).getContent());
     }
     writeOK(this.responseContentType.toContentTypeString());
     close();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/ServiceDocumentResponse.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/ServiceDocumentResponse.java b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/ServiceDocumentResponse.java
index 407510d..ebb1575 100644
--- a/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/ServiceDocumentResponse.java
+++ b/lib/server-core-ext/src/main/java/org/apache/olingo/server/core/responses/ServiceDocumentResponse.java
@@ -51,7 +51,7 @@ public class ServiceDocumentResponse extends ServiceResponse {
   public void writeServiceDocument(String serviceRoot)
       throws ODataLibraryException {
     assert (!isClosed());
-    this.response.setContent(this.serializer.serviceDocument(metadata, serviceRoot).getContent());
+    this.response.setContent(this.serializer.serviceDocument(metadata.getEdm(), serviceRoot).getContent());
     writeOK(this.responseContentType.toContentTypeString());
     close();
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java
----------------------------------------------------------------------
diff --git a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java
index 290f38d..b37c2ae 100644
--- a/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java
+++ b/lib/server-core-ext/src/test/java/org/apache/olingo/server/example/TripPinDataModel.java
@@ -45,6 +45,7 @@ import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
 import org.apache.olingo.commons.api.edm.constants.EdmTypeKind;
+import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.server.api.ODataApplicationException;
 import org.apache.olingo.server.api.ServiceMetadata;
 import org.apache.olingo.server.api.deserializer.DeserializerException;
@@ -115,7 +116,7 @@ public class TripPinDataModel {
 
   private EntityCollection loadEnities(String entitySetName, EdmEntityType type) {
     try {
-      ODataJsonDeserializer deserializer = new ODataJsonDeserializer();
+      ODataJsonDeserializer deserializer = new ODataJsonDeserializer(ODataFormat.JSON.getContentType());
 
       EntityCollection set = deserializer.entityCollection(new FileInputStream(new File(
           "src/test/resources/" + entitySetName.toLowerCase() + ".json")), type).getEntityCollection();

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java
index e127dcd..db0eef1 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ContentNegotiator.java
@@ -128,7 +128,7 @@ public class ContentNegotiator {
         if (acceptedType.getParameters().containsKey("charset")) {
           final String value = acceptedType.getParameters().get("charset");
           if ("utf8".equalsIgnoreCase(value) || "utf-8".equalsIgnoreCase(value)) {
-            contentType = ContentType.create(contentType, ContentType.PARAMETER_CHARSET_UTF8);
+            contentType = ContentType.create(contentType, ContentType.PARAMETER_CHARSET + "=utf-8");
           } else {
             throw new IllegalArgumentException("charset not supported: " + acceptedType);
           }
@@ -137,9 +137,9 @@ public class ContentNegotiator {
         if(acceptedType.getParameters().containsKey("ieee754compatible")) {
           final String value = acceptedType.getParameters().get("ieee754compatible");
           if("true".equalsIgnoreCase(value)) {
-            contentType = ContentType.create(contentType, ContentType.PARAMETER_IEEE754_COMPATIBLE);
+            contentType = ContentType.create(contentType, ContentType.PARAMETER_IEEE754_COMPATIBLE + "=true");
           } else if("false".equalsIgnoreCase(value)) {
-            contentType = ContentType.create(contentType, ContentType.PARAMETER_IEEE754_COMPATIBLE_FALSE);
+            contentType = ContentType.create(contentType, ContentType.PARAMETER_IEEE754_COMPATIBLE + "=false");
           } else {
             throw new IllegalArgumentException("Invalid IEEE754Compatible value " + acceptedType);
           }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
index 57cceaf..a134887 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataImpl.java
@@ -23,6 +23,7 @@ import java.util.List;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveType;
 import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.provider.CsdlEdmProvider;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
 import org.apache.olingo.server.api.OData;
@@ -49,13 +50,15 @@ import org.apache.olingo.server.core.uri.UriHelperImpl;
 public class ODataImpl extends OData {
 
   @Override
-  public ODataSerializer createSerializer(final ODataFormat format) throws SerializerException {
+  public ODataSerializer createSerializer(final ContentType contentType) throws SerializerException {
+    final ODataFormat format = ODataFormat.fromContentType(contentType);
     ODataSerializer serializer;
+
     switch (format) {
     case JSON:
     case JSON_NO_METADATA:
     case JSON_FULL_METADATA:
-      serializer = new ODataJsonSerializer(format);
+      serializer = new ODataJsonSerializer(contentType);
       break;
     case XML:
       serializer = new ODataXmlSerializerImpl();
@@ -101,13 +104,15 @@ public class ODataImpl extends OData {
   }
 
   @Override
-  public ODataDeserializer createDeserializer(final ODataFormat format) throws DeserializerException {
+  public ODataDeserializer createDeserializer(final ContentType contentType) throws DeserializerException {
+    final ODataFormat format = ODataFormat.fromContentType(contentType);
     ODataDeserializer deserializer;
+
     switch (format) {
     case JSON:
     case JSON_NO_METADATA:
     case JSON_FULL_METADATA:
-      deserializer = new ODataJsonDeserializer();
+      deserializer = new ODataJsonDeserializer(contentType);
       break;
     case XML:
       // We do not support XML deserialization right now so this must lead to an error.

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
index a03206b..67c8875 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
@@ -50,13 +50,13 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.EdmType;
 import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.server.api.deserializer.DeserializerException;
 import org.apache.olingo.server.api.deserializer.DeserializerResult;
 import org.apache.olingo.server.api.deserializer.ODataDeserializer;
 import org.apache.olingo.server.core.deserializer.DeserializerResultImpl;
 import org.apache.olingo.server.core.deserializer.helper.ExpandTreeBuilder;
 import org.apache.olingo.server.core.deserializer.helper.ExpandTreeBuilderImpl;
-
 import com.fasterxml.jackson.core.JsonFactory;
 import com.fasterxml.jackson.core.JsonParseException;
 import com.fasterxml.jackson.core.JsonParser;
@@ -73,6 +73,9 @@ public class ODataJsonDeserializer implements ODataDeserializer {
   private static final String ODATA_ANNOTATION_MARKER = "@";
   private static final String ODATA_CONTROL_INFORMATION_PREFIX = "@odata.";
 
+  public ODataJsonDeserializer(final ContentType contentType) {
+  }
+  
   @Override
   public DeserializerResult entityCollection(final InputStream stream, final EdmEntityType edmEntityType)
       throws DeserializerException {

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
index fddef6a..13c0fad 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java
@@ -41,6 +41,7 @@ import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
 import org.apache.olingo.commons.api.edm.EdmProperty;
 import org.apache.olingo.commons.api.edm.EdmStructuredType;
 import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.format.ContentType;
 import org.apache.olingo.commons.api.format.ODataFormat;
 import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
 import org.apache.olingo.server.api.ODataServerError;
@@ -75,9 +76,11 @@ public class ODataJsonSerializer implements ODataSerializer {
   private static final Logger log = LoggerFactory.getLogger(ODataJsonSerializer.class);
 
   private final ODataFormat format;
-
-  public ODataJsonSerializer(final ODataFormat format) {
-    this.format = format;
+  private final boolean isIEEE754Compatible;
+  
+  public ODataJsonSerializer(final ContentType contentType) {
+    this.isIEEE754Compatible = isODataIEEE754Compatible(contentType);
+    this.format = ODataFormat.fromContentType(contentType);
   }
 
   @Override
@@ -152,14 +155,14 @@ public class ODataJsonSerializer implements ODataSerializer {
 
       if (options != null && options.getCount() != null && options.getCount().getValue()
           && entitySet.getCount() != null) {
-        writeCount(entitySet, options == null ? false : options.isIEEE754Compatible(), json);
+        writeCount(entitySet, json);
       }
       json.writeFieldName(Constants.VALUE);
       if (options == null) {
-        writeEntitySet(metadata, entityType, entitySet, null, null, false, false, json);
+        writeEntitySet(metadata, entityType, entitySet, null, null, false, json);
       } else {
         writeEntitySet(metadata, entityType, entitySet,
-            options.getExpand(), options.getSelect(), options.onlyReferences(), options.isIEEE754Compatible(), json);
+            options.getExpand(), options.getSelect(), options.onlyReferences(), json);
       }
       if (entitySet.getNext() != null) {
         writeNextLink(entitySet, json);
@@ -182,8 +185,8 @@ public class ODataJsonSerializer implements ODataSerializer {
       writeEntity(metadata, entityType, entity, contextURL,
           options == null ? null : options.getExpand(),
           options == null ? null : options.getSelect(),
-          options == null ? false : options.onlyReferences(), 
-          options == null ? false : options.isIEEE754Compatible(), json);
+          options == null ? false : options.onlyReferences(),
+          json);
       json.close();
     } catch (final IOException e) {
       throw new SerializerException("An I/O exception occurred.", e,
@@ -213,7 +216,7 @@ public class ODataJsonSerializer implements ODataSerializer {
 
   protected void writeEntitySet(final ServiceMetadata metadata, final EdmEntityType entityType,
       final EntityCollection entitySet, final ExpandOption expand, final SelectOption select,
-      final boolean onlyReference, final boolean isIEEE754Compatible, final JsonGenerator json) throws IOException,
+      final boolean onlyReference, final JsonGenerator json) throws IOException,
       SerializerException {
     json.writeStartArray();
     for (final Entity entity : entitySet.getEntities()) {
@@ -222,7 +225,7 @@ public class ODataJsonSerializer implements ODataSerializer {
         json.writeStringField(Constants.JSON_ID, entity.getId().toASCIIString());
         json.writeEndObject();
       } else {
-        writeEntity(metadata, entityType, entity, null, expand, select, false, isIEEE754Compatible, json);
+        writeEntity(metadata, entityType, entity, null, expand, select, false, json);
       }
     }
     json.writeEndArray();
@@ -230,8 +233,8 @@ public class ODataJsonSerializer implements ODataSerializer {
 
   protected void writeEntity(final ServiceMetadata metadata, final EdmEntityType entityType,
       final Entity entity, final ContextURL contextURL, final ExpandOption expand,
-      final SelectOption select, final boolean onlyReference, final boolean isIEEE7854Compatible, 
-      final JsonGenerator json) throws IOException, SerializerException {
+      final SelectOption select, final boolean onlyReference, final JsonGenerator json) 
+          throws IOException, SerializerException {
     json.writeStartObject();
     if (format != ODataFormat.JSON_NO_METADATA) {
       if (contextURL != null) { // top-level entity
@@ -263,8 +266,8 @@ public class ODataJsonSerializer implements ODataSerializer {
       if (!resolvedType.equals(entityType)) {
         json.writeStringField(Constants.JSON_TYPE, "#" + entity.getType());
       }
-      writeProperties(resolvedType, entity.getProperties(), select, isIEEE7854Compatible, json);
-      writeNavigationProperties(metadata, resolvedType, entity, expand, isIEEE7854Compatible, json);
+      writeProperties(resolvedType, entity.getProperties(), select, json);
+      writeNavigationProperties(metadata, resolvedType, entity, expand, json);
       json.writeEndObject();
     }
   }
@@ -318,7 +321,7 @@ public class ODataJsonSerializer implements ODataSerializer {
   }
 
   protected void writeProperties(final EdmStructuredType type, final List<Property> properties,
-      final SelectOption select, final boolean isIEEE754Compatible, final JsonGenerator json) 
+      final SelectOption select, final JsonGenerator json) 
           throws IOException, SerializerException {
     final boolean all = ExpandSelectHelper.isAll(select);
     final Set<String> selected = all ? null :
@@ -329,14 +332,14 @@ public class ODataJsonSerializer implements ODataSerializer {
         final Property property = findProperty(propertyName, properties);
         final Set<List<String>> selectedPaths = all || edmProperty.isPrimitive() ? null :
             ExpandSelectHelper.getSelectedPaths(select.getSelectItems(), propertyName);
-        writeProperty(edmProperty, property, selectedPaths, isIEEE754Compatible, json);
+        writeProperty(edmProperty, property, selectedPaths, json);
       }
     }
   }
 
   protected void writeNavigationProperties(final ServiceMetadata metadata,
       final EdmStructuredType type, final Linked linked, final ExpandOption expand,
-      final boolean isIEEE754Compatible, final JsonGenerator json) throws SerializerException, IOException {
+      final JsonGenerator json) throws SerializerException, IOException {
     if (ExpandSelectHelper.hasExpand(expand)) {
       final boolean expandAll = ExpandSelectHelper.isExpandAll(expand);
       final Set<String> expanded = expandAll ? null :
@@ -353,18 +356,15 @@ public class ODataJsonSerializer implements ODataSerializer {
           }
           writeExpandedNavigationProperty(metadata, property, navigationLink,
               innerOptions == null ? null : innerOptions.getExpandOption(),
-              innerOptions == null ? null : innerOptions.getSelectOption(),
-              isIEEE754Compatible, json);
+              innerOptions == null ? null : innerOptions.getSelectOption(), json);
         }
       }
     }
   }
 
-  protected void writeExpandedNavigationProperty(final ServiceMetadata metadata,
-      final EdmNavigationProperty property, final Link navigationLink,
-      final ExpandOption innerExpand, final SelectOption innerSelect, final boolean isIEEE754Compatible, 
-      final JsonGenerator json)
-      throws IOException, SerializerException {
+  protected void writeExpandedNavigationProperty(final ServiceMetadata metadata, final EdmNavigationProperty property, 
+      final Link navigationLink, final ExpandOption innerExpand, final SelectOption innerSelect, 
+      final JsonGenerator json) throws IOException, SerializerException {
     json.writeFieldName(property.getName());
     if (property.isCollection()) {
       if (navigationLink == null || navigationLink.getInlineEntitySet() == null) {
@@ -372,20 +372,20 @@ public class ODataJsonSerializer implements ODataSerializer {
         json.writeEndArray();
       } else {
         writeEntitySet(metadata, property.getType(), navigationLink.getInlineEntitySet(), innerExpand,
-            innerSelect, false, isIEEE754Compatible, json);
+            innerSelect, false, json);
       }
     } else {
       if (navigationLink == null || navigationLink.getInlineEntity() == null) {
         json.writeNull();
       } else {
         writeEntity(metadata, property.getType(), navigationLink.getInlineEntity(), null,
-            innerExpand, innerSelect, false, isIEEE754Compatible, json);
+            innerExpand, innerSelect, false, json);
       }
     }
   }
 
   protected void writeProperty(final EdmProperty edmProperty, final Property property,
-      final Set<List<String>> selectedPaths, final boolean isIEEE754Compatible, final JsonGenerator json) 
+      final Set<List<String>> selectedPaths, final JsonGenerator json) 
           throws IOException, SerializerException {
     json.writeFieldName(edmProperty.getName());
     if (property == null || property.isNull()) {
@@ -396,38 +396,32 @@ public class ODataJsonSerializer implements ODataSerializer {
         json.writeNull();
       }
     } else {
-      writePropertyValue(edmProperty, property, selectedPaths, isIEEE754Compatible, json);
+      writePropertyValue(edmProperty, property, selectedPaths, json);
     }
   }
 
   private void writePropertyValue(final EdmProperty edmProperty,
-      final Property property, final Set<List<String>> selectedPaths,
-      final boolean isIEEE754Compatible, final JsonGenerator json) throws IOException, SerializerException {
+      final Property property, final Set<List<String>> selectedPaths, final JsonGenerator json) 
+          throws IOException, SerializerException {
     try {
       if (edmProperty.isPrimitive()) {
         if (edmProperty.isCollection()) {
           writePrimitiveCollection((EdmPrimitiveType) edmProperty.getType(), property,
               edmProperty.isNullable(), edmProperty.getMaxLength(),
-              edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode(),
-              isIEEE754Compatible,
-              json);
+              edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode(), json);
         } else {
           writePrimitive((EdmPrimitiveType) edmProperty.getType(), property,
               edmProperty.isNullable(), edmProperty.getMaxLength(),
-              edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode(),
-              isIEEE754Compatible, json);
+              edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode(), json);
         }
       } else if (edmProperty.isCollection()) {
-        writeComplexCollection((EdmComplexType) edmProperty.getType(), property, 
-                               selectedPaths, isIEEE754Compatible, json);
+        writeComplexCollection((EdmComplexType) edmProperty.getType(), property, selectedPaths, json);
       } else if (property.isComplex()) {
-        writeComplexValue((EdmComplexType) edmProperty.getType(), property.asComplex().getValue(),
-            selectedPaths, isIEEE754Compatible, json);
+        writeComplexValue((EdmComplexType) edmProperty.getType(), property.asComplex().getValue(), selectedPaths, json);
       } else if (property.isEnum()) {
         writePrimitive((EdmPrimitiveType) edmProperty.getType(), property,
             edmProperty.isNullable(), edmProperty.getMaxLength(),
-            edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode(),
-            isIEEE754Compatible, json);
+            edmProperty.getPrecision(), edmProperty.getScale(), edmProperty.isUnicode(), json);
       } else {
         throw new SerializerException("Property type not yet supported!",
             SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, edmProperty.getName());
@@ -441,14 +435,13 @@ public class ODataJsonSerializer implements ODataSerializer {
 
   private void writePrimitiveCollection(final EdmPrimitiveType type, final Property property,
       final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
-      final Boolean isUnicode,
-      final boolean isIEEE754Compatible, final JsonGenerator json) 
+      final Boolean isUnicode, final JsonGenerator json) 
           throws IOException, EdmPrimitiveTypeException, SerializerException {
     json.writeStartArray();
     for (Object value : property.asCollection()) {
       switch (property.getValueType()) {
       case COLLECTION_PRIMITIVE:
-        writePrimitiveValue(type, value, isNullable, maxLength, precision, scale, isUnicode, isIEEE754Compatible, json);
+        writePrimitiveValue(type, value, isNullable, maxLength, precision, scale, isUnicode, json);
         break;
       case COLLECTION_GEOSPATIAL:
         throw new SerializerException("Property type not yet supported!",
@@ -465,13 +458,13 @@ public class ODataJsonSerializer implements ODataSerializer {
   }
 
   private void writeComplexCollection(final EdmComplexType type, final Property property,
-      final Set<List<String>> selectedPaths, final boolean isIEEE754Compatible, final JsonGenerator json)
+      final Set<List<String>> selectedPaths, final JsonGenerator json)
       throws IOException, EdmPrimitiveTypeException, SerializerException {
     json.writeStartArray();
     for (Object value : property.asCollection()) {
       switch (property.getValueType()) {
       case COLLECTION_COMPLEX:
-        writeComplexValue(type, ((ComplexValue) value).getValue(), selectedPaths, isIEEE754Compatible, json);
+        writeComplexValue(type, ((ComplexValue) value).getValue(), selectedPaths, json);
         break;
       default:
         throw new SerializerException("Property type not yet supported!",
@@ -483,17 +476,17 @@ public class ODataJsonSerializer implements ODataSerializer {
 
   private void writePrimitive(final EdmPrimitiveType type, final Property property,
       final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
-      final Boolean isUnicode, final boolean isIEEE754Compatible, final JsonGenerator json)
+      final Boolean isUnicode, final JsonGenerator json)
       throws EdmPrimitiveTypeException, IOException, SerializerException {
     if (property.isPrimitive()) {
       writePrimitiveValue(type, property.asPrimitive(),
-          isNullable, maxLength, precision, scale, isUnicode, isIEEE754Compatible, json);
+          isNullable, maxLength, precision, scale, isUnicode, json);
     } else if (property.isGeospatial()) {
       throw new SerializerException("Property type not yet supported!",
           SerializerException.MessageKeys.UNSUPPORTED_PROPERTY_TYPE, property.getName());
     } else if (property.isEnum()) {
       writePrimitiveValue(type, property.asEnum(),
-          isNullable, maxLength, precision, scale, isUnicode, isIEEE754Compatible, json);
+          isNullable, maxLength, precision, scale, isUnicode, json);
     } else {
       throw new SerializerException("Inconsistent property type!",
           SerializerException.MessageKeys.INCONSISTENT_PROPERTY_TYPE, property.getName());
@@ -502,8 +495,7 @@ public class ODataJsonSerializer implements ODataSerializer {
 
   protected void writePrimitiveValue(final EdmPrimitiveType type, final Object primitiveValue,
       final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale,
-      final Boolean isUnicode,
-      final boolean isIEEE754Compatible, final JsonGenerator json) throws EdmPrimitiveTypeException, IOException {
+      final Boolean isUnicode, final JsonGenerator json) throws EdmPrimitiveTypeException, IOException {
     final String value = type.valueToString(primitiveValue,
         isNullable, maxLength, precision, scale, isUnicode);
     if (value == null) {
@@ -529,7 +521,7 @@ public class ODataJsonSerializer implements ODataSerializer {
   }
 
   protected void writeComplexValue(final EdmComplexType type, final List<Property> properties,
-      final Set<List<String>> selectedPaths, final boolean isIEEE754Compatible, final JsonGenerator json)
+      final Set<List<String>> selectedPaths, final JsonGenerator json)
       throws IOException, EdmPrimitiveTypeException, SerializerException {
     json.writeStartObject();
     for (final String propertyName : type.getPropertyNames()) {
@@ -537,7 +529,7 @@ public class ODataJsonSerializer implements ODataSerializer {
       if (selectedPaths == null || ExpandSelectHelper.isSelected(selectedPaths, propertyName)) {
         writeProperty((EdmProperty) type.getProperty(propertyName), property,
             selectedPaths == null ? null : ExpandSelectHelper.getReducedSelectedPaths(selectedPaths, propertyName),
-            isIEEE754Compatible, json);
+            json);
       }
     }
     json.writeEndObject();
@@ -570,7 +562,7 @@ public class ODataJsonSerializer implements ODataSerializer {
         json.writeFieldName(Constants.VALUE);
         writePrimitive(type, property,
             options.isNullable(), options.getMaxLength(), options.getPrecision(), options.getScale(),
-            options.isUnicode(), options.isIEEE754Compatible(), json);
+            options.isUnicode(), json);
       }
       json.writeEndObject();
       json.close();
@@ -603,10 +595,10 @@ public class ODataJsonSerializer implements ODataSerializer {
       }
       final List<Property> values =
           property.isNull() ? Collections.<Property> emptyList() : property.asComplex().getValue();
-      writeProperties(type, values, options == null ? null : options.getSelect(), options.isIEEE754Compatible(), json);
+      writeProperties(type, values, options == null ? null : options.getSelect(), json);
       if (!property.isNull() && property.isComplex()) {
         writeNavigationProperties(metadata, type, property.asComplex(),
-            options == null ? null : options.getExpand(), options.isIEEE754Compatible(), json);
+            options == null ? null : options.getExpand(), json);
       }
       json.writeEndObject();
       json.close();
@@ -632,7 +624,7 @@ public class ODataJsonSerializer implements ODataSerializer {
       json.writeFieldName(Constants.VALUE);
       writePrimitiveCollection(type, property,
           options.isNullable(), options.getMaxLength(), options.getPrecision(), options.getScale(),
-          options.isUnicode(), options.isIEEE754Compatible(), json);
+          options.isUnicode(), json);
       json.writeEndObject();
       json.close();
     } catch (final IOException e) {
@@ -659,7 +651,7 @@ public class ODataJsonSerializer implements ODataSerializer {
       }
       writeMetadataETag(metadata, json);
       json.writeFieldName(Constants.VALUE);
-      writeComplexCollection(type, property, null, options.isIEEE754Compatible(), json);
+      writeComplexCollection(type, property, null, json);
       json.writeEndObject();
       json.close();
     } catch (final IOException e) {
@@ -707,7 +699,7 @@ public class ODataJsonSerializer implements ODataSerializer {
       json.writeStringField(Constants.JSON_CONTEXT, ContextURLBuilder.create(contextURL).toASCIIString());
       writeMetadataETag(metadata, json);
       if(options != null && options.getCount() != null) {
-        writeCount(entityCollection, (options == null) ? false : options.isIEEE754Compatible(), json);
+        writeCount(entityCollection, json);
       }
       
       writeReferenceCollection(edmEntitySet, entityCollection, uriHelper,json);
@@ -749,9 +741,8 @@ public class ODataJsonSerializer implements ODataSerializer {
     json.writeEndObject();
   }
   
-  private void writeCount(final EntityCollection entitySet, final boolean isIEEE754Comptible, final JsonGenerator json) 
-      throws IOException {
-    if(isIEEE754Comptible) {
+  private void writeCount(final EntityCollection entitySet, final JsonGenerator json) throws IOException {
+    if(isIEEE754Compatible) {
       json.writeStringField(Constants.JSON_COUNT, entitySet.getCount().toString());
     } else {
       json.writeNumberField(Constants.JSON_COUNT, entitySet.getCount());
@@ -761,4 +752,10 @@ public class ODataJsonSerializer implements ODataSerializer {
   private void writeNextLink(final EntityCollection entitySet, JsonGenerator json) throws IOException {
     json.writeStringField(Constants.JSON_NEXT_LINK, entitySet.getNext().toASCIIString());
   }
+  
+  private boolean isODataIEEE754Compatible(final ContentType contentType) {
+    return contentType.getParameters().containsKey("ieee754compatible") 
+        && Boolean.TRUE.toString().toLowerCase().equals(
+            contentType.getParameters().get("ieee754compatible").toLowerCase());
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java
index 053dd07..da34caa 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializerBasicTest.java
@@ -33,18 +33,18 @@ import org.apache.olingo.server.api.deserializer.ODataDeserializer;
 import org.junit.Test;
 
 public class ODataJsonDeserializerBasicTest {
-
+  
   @Test
   public void checkSupportedJsonFormats() throws Exception {
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     assertNotNull(deserializer);
     deserializer = null;
 
-    deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON_NO_METADATA);
+    deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON_NO_METADATA.getContentType());
     assertNotNull(deserializer);
     deserializer = null;
 
-    deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON_FULL_METADATA);
+    deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON_FULL_METADATA.getContentType());
     assertNotNull(deserializer);
     deserializer = null;
   }
@@ -58,7 +58,7 @@ public class ODataJsonDeserializerBasicTest {
         "    { \"@odata.id\": \"Orders(10759)\" }\n" +
         "  ]\n" +
         "}";
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     List<URI> values = deserializer.entityReferences(new ByteArrayInputStream(payload.getBytes()))
         .getEntityReferences();
     assertEquals(2, values.size());
@@ -72,7 +72,7 @@ public class ODataJsonDeserializerBasicTest {
         "  \"@odata.context\": \"http://host/service/$metadata#$ref\",\n" +
         "  \"@odata.id\": \"Orders(10643)\"\n" +
         "}";
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     List<URI> values = deserializer.entityReferences(new ByteArrayInputStream(payload
         .getBytes())).getEntityReferences();
     assertEquals(1, values.size());
@@ -87,7 +87,7 @@ public class ODataJsonDeserializerBasicTest {
         + "}";
 
     InputStream stream = new ByteArrayInputStream(entityString.getBytes());
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     final List<URI> entityReferences = deserializer.entityReferences(stream).getEntityReferences();
     
     assertEquals(1, entityReferences.size());
@@ -105,7 +105,7 @@ public class ODataJsonDeserializerBasicTest {
         "}";
 
     InputStream stream = new ByteArrayInputStream(entityString.getBytes());
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     final List<URI> entityReferences = deserializer.entityReferences(stream).getEntityReferences();
     
     assertEquals(2, entityReferences.size());
@@ -124,7 +124,7 @@ public class ODataJsonDeserializerBasicTest {
         "}";
 
     InputStream stream = new ByteArrayInputStream(entityString.getBytes());
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     final List<URI> entityReferences = deserializer.entityReferences(stream).getEntityReferences();
     
     assertEquals(1, entityReferences.size());
@@ -142,7 +142,7 @@ public class ODataJsonDeserializerBasicTest {
         "}";
 
     InputStream stream = new ByteArrayInputStream(entityString.getBytes());
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     final List<URI> entityReferences = deserializer.entityReferences(stream).getEntityReferences();
     
     assertEquals(1, entityReferences.size());
@@ -158,7 +158,7 @@ public class ODataJsonDeserializerBasicTest {
         "}";
 
     InputStream stream = new ByteArrayInputStream(entityString.getBytes());
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     final List<URI> entityReferences = deserializer.entityReferences(stream).getEntityReferences();
     
     assertEquals(0, entityReferences.size());
@@ -173,7 +173,7 @@ public class ODataJsonDeserializerBasicTest {
     String entityString = "{ }";
 
     InputStream stream = new ByteArrayInputStream(entityString.getBytes());
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     final List<URI> entityReferences = deserializer.entityReferences(stream).getEntityReferences();
     
     assertEquals(0, entityReferences.size());
@@ -187,7 +187,7 @@ public class ODataJsonDeserializerBasicTest {
         "}";
 
     InputStream stream = new ByteArrayInputStream(entityString.getBytes());
-    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON);
+    ODataDeserializer deserializer = OData.newInstance().createDeserializer(ODataFormat.JSON.getContentType());
     deserializer.entityReferences(stream);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
index 08aed13..ad09ff9 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializerTest.java
@@ -44,7 +44,7 @@ public class ODataJsonSerializerTest {
     col.add(getValues(2));
     final Property complexCollection = new Property(null, "ComplexCol", ValueType.COLLECTION_COMPLEX, col);
 
-    final ODataJsonSerializer serializer = new ODataJsonSerializer(ODataFormat.APPLICATION_JSON);
+    final ODataJsonSerializer serializer = new ODataJsonSerializer(ODataFormat.APPLICATION_JSON.getContentType());
     final ComplexSerializerOptions options = ComplexSerializerOptions.with()
         .contextURL(ContextURL.with().selectList("ComplexCollection").build()).build();
     final InputStream in = serializer.complexCollection(null, ComplexTypeHelper.createType(),

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java
index c9efe07..9f67e49 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/json/ServerErrorSerializerTest.java
@@ -45,7 +45,7 @@ public class ServerErrorSerializerTest {
 
   @Before
   public void before() throws Exception {
-    ser = OData.newInstance().createSerializer(ODataFormat.JSON);
+    ser = OData.newInstance().createSerializer(ODataFormat.JSON.getContentType());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java
index d78b50e..752b254 100644
--- a/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java
+++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentXmlSerializerTest.java
@@ -76,7 +76,7 @@ public class MetadataDocumentXmlSerializerTest {
 
   @BeforeClass
   public static void init() throws SerializerException {
-    serializer = OData.newInstance().createSerializer(ODataFormat.XML);
+    serializer = OData.newInstance().createSerializer(ODataFormat.XML.getContentType());
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalActionProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalActionProcessor.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalActionProcessor.java
index da8c5cc..fe1c1da 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalActionProcessor.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalActionProcessor.java
@@ -78,9 +78,8 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     final EdmAction action = ((UriResourceAction) uriInfo.asUriInfoResource().getUriResourceParts().get(0))
         .getAction();
 
-    DeserializerResult deserializerResult =
-        odata.createDeserializer(ODataFormat.fromContentType(requestFormat))
-            .actionParameters(request.getBody(), action);
+    DeserializerResult deserializerResult = 
+        odata.createDeserializer(requestFormat).actionParameters(request.getBody(), action);
 
     EntityCollection collection =
         dataProvider.processActionEntityCollection(action.getName(), deserializerResult.getActionParameters());
@@ -98,7 +97,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     EntityCollectionSerializerOptions options = EntityCollectionSerializerOptions.with()
         .contextURL(format == ODataFormat.JSON_NO_METADATA ? null : getContextUrl(edmEntitySet, type, false))
         .build();
-    response.setContent(odata.createSerializer(format)
+    response.setContent(odata.createSerializer(requestFormat)
         .entityCollection(serviceMetadata, type, collection, options).getContent());
     response.setStatusCode(HttpStatusCode.OK.getStatusCode());
     response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
@@ -115,8 +114,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     final EdmEntityType type = (EdmEntityType) action.getReturnType().getType();
 
     final DeserializerResult deserializerResult =
-        odata.createDeserializer(ODataFormat.fromContentType(requestFormat))
-            .actionParameters(request.getBody(), action);
+        odata.createDeserializer(requestFormat).actionParameters(request.getBody(), action);
 
     final EntityActionResult entityResult =
         dataProvider.processActionEntity(action.getName(), deserializerResult.getActionParameters());
@@ -130,7 +128,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
       }
     } else {
       final ODataFormat format = ODataFormat.fromContentType(responseFormat);
-      response.setContent(odata.createSerializer(format).entity(
+      response.setContent(odata.createSerializer(requestFormat).entity(
           serviceMetadata,
           type,
           entityResult.getEntity(),
@@ -155,8 +153,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     final EdmAction action = ((UriResourceAction) uriInfo.asUriInfoResource().getUriResourceParts().get(0))
         .getAction();
     DeserializerResult deserializerResult =
-        odata.createDeserializer(ODataFormat.fromContentType(requestFormat))
-            .actionParameters(request.getBody(), action);
+        odata.createDeserializer(requestFormat).actionParameters(request.getBody(), action);
 
     Property property =
         dataProvider.processActionPrimitiveCollection(action.getName(), deserializerResult.getActionParameters());
@@ -175,8 +172,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     PrimitiveSerializerOptions options = PrimitiveSerializerOptions.with().contextURL(contextURL).build();
 
     SerializerResult result =
-        odata.createSerializer(ODataFormat.fromContentType(responseFormat))
-            .primitiveCollection(serviceMetadata, type, property, options);
+        odata.createSerializer(requestFormat).primitiveCollection(serviceMetadata, type, property, options);
 
     response.setStatusCode(HttpStatusCode.OK.getStatusCode());
     response.setContent(result.getContent());
@@ -191,8 +187,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     final EdmAction action = ((UriResourceAction) uriInfo.asUriInfoResource().getUriResourceParts().get(0))
         .getAction();
     DeserializerResult deserializerResult =
-        odata.createDeserializer(ODataFormat.fromContentType(requestFormat))
-            .actionParameters(request.getBody(), action);
+        odata.createDeserializer(requestFormat).actionParameters(request.getBody(), action);
 
     Property property = dataProvider.processActionPrimitive(action.getName(), deserializerResult.getActionParameters());
     EdmPrimitiveType type = (EdmPrimitiveType) action.getReturnType().getType();
@@ -208,8 +203,8 @@ public class TechnicalActionProcessor extends TechnicalProcessor
       ContextURL contextURL = ContextURL.with().type(type).build();
       PrimitiveSerializerOptions options = PrimitiveSerializerOptions.with().contextURL(contextURL).build();
 
-      SerializerResult result = odata.createSerializer(ODataFormat.fromContentType(responseFormat))
-          .primitive(serviceMetadata, type, property, options);
+      SerializerResult result = odata.createSerializer(requestFormat)
+                                     .primitive(serviceMetadata, type, property, options);
 
       response.setStatusCode(HttpStatusCode.OK.getStatusCode());
       response.setContent(result.getContent());
@@ -225,8 +220,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     final EdmAction action = ((UriResourceAction) uriInfo.asUriInfoResource().getUriResourceParts().get(0))
         .getAction();
     DeserializerResult deserializerResult =
-        odata.createDeserializer(ODataFormat.fromContentType(requestFormat))
-            .actionParameters(request.getBody(), action);
+        odata.createDeserializer(requestFormat).actionParameters(request.getBody(), action);
 
     Property property =
         dataProvider.processActionComplexCollection(action.getName(), deserializerResult.getActionParameters());
@@ -245,8 +239,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     ComplexSerializerOptions options = ComplexSerializerOptions.with().contextURL(contextURL).build();
 
     SerializerResult result =
-        odata.createSerializer(ODataFormat.fromContentType(responseFormat)).complexCollection(serviceMetadata, type,
-            property, options);
+        odata.createSerializer(requestFormat).complexCollection(serviceMetadata, type, property, options);
 
     response.setStatusCode(HttpStatusCode.OK.getStatusCode());
     response.setContent(result.getContent());
@@ -261,8 +254,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     final EdmAction action = ((UriResourceAction) uriInfo.asUriInfoResource().getUriResourceParts().get(0))
         .getAction();
     DeserializerResult deserializerResult =
-        odata.createDeserializer(ODataFormat.fromContentType(requestFormat))
-            .actionParameters(request.getBody(), action);
+        odata.createDeserializer(requestFormat).actionParameters(request.getBody(), action);
 
     Property property = dataProvider.processActionComplex(action.getName(), deserializerResult.getActionParameters());
     EdmComplexType type = (EdmComplexType) action.getReturnType().getType();
@@ -277,11 +269,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     } else {
       ContextURL contextURL = ContextURL.with().type(type).build();
       ComplexSerializerOptions options = ComplexSerializerOptions.with().contextURL(contextURL).build();
-
-      SerializerResult result =
-          odata.createSerializer(ODataFormat.fromContentType(responseFormat)).complex(serviceMetadata, type, property,
-              options);
-
+      SerializerResult result = odata.createSerializer(requestFormat).complex(serviceMetadata, type, property, options);
       response.setStatusCode(HttpStatusCode.OK.getStatusCode());
       response.setContent(result.getContent());
       response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
@@ -296,8 +284,7 @@ public class TechnicalActionProcessor extends TechnicalProcessor
     final EdmAction action = resource.getAction();
     if (action.getParameterNames().size() - (action.isBound() ? 1 : 0) > 0) {
       checkRequestFormat(requestFormat);
-      odata.createDeserializer(ODataFormat.fromContentType(requestFormat))
-          .actionParameters(request.getBody(), action);
+      odata.createDeserializer(requestFormat).actionParameters(request.getBody(), action);
     }
     response.setStatusCode(HttpStatusCode.NO_CONTENT.getStatusCode());
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/0043bd9c/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
index 25747bb..61dbfc9 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/processor/TechnicalEntityProcessor.java
@@ -153,9 +153,8 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
       dataProvider.setMedia(entity, odata.createFixedFormatDeserializer().binary(request.getBody()),
           requestFormat.toContentTypeString());
     } else {
-      final DeserializerResult deserializerResult =
-          odata.createDeserializer(ODataFormat.fromContentType(requestFormat))
-              .entity(request.getBody(), edmEntityType);
+      final DeserializerResult deserializerResult = 
+          odata.createDeserializer(requestFormat).entity(request.getBody(), edmEntityType);
       new RequestValidator(dataProvider, request.getRawBaseUri())
           .validate(edmEntitySet, deserializerResult.getEntity());
 
@@ -164,8 +163,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
       expand = deserializerResult.getExpandTree();
     }
 
-    final ODataFormat format = ODataFormat.fromContentType(responseFormat);
-    response.setContent(serializeEntity(entity, edmEntitySet, edmEntityType, format, expand, null)
+    response.setContent(serializeEntity(entity, edmEntitySet, edmEntityType, responseFormat, expand, null)
         .getContent());
     response.setStatusCode(HttpStatusCode.CREATED.getStatusCode());
     response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
@@ -200,7 +198,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
         request.getHeaders(HttpHeader.IF_MATCH),
         request.getHeaders(HttpHeader.IF_NONE_MATCH));
     checkRequestFormat(requestFormat);
-    final ODataDeserializer deserializer = odata.createDeserializer(ODataFormat.fromContentType(requestFormat));
+    final ODataDeserializer deserializer = odata.createDeserializer(requestFormat);
     final Entity changedEntity = deserializer.entity(request.getBody(), edmEntitySet.getEntityType()).getEntity();
 
     new RequestValidator(dataProvider,
@@ -212,8 +210,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
         request.getMethod() == HttpMethod.PATCH, false);
 
     response.setStatusCode(HttpStatusCode.OK.getStatusCode());
-    final ODataFormat format = ODataFormat.fromContentType(responseFormat);
-    response.setContent(serializeEntity(entity, edmEntitySet, edmEntityType, format, null, null)
+    response.setContent(serializeEntity(entity, edmEntitySet, edmEntityType, responseFormat, null, null)
         .getContent());
     response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
     if (entity.getETag() != null) {
@@ -236,8 +233,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
     dataProvider.setMedia(entity, odata.createFixedFormatDeserializer().binary(request.getBody()),
         requestFormat.toContentTypeString());
 
-    final ODataFormat format = ODataFormat.fromContentType(responseFormat);
-    response.setContent(serializeEntity(entity, edmEntitySet, edmEntityType, format, null, null)
+    response.setContent(serializeEntity(entity, edmEntitySet, edmEntityType, responseFormat, null, null)
         .getContent());
     response.setStatusCode(HttpStatusCode.OK.getStatusCode());
     response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());
@@ -282,7 +278,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
   public void createReference(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
       final ContentType requestFormat) throws ODataApplicationException, ODataLibraryException {
 
-    final ODataDeserializer deserializer = odata.createDeserializer(ODataFormat.fromContentType(requestFormat));
+    final ODataDeserializer deserializer = odata.createDeserializer(requestFormat);
     final DeserializerResult references = deserializer.entityReferences(request.getBody());
 
     if (references.getEntityReferences().size() != 1) {
@@ -302,7 +298,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
   public void updateReference(final ODataRequest request, ODataResponse response, final UriInfo uriInfo,
       final ContentType requestFormat) throws ODataApplicationException, ODataLibraryException {
 
-    final ODataDeserializer deserializer = odata.createDeserializer(ODataFormat.fromContentType(requestFormat));
+    final ODataDeserializer deserializer = odata.createDeserializer(requestFormat);
     final DeserializerResult references = deserializer.entityReferences(request.getBody());
 
     if (references.getEntityReferences().size() != 1) {
@@ -351,7 +347,7 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
   }
 
   private void readEntity(final ODataRequest request, final ODataResponse response, final UriInfo uriInfo,
-      final ContentType requestedContentType, final boolean isReference)
+      final ContentType requestedFormat, final boolean isReference)
       throws ODataApplicationException, ODataLibraryException {
     final EdmEntitySet edmEntitySet = getEdmEntitySet(uriInfo);
     final EdmEntityType edmEntityType = edmEntitySet == null ?
@@ -369,7 +365,6 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
       return;
     }
 
-    final ODataFormat format = ODataFormat.fromContentType(requestedContentType);
     final ExpandOption expand = uriInfo.getExpandOption();
     final SelectOption select = uriInfo.getSelectOption();
 
@@ -378,15 +373,15 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
     expandHandler.applyExpandQueryOptions(entitySerialization, edmEntitySet, expand);
 
     final SerializerResult serializerResult = isReference ?
-        serializeReference(entity, edmEntitySet, format) :
-        serializeEntity(entitySerialization, edmEntitySet, edmEntityType, format, expand, select);
+        serializeReference(entity, edmEntitySet, requestedFormat) :
+        serializeEntity(entitySerialization, edmEntitySet, edmEntityType, requestedFormat, expand, select);
 
     if (entity.getETag() != null) {
       response.setHeader(HttpHeader.ETAG, entity.getETag());
     }
     response.setContent(serializerResult.getContent());
     response.setStatusCode(HttpStatusCode.OK.getStatusCode());
-    response.setHeader(HttpHeader.CONTENT_TYPE, requestedContentType.toContentTypeString());
+    response.setHeader(HttpHeader.CONTENT_TYPE, requestedFormat.toContentTypeString());
   }
 
   private void readEntityCollection(final ODataRequest request, final ODataResponse response,
@@ -422,7 +417,6 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
         request.getRawRequestUri());
 
     // Apply expand system query option
-    final ODataFormat format = ODataFormat.fromContentType(requestedContentType);
     final ExpandOption expand = uriInfo.getExpandOption();
     final SelectOption select = uriInfo.getSelectOption();
 
@@ -438,8 +432,8 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
 
     // Serialize
     final SerializerResult serializerResult = (isReference) ? 
-        serializeReferenceCollection(entitySetSerialization, edmEntitySet, format, countOption) :
-        serializeEntityCollection(entitySetSerialization, edmEntitySet, edmEntityType, format,
+        serializeReferenceCollection(entitySetSerialization, edmEntitySet, requestedContentType, countOption) :
+        serializeEntityCollection(entitySetSerialization, edmEntitySet, edmEntityType, requestedContentType,
             expand, select, countOption);
 
     response.setContent(serializerResult.getContent());
@@ -448,15 +442,16 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
   }
 
   private SerializerResult serializeEntityCollection(final EntityCollection entityCollection,
-      final EdmEntitySet edmEntitySet, final EdmEntityType edmEntityType, final ODataFormat format,
+      final EdmEntitySet edmEntitySet, final EdmEntityType edmEntityType, final ContentType requestedFormat,
       final ExpandOption expand, final SelectOption select, final CountOption countOption)
       throws ODataLibraryException {
-    return odata.createSerializer(format).entityCollection(
+    
+    return odata.createSerializer(requestedFormat).entityCollection(
         serviceMetadata,
         edmEntityType,
         entityCollection,
         EntityCollectionSerializerOptions.with()
-            .contextURL(format == ODataFormat.JSON_NO_METADATA ? null :
+            .contextURL(ODataFormat.fromContentType(requestedFormat) == ODataFormat.JSON_NO_METADATA ? null :
                 getContextUrl(edmEntitySet, edmEntityType, false, expand, select))
             .count(countOption)
             .expand(expand).select(select)
@@ -464,33 +459,32 @@ public class TechnicalEntityProcessor extends TechnicalProcessor
   }
 
   private SerializerResult serializeReferenceCollection(final EntityCollection entityCollection, 
-      final EdmEntitySet edmEntitySet, final ODataFormat format, final CountOption countOption) 
+      final EdmEntitySet edmEntitySet, final ContentType requestedFormat, final CountOption countOption) 
           throws ODataLibraryException {
 
-    return odata.createSerializer(format)
+    return odata.createSerializer(requestedFormat)
         .referenceCollection(serviceMetadata, edmEntitySet, entityCollection,ReferenceCollectionSerializerOptions.with()
             .contextURL(ContextURL.with().asCollection().suffix(Suffix.REFERENCE).build())
-            .count(countOption)
-            .setIEEE754Compatible(false).build());
+            .count(countOption).build());
   }
 
   private SerializerResult serializeReference(final Entity entity, final EdmEntitySet edmEntitySet,
-      final ODataFormat format) throws ODataLibraryException {
-    return odata.createSerializer(format)
+      final ContentType requestedFormat) throws ODataLibraryException {
+    return odata.createSerializer(requestedFormat)
         .reference(serviceMetadata, edmEntitySet, entity, ReferenceSerializerOptions.with()
             .contextURL(ContextURL.with().suffix(Suffix.REFERENCE).build()).build());
             
   }
 
   private SerializerResult serializeEntity(final Entity entity,
-      final EdmEntitySet edmEntitySet, final EdmEntityType edmEntityType, final ODataFormat format,
+      final EdmEntitySet edmEntitySet, final EdmEntityType edmEntityType, final ContentType requestedFormat,
       final ExpandOption expand, final SelectOption select) throws ODataLibraryException {
-    return odata.createSerializer(format).entity(
+    return odata.createSerializer(requestedFormat).entity(
         serviceMetadata,
         edmEntityType,
         entity,
         EntitySerializerOptions.with()
-            .contextURL(format == ODataFormat.JSON_NO_METADATA ? null :
+            .contextURL(ODataFormat.fromContentType(requestedFormat) == ODataFormat.JSON_NO_METADATA ? null :
                 getContextUrl(edmEntitySet, edmEntityType, true, expand, select))
             .expand(expand).select(select)
             .build());


Mime
View raw message