@Test public void defaultSupportedContentTypesForServiceDocument() throws Exception { List<String> types = service.getSupportedContentTypes(ServiceDocumentProcessor.class); assertTrue(types.contains(APPLICATION_ATOM_SVC)); assertTrue(types.contains(APPLICATION_JSON)); }
@Override public List<String> getSupportedContentTypes(final Class<? extends ODataProcessor> processorFeature) throws ODataException { List<String> result = new ArrayList<String>(); if (processor instanceof CustomContentType) { result.addAll(((CustomContentType) processor).getCustomContentTypes(processorFeature)); } if (processorFeature == BatchProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntityProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_ENTRY_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == FunctionImportProcessor.class || processorFeature == EntityLinkProcessor.class || processorFeature == EntityLinksProcessor.class || processorFeature == EntitySimplePropertyProcessor.class || processorFeature == EntityComplexPropertyProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); } else if (processorFeature == EntityMediaProcessor.class || processorFeature == EntitySimplePropertyValueProcessor.class || processorFeature == FunctionImportValueProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntitySetProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_FEED_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == MetadataProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == ServiceDocumentProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_SVC_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else { throw new ODataNotImplementedException(); } return result; }
ODataSingleProcessorService implements ODataService { @Override public List<String> getSupportedContentTypes(final Class<? extends ODataProcessor> processorFeature) throws ODataException { List<String> result = new ArrayList<String>(); if (processor instanceof CustomContentType) { result.addAll(((CustomContentType) processor).getCustomContentTypes(processorFeature)); } if (processorFeature == BatchProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntityProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_ENTRY_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == FunctionImportProcessor.class || processorFeature == EntityLinkProcessor.class || processorFeature == EntityLinksProcessor.class || processorFeature == EntitySimplePropertyProcessor.class || processorFeature == EntityComplexPropertyProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); } else if (processorFeature == EntityMediaProcessor.class || processorFeature == EntitySimplePropertyValueProcessor.class || processorFeature == FunctionImportValueProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntitySetProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_FEED_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == MetadataProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == ServiceDocumentProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_SVC_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else { throw new ODataNotImplementedException(); } return result; } }
ODataSingleProcessorService implements ODataService { @Override public List<String> getSupportedContentTypes(final Class<? extends ODataProcessor> processorFeature) throws ODataException { List<String> result = new ArrayList<String>(); if (processor instanceof CustomContentType) { result.addAll(((CustomContentType) processor).getCustomContentTypes(processorFeature)); } if (processorFeature == BatchProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntityProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_ENTRY_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == FunctionImportProcessor.class || processorFeature == EntityLinkProcessor.class || processorFeature == EntityLinksProcessor.class || processorFeature == EntitySimplePropertyProcessor.class || processorFeature == EntityComplexPropertyProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); } else if (processorFeature == EntityMediaProcessor.class || processorFeature == EntitySimplePropertyValueProcessor.class || processorFeature == FunctionImportValueProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntitySetProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_FEED_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == MetadataProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == ServiceDocumentProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_SVC_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else { throw new ODataNotImplementedException(); } return result; } ODataSingleProcessorService(final EdmProvider provider, final ODataSingleProcessor processor); }
ODataSingleProcessorService implements ODataService { @Override public List<String> getSupportedContentTypes(final Class<? extends ODataProcessor> processorFeature) throws ODataException { List<String> result = new ArrayList<String>(); if (processor instanceof CustomContentType) { result.addAll(((CustomContentType) processor).getCustomContentTypes(processorFeature)); } if (processorFeature == BatchProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntityProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_ENTRY_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == FunctionImportProcessor.class || processorFeature == EntityLinkProcessor.class || processorFeature == EntityLinksProcessor.class || processorFeature == EntitySimplePropertyProcessor.class || processorFeature == EntityComplexPropertyProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); } else if (processorFeature == EntityMediaProcessor.class || processorFeature == EntitySimplePropertyValueProcessor.class || processorFeature == FunctionImportValueProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntitySetProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_FEED_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == MetadataProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == ServiceDocumentProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_SVC_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else { throw new ODataNotImplementedException(); } return result; } ODataSingleProcessorService(final EdmProvider provider, final ODataSingleProcessor processor); @Override String getVersion(); @Override Edm getEntityDataModel(); @Override MetadataProcessor getMetadataProcessor(); @Override ServiceDocumentProcessor getServiceDocumentProcessor(); @Override EntityProcessor getEntityProcessor(); @Override EntitySetProcessor getEntitySetProcessor(); @Override EntityComplexPropertyProcessor getEntityComplexPropertyProcessor(); @Override EntityLinkProcessor getEntityLinkProcessor(); @Override EntityLinksProcessor getEntityLinksProcessor(); @Override EntityMediaProcessor getEntityMediaProcessor(); @Override EntitySimplePropertyProcessor getEntitySimplePropertyProcessor(); @Override EntitySimplePropertyValueProcessor getEntitySimplePropertyValueProcessor(); @Override FunctionImportProcessor getFunctionImportProcessor(); @Override FunctionImportValueProcessor getFunctionImportValueProcessor(); @Override BatchProcessor getBatchProcessor(); @Override ODataProcessor getProcessor(); @Override List<String> getSupportedContentTypes(final Class<? extends ODataProcessor> processorFeature); }
ODataSingleProcessorService implements ODataService { @Override public List<String> getSupportedContentTypes(final Class<? extends ODataProcessor> processorFeature) throws ODataException { List<String> result = new ArrayList<String>(); if (processor instanceof CustomContentType) { result.addAll(((CustomContentType) processor).getCustomContentTypes(processorFeature)); } if (processorFeature == BatchProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntityProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_ENTRY_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == FunctionImportProcessor.class || processorFeature == EntityLinkProcessor.class || processorFeature == EntityLinksProcessor.class || processorFeature == EntitySimplePropertyProcessor.class || processorFeature == EntityComplexPropertyProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); } else if (processorFeature == EntityMediaProcessor.class || processorFeature == EntitySimplePropertyValueProcessor.class || processorFeature == FunctionImportValueProcessor.class) { result.add(HttpContentType.WILDCARD); } else if (processorFeature == EntitySetProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_XML_FEED_UTF8); result.add(HttpContentType.APPLICATION_ATOM_XML_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == MetadataProcessor.class) { result.add(HttpContentType.APPLICATION_XML_UTF8); } else if (processorFeature == ServiceDocumentProcessor.class) { result.add(HttpContentType.APPLICATION_ATOM_SVC_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8); result.add(HttpContentType.APPLICATION_JSON_UTF8_VERBOSE); result.add(HttpContentType.APPLICATION_JSON); result.add(HttpContentType.APPLICATION_JSON_VERBOSE); result.add(HttpContentType.APPLICATION_XML_UTF8); } else { throw new ODataNotImplementedException(); } return result; } ODataSingleProcessorService(final EdmProvider provider, final ODataSingleProcessor processor); @Override String getVersion(); @Override Edm getEntityDataModel(); @Override MetadataProcessor getMetadataProcessor(); @Override ServiceDocumentProcessor getServiceDocumentProcessor(); @Override EntityProcessor getEntityProcessor(); @Override EntitySetProcessor getEntitySetProcessor(); @Override EntityComplexPropertyProcessor getEntityComplexPropertyProcessor(); @Override EntityLinkProcessor getEntityLinkProcessor(); @Override EntityLinksProcessor getEntityLinksProcessor(); @Override EntityMediaProcessor getEntityMediaProcessor(); @Override EntitySimplePropertyProcessor getEntitySimplePropertyProcessor(); @Override EntitySimplePropertyValueProcessor getEntitySimplePropertyValueProcessor(); @Override FunctionImportProcessor getFunctionImportProcessor(); @Override FunctionImportValueProcessor getFunctionImportValueProcessor(); @Override BatchProcessor getBatchProcessor(); @Override ODataProcessor getProcessor(); @Override List<String> getSupportedContentTypes(final Class<? extends ODataProcessor> processorFeature);  }