Class DefaultODataEntryToIntegrationItemConverter
- java.lang.Object
-
- de.hybris.platform.odata2services.converter.DefaultODataEntryToIntegrationItemConverter
-
- All Implemented Interfaces:
ODataEntryToIntegrationItemConverter
public class DefaultODataEntryToIntegrationItemConverter extends java.lang.Object implements ODataEntryToIntegrationItemConverter
Implementation of the converter, which populatesIntegrationItemattributes by delegating conversion of their values in the ODataEntry toPayloadAttributeValueConverter.
-
-
Constructor Summary
Constructors Constructor Description DefaultODataEntryToIntegrationItemConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description IntegrationItemconvert(@NotNull org.apache.olingo.odata2.api.processor.ODataContext context, @NotNull TypeDescriptor typeDesc, @NotNull org.apache.olingo.odata2.api.edm.EdmEntitySet entitySet, @NotNull org.apache.olingo.odata2.api.ep.entry.ODataEntry entry)Performs the conversion whenTypeDescriptorfor the integration item to create is available.IntegrationItemconvert(@NotNull org.apache.olingo.odata2.api.processor.ODataContext context, @NotNull TypeDescriptor typeDesc, @NotNull org.apache.olingo.odata2.api.ep.entry.ODataEntry entry)Performs the conversion whenTypeDescriptorfor the integration item to create is available.IntegrationItemconvert(@NotNull org.apache.olingo.odata2.api.processor.ODataContext context, @NotNull org.apache.olingo.odata2.api.edm.EdmEntitySet entitySet, @NotNull org.apache.olingo.odata2.api.ep.entry.ODataEntry entry)Performs the conversion when there is noTypeDescriptoravailable.IntegrationItemconvert(org.apache.olingo.odata2.api.processor.ODataContext context, TypeDescriptor typeDesc, org.apache.olingo.odata2.api.ep.entry.ODataEntry entry, IntegrationItem parentItem)Performs conversion of an OData entry nested in the payload of an outer entry.protected DefaultIntegrationItemcreateIntegrationItem(TypeDescriptor typeDesc, IntegrationItem contextItem)Instantiates an item that will be populated and used as result ofconvert(...)methods call.protected ItemTypeDescriptorServicegetItemTypeDescriptorService()protected IntegrationKeyValueGenerator<TypeDescriptor,IntegrationItem>getKeyValueGenerator()protected ODataContextLanguageExtractorgetLanguageExtractor()protected IntegrationLocalizationServicegetLocalizationService()Deprecated, for removal: This API element is subject to removal in a future version.not used anymore.protected ModelEntityServicegetModelEntityService()Deprecated, for removal: This API element is subject to removal in a future version.this injected service was used only for calculating integration key and now it's not used.protected ServiceNameExtractorgetServiceNameExtractor()voidsetAttributeValueConverter(@NotNull PayloadAttributeValueConverter converter)voidsetIntegrationKeyValueGenerator(IntegrationKeyValueGenerator<org.apache.olingo.odata2.api.edm.EdmEntitySet,org.apache.olingo.odata2.api.ep.entry.ODataEntry> generator)Deprecated, for removal: This API element is subject to removal in a future version.usesetKeyValueGenerator(IntegrationKeyValueGenerator)instead.voidsetItemTypeDescriptorService(ItemTypeDescriptorService service)Injects implementation of theItemTypeDescriptorServiceto be used for the type descriptor lookup.voidsetKeyValueGenerator(IntegrationKeyValueGenerator<TypeDescriptor,IntegrationItem> generator)voidsetLanguageExtractor(ODataContextLanguageExtractor languageExtractor)voidsetLocalizationService(IntegrationLocalizationService service)Deprecated, for removal: This API element is subject to removal in a future version.not used anymore.voidsetModelEntityService(ModelEntityService service)Deprecated, for removal: This API element is subject to removal in a future version.not used anymore and does not have to be injected.voidsetServiceNameExtractor(ServiceNameExtractor extractor)
-
-
-
Method Detail
-
convert
public IntegrationItem convert(@NotNull @NotNull org.apache.olingo.odata2.api.processor.ODataContext context, @NotNull @NotNull org.apache.olingo.odata2.api.edm.EdmEntitySet entitySet, @NotNull @NotNull org.apache.olingo.odata2.api.ep.entry.ODataEntry entry) throws org.apache.olingo.odata2.api.edm.EdmException
Description copied from interface:ODataEntryToIntegrationItemConverterPerforms the conversion when there is noTypeDescriptoravailable. In this case the type descriptor will be derived from the other parameters.- Specified by:
convertin interfaceODataEntryToIntegrationItemConverter- Parameters:
context- context of the request containing the entryentitySet- metadata about the entry receivedentry- the entry received to be converted to theIntegrationItem- Returns:
- an integration item converted from the entry
- Throws:
org.apache.olingo.odata2.api.edm.EdmException- if there is a problem with the metadata provided by theentitySet
-
convert
public IntegrationItem convert(@NotNull @NotNull org.apache.olingo.odata2.api.processor.ODataContext context, @NotNull @NotNull TypeDescriptor typeDesc, @NotNull @NotNull org.apache.olingo.odata2.api.edm.EdmEntitySet entitySet, @NotNull @NotNull org.apache.olingo.odata2.api.ep.entry.ODataEntry entry)
Description copied from interface:ODataEntryToIntegrationItemConverterPerforms the conversion whenTypeDescriptorfor the integration item to create is available.- Specified by:
convertin interfaceODataEntryToIntegrationItemConverter- Parameters:
context- context of the request containing the entrytypeDesc- type descriptor for the integration item to createentitySet- metadata about the entry receivedentry- the entry received to be converted to theIntegrationItem- Returns:
- an integration item converted from the entry
-
convert
public IntegrationItem convert(@NotNull @NotNull org.apache.olingo.odata2.api.processor.ODataContext context, @NotNull @NotNull TypeDescriptor typeDesc, @NotNull @NotNull org.apache.olingo.odata2.api.ep.entry.ODataEntry entry)
Description copied from interface:ODataEntryToIntegrationItemConverterPerforms the conversion whenTypeDescriptorfor the integration item to create is available.- Specified by:
convertin interfaceODataEntryToIntegrationItemConverter- Parameters:
context- context of the request containing the entrytypeDesc- type descriptor for the integration item to createentry- the entry received to be converted to theIntegrationItem- Returns:
- an integration item converted from the entry
-
convert
public IntegrationItem convert(org.apache.olingo.odata2.api.processor.ODataContext context, TypeDescriptor typeDesc, org.apache.olingo.odata2.api.ep.entry.ODataEntry entry, IntegrationItem parentItem)
Description copied from interface:ODataEntryToIntegrationItemConverterPerforms conversion of an OData entry nested in the payload of an outer entry.- Specified by:
convertin interfaceODataEntryToIntegrationItemConverter- Parameters:
context- context of the request containing the entrytypeDesc- type descriptor for the integration item to create, that matches the entry being convertedentry- the entry received to be converted to theIntegrationItemparentItem- integration item that corresponds to the OData entry containing the entry being converted.- Returns:
- an integration item converted from the entry
-
createIntegrationItem
protected DefaultIntegrationItem createIntegrationItem(TypeDescriptor typeDesc, IntegrationItem contextItem)
Instantiates an item that will be populated and used as result ofconvert(...)methods call.- Parameters:
typeDesc- non-null type descriptor describing type of the integration item to create.contextItem- a container (outer) item that references the item being created through one of its attributes.null, if this item is the top level item in the request payload.- Returns:
- new instance of the integration item that corresponds to the ODataEntry passed into
convert(...)methods
-
setModelEntityService
@Deprecated(since="1905.09-CEP", forRemoval=true) public void setModelEntityService(ModelEntityService service)Deprecated, for removal: This API element is subject to removal in a future version.not used anymore and does not have to be injected.InjectsModelEntityServiceto use- Parameters:
service- a service implementation
-
getModelEntityService
@Deprecated(since="1905.09-CEP", forRemoval=true) protected ModelEntityService getModelEntityService()Deprecated, for removal: This API element is subject to removal in a future version.this injected service was used only for calculating integration key and now it's not used. Instead this implementation usesIntegrationKeyValueGeneratornow
-
setItemTypeDescriptorService
public void setItemTypeDescriptorService(ItemTypeDescriptorService service)
Injects implementation of theItemTypeDescriptorServiceto be used for the type descriptor lookup. This service is needed byconvert(ODataContext, EdmEntitySet, ODataEntry)method and therefore must be injected, if this method is called by the application.- Parameters:
service- a service to use.
-
getItemTypeDescriptorService
protected ItemTypeDescriptorService getItemTypeDescriptorService()
-
setServiceNameExtractor
public void setServiceNameExtractor(ServiceNameExtractor extractor)
-
getServiceNameExtractor
protected ServiceNameExtractor getServiceNameExtractor()
-
setLanguageExtractor
public void setLanguageExtractor(ODataContextLanguageExtractor languageExtractor)
-
getLanguageExtractor
protected ODataContextLanguageExtractor getLanguageExtractor()
-
getLocalizationService
@Deprecated(since="1905.2004-CEP", forRemoval=true) protected IntegrationLocalizationService getLocalizationService()Deprecated, for removal: This API element is subject to removal in a future version.not used anymore.
-
setLocalizationService
@Deprecated(since="1905.2004-CEP", forRemoval=true) public void setLocalizationService(IntegrationLocalizationService service)Deprecated, for removal: This API element is subject to removal in a future version.not used anymore.- Parameters:
service- implementation to use.
-
setIntegrationKeyValueGenerator
@Deprecated(since="1905.2002-CEP", forRemoval=true) public void setIntegrationKeyValueGenerator(IntegrationKeyValueGenerator<org.apache.olingo.odata2.api.edm.EdmEntitySet,org.apache.olingo.odata2.api.ep.entry.ODataEntry> generator)Deprecated, for removal: This API element is subject to removal in a future version.usesetKeyValueGenerator(IntegrationKeyValueGenerator)instead.- Parameters:
generator- implementation to use.
-
getKeyValueGenerator
protected IntegrationKeyValueGenerator<TypeDescriptor,IntegrationItem> getKeyValueGenerator()
-
setKeyValueGenerator
public void setKeyValueGenerator(IntegrationKeyValueGenerator<TypeDescriptor,IntegrationItem> generator)
-
setAttributeValueConverter
public void setAttributeValueConverter(@NotNull @NotNull PayloadAttributeValueConverter converter)
-
-