Class DefaultODataEntryToIntegrationItemConverter
java.lang.Object
de.hybris.platform.odata2services.converter.DefaultODataEntryToIntegrationItemConverter
- All Implemented Interfaces:
ODataEntryToIntegrationItemConverter
public class DefaultODataEntryToIntegrationItemConverter
extends Object
implements ODataEntryToIntegrationItemConverter
Implementation of the converter, which populates
IntegrationItem attributes by delegating conversion of their
values in the ODataEntry to PayloadAttributeValueConverter.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(@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.convert(@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.convert(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 ItemTypeDescriptorServiceprotected ODataContextLanguageExtractorprotected ServiceNameExtractorvoidsetAttributeValueConverter(@NotNull PayloadAttributeValueConverter converter) voidInjects implementation of theItemTypeDescriptorServiceto be used for the type descriptor lookup.voidvoidsetLanguageExtractor(ODataContextLanguageExtractor languageExtractor) voidsetServiceNameExtractor(ServiceNameExtractor extractor)
-
Constructor Details
-
DefaultODataEntryToIntegrationItemConverter
public DefaultODataEntryToIntegrationItemConverter()
-
-
Method Details
-
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.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
-
setItemTypeDescriptorService
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
-
setServiceNameExtractor
-
getServiceNameExtractor
-
setLanguageExtractor
-
getLanguageExtractor
-
getKeyValueGenerator
-
setKeyValueGenerator
public void setKeyValueGenerator(IntegrationKeyValueGenerator<TypeDescriptor, IntegrationItem> generator) -
setAttributeValueConverter
-