@Test(expected=SerializerException.class) public void serializer() throws SerializerException { odata.createSerializer(null); }
@Override public ODataSerializer createSerializer(final ContentType contentType) throws SerializerException { ODataSerializer serializer = null; if (contentType != null && contentType.isCompatible(ContentType.APPLICATION_JSON)) { final String metadata = contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA); if (metadata == null || ContentType.VALUE_ODATA_METADATA_MINIMAL.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_NONE.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_FULL.equalsIgnoreCase(metadata)) { serializer = new ODataJsonSerializer(contentType, new Constantsv00()); } } else if (contentType != null && (contentType.isCompatible(ContentType.APPLICATION_XML) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML))) { serializer = new ODataXmlSerializer(); } if (serializer == null) { throw new SerializerException("Unsupported format: " + ((contentType != null) ? contentType.toContentTypeString() : null), SerializerException.MessageKeys.UNSUPPORTED_FORMAT, ((contentType != null) ? contentType.toContentTypeString() : null)); } else { return serializer; } }
ODataImpl extends OData { @Override public ODataSerializer createSerializer(final ContentType contentType) throws SerializerException { ODataSerializer serializer = null; if (contentType != null && contentType.isCompatible(ContentType.APPLICATION_JSON)) { final String metadata = contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA); if (metadata == null || ContentType.VALUE_ODATA_METADATA_MINIMAL.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_NONE.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_FULL.equalsIgnoreCase(metadata)) { serializer = new ODataJsonSerializer(contentType, new Constantsv00()); } } else if (contentType != null && (contentType.isCompatible(ContentType.APPLICATION_XML) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML))) { serializer = new ODataXmlSerializer(); } if (serializer == null) { throw new SerializerException("Unsupported format: " + ((contentType != null) ? contentType.toContentTypeString() : null), SerializerException.MessageKeys.UNSUPPORTED_FORMAT, ((contentType != null) ? contentType.toContentTypeString() : null)); } else { return serializer; } } }
ODataImpl extends OData { @Override public ODataSerializer createSerializer(final ContentType contentType) throws SerializerException { ODataSerializer serializer = null; if (contentType != null && contentType.isCompatible(ContentType.APPLICATION_JSON)) { final String metadata = contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA); if (metadata == null || ContentType.VALUE_ODATA_METADATA_MINIMAL.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_NONE.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_FULL.equalsIgnoreCase(metadata)) { serializer = new ODataJsonSerializer(contentType, new Constantsv00()); } } else if (contentType != null && (contentType.isCompatible(ContentType.APPLICATION_XML) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML))) { serializer = new ODataXmlSerializer(); } if (serializer == null) { throw new SerializerException("Unsupported format: " + ((contentType != null) ? contentType.toContentTypeString() : null), SerializerException.MessageKeys.UNSUPPORTED_FORMAT, ((contentType != null) ? contentType.toContentTypeString() : null)); } else { return serializer; } }  }
ODataImpl extends OData { @Override public ODataSerializer createSerializer(final ContentType contentType) throws SerializerException { ODataSerializer serializer = null; if (contentType != null && contentType.isCompatible(ContentType.APPLICATION_JSON)) { final String metadata = contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA); if (metadata == null || ContentType.VALUE_ODATA_METADATA_MINIMAL.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_NONE.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_FULL.equalsIgnoreCase(metadata)) { serializer = new ODataJsonSerializer(contentType, new Constantsv00()); } } else if (contentType != null && (contentType.isCompatible(ContentType.APPLICATION_XML) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML))) { serializer = new ODataXmlSerializer(); } if (serializer == null) { throw new SerializerException("Unsupported format: " + ((contentType != null) ? contentType.toContentTypeString() : null), SerializerException.MessageKeys.UNSUPPORTED_FORMAT, ((contentType != null) ? contentType.toContentTypeString() : null)); } else { return serializer; } }  @Override ODataSerializer createSerializer(final ContentType contentType); @Override ODataSerializer createSerializer(final ContentType contentType, 
      final List<String> versions); @Override FixedFormatSerializer createFixedFormatSerializer(); @Override EdmAssistedSerializer createEdmAssistedSerializer(final ContentType contentType); @Override EdmAssistedSerializer createEdmAssistedSerializer(final ContentType contentType, 
		  List<String> versions); @Override EdmDeltaSerializer createEdmDeltaSerializer(final ContentType contentType, final List<String> versions); @Override ODataHttpHandler createHandler(final ServiceMetadata serviceMetadata); @Override ODataHandler createRawHandler(ServiceMetadata serviceMetadata); @Override ServiceMetadata createServiceMetadata(final CsdlEdmProvider edmProvider,
      final List<EdmxReference> references); @Override ServiceMetadata createServiceMetadata(final CsdlEdmProvider edmProvider,
      final List<EdmxReference> references, final ServiceMetadataETagSupport serviceMetadataETagSupport); @Override FixedFormatDeserializer createFixedFormatDeserializer(); @Override UriHelper createUriHelper(); @Override ODataDeserializer createDeserializer(final ContentType contentType); @Override ODataDeserializer createDeserializer(final ContentType contentType,
      ServiceMetadata metadata); @Override EdmPrimitiveType createPrimitiveTypeInstance(final EdmPrimitiveTypeKind kind); @Override ETagHelper createETagHelper(); @Override Preferences createPreferences(final Collection<String> preferHeaders); @Override DebugResponseHelper createDebugResponseHelper(final String debugFormat); @Override ODataDeserializer createDeserializer(ContentType contentType, List<String> versions); @Override ODataDeserializer createDeserializer(ContentType contentType, ServiceMetadata metadata, List<String> versions); }
ODataImpl extends OData { @Override public ODataSerializer createSerializer(final ContentType contentType) throws SerializerException { ODataSerializer serializer = null; if (contentType != null && contentType.isCompatible(ContentType.APPLICATION_JSON)) { final String metadata = contentType.getParameter(ContentType.PARAMETER_ODATA_METADATA); if (metadata == null || ContentType.VALUE_ODATA_METADATA_MINIMAL.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_NONE.equalsIgnoreCase(metadata) || ContentType.VALUE_ODATA_METADATA_FULL.equalsIgnoreCase(metadata)) { serializer = new ODataJsonSerializer(contentType, new Constantsv00()); } } else if (contentType != null && (contentType.isCompatible(ContentType.APPLICATION_XML) || contentType.isCompatible(ContentType.APPLICATION_ATOM_XML))) { serializer = new ODataXmlSerializer(); } if (serializer == null) { throw new SerializerException("Unsupported format: " + ((contentType != null) ? contentType.toContentTypeString() : null), SerializerException.MessageKeys.UNSUPPORTED_FORMAT, ((contentType != null) ? contentType.toContentTypeString() : null)); } else { return serializer; } }  @Override ODataSerializer createSerializer(final ContentType contentType); @Override ODataSerializer createSerializer(final ContentType contentType, 
      final List<String> versions); @Override FixedFormatSerializer createFixedFormatSerializer(); @Override EdmAssistedSerializer createEdmAssistedSerializer(final ContentType contentType); @Override EdmAssistedSerializer createEdmAssistedSerializer(final ContentType contentType, 
		  List<String> versions); @Override EdmDeltaSerializer createEdmDeltaSerializer(final ContentType contentType, final List<String> versions); @Override ODataHttpHandler createHandler(final ServiceMetadata serviceMetadata); @Override ODataHandler createRawHandler(ServiceMetadata serviceMetadata); @Override ServiceMetadata createServiceMetadata(final CsdlEdmProvider edmProvider,
      final List<EdmxReference> references); @Override ServiceMetadata createServiceMetadata(final CsdlEdmProvider edmProvider,
      final List<EdmxReference> references, final ServiceMetadataETagSupport serviceMetadataETagSupport); @Override FixedFormatDeserializer createFixedFormatDeserializer(); @Override UriHelper createUriHelper(); @Override ODataDeserializer createDeserializer(final ContentType contentType); @Override ODataDeserializer createDeserializer(final ContentType contentType,
      ServiceMetadata metadata); @Override EdmPrimitiveType createPrimitiveTypeInstance(final EdmPrimitiveTypeKind kind); @Override ETagHelper createETagHelper(); @Override Preferences createPreferences(final Collection<String> preferHeaders); @Override DebugResponseHelper createDebugResponseHelper(final String debugFormat); @Override ODataDeserializer createDeserializer(ContentType contentType, List<String> versions); @Override ODataDeserializer createDeserializer(ContentType contentType, ServiceMetadata metadata, List<String> versions);  }