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 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: ODataEntryToIntegrationItemConverter
      Performs the conversion when there is no TypeDescriptor available. In this case the type descriptor will be derived from the other parameters.
      Specified by:
      convert in interface ODataEntryToIntegrationItemConverter
      Parameters:
      context - context of the request containing the entry
      entitySet - metadata about the entry received
      entry - the entry received to be converted to the IntegrationItem
      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 the entitySet
    • 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: ODataEntryToIntegrationItemConverter
      Performs the conversion when TypeDescriptor for the integration item to create is available.
      Specified by:
      convert in interface ODataEntryToIntegrationItemConverter
      Parameters:
      context - context of the request containing the entry
      typeDesc - type descriptor for the integration item to create
      entry - the entry received to be converted to the IntegrationItem
      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: ODataEntryToIntegrationItemConverter
      Performs conversion of an OData entry nested in the payload of an outer entry.
      Specified by:
      convert in interface ODataEntryToIntegrationItemConverter
      Parameters:
      context - context of the request containing the entry
      typeDesc - type descriptor for the integration item to create, that matches the entry being converted
      entry - the entry received to be converted to the IntegrationItem
      parentItem - 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 of convert(...) 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

      public void setItemTypeDescriptorService(ItemTypeDescriptorService service)
      Injects implementation of the ItemTypeDescriptorService to be used for the type descriptor lookup. This service is needed by convert(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()
    • getKeyValueGenerator

      protected IntegrationKeyValueGenerator<TypeDescriptor,IntegrationItem> getKeyValueGenerator()
    • setKeyValueGenerator

      public void setKeyValueGenerator(IntegrationKeyValueGenerator<TypeDescriptor,IntegrationItem> generator)
    • setAttributeValueConverter

      public void setAttributeValueConverter(@NotNull @NotNull PayloadAttributeValueConverter converter)