Class AbstractPropertyListGenerator

java.lang.Object
de.hybris.platform.odata2services.odata.schema.property.AbstractPropertyListGenerator
All Implemented Interfaces:
SchemaElementGenerator<List<org.apache.olingo.odata2.api.edm.provider.Property>,IntegrationObjectItemModel>
Direct Known Subclasses:
LocalizedPropertyListGenerator, PrimitivePropertyListGenerator

public abstract class AbstractPropertyListGenerator extends Object implements SchemaElementGenerator<List<org.apache.olingo.odata2.api.edm.provider.Property>,IntegrationObjectItemModel>
  • Constructor Details

    • AbstractPropertyListGenerator

      public AbstractPropertyListGenerator()
  • Method Details

    • generate

      public List<org.apache.olingo.odata2.api.edm.provider.Property> generate(IntegrationObjectItemModel itemModel)
      Generates the schema element whose type is defined by T.

      Converts itemMode to a TypeDescriptor and then delegates to generate(TypeDescriptor)

      Specified by:
      generate in interface SchemaElementGenerator<List<org.apache.olingo.odata2.api.edm.provider.Property>,IntegrationObjectItemModel>
      Parameters:
      itemModel - integration object item to generate simple EDM properties for.
      Returns:
      a list of simple EDM properties or an empty list, if the integration object item does not have properties or has only navigation properties referring other integration object items.
      See Also:
    • generate

      public List<org.apache.olingo.odata2.api.edm.provider.Property> generate(TypeDescriptor typeDescriptor)
      Generates simple properties for simple (not navigation) attributes declared in the type descriptor
      Parameters:
      typeDescriptor - describes integration object item, for which simple EDM properties need to be generated.
      Returns:
      a list of simple EDM properties or an empty list, if the integration object item does not have properties or has only navigation properties referring other integration object items.
    • isApplicable

      protected abstract boolean isApplicable(TypeAttributeDescriptor descriptor)
      Allows subclasses to have a hook into the decision of whether an attribute should be presented as a simple property. This class already checks whether the attribute is simple, i.e. it's a primitive and not a collection, before checking this method.
      Parameters:
      descriptor - an attribute descriptor to decided about whether it should be presented as EDM property or not.
      Returns:
      true, if the attribute should be converted to a property; false, otherwise. This default implementation always returns true.
    • getDescriptorFactory

      protected DescriptorFactory getDescriptorFactory()
    • setDescriptorFactory

      public void setDescriptorFactory(DescriptorFactory factory)
    • getSimplePropertyGenerator

      protected SchemaElementGenerator<org.apache.olingo.odata2.api.edm.provider.SimpleProperty,TypeAttributeDescriptor> getSimplePropertyGenerator()
    • setSimplePropertyGenerator

      public void setSimplePropertyGenerator(SchemaElementGenerator<org.apache.olingo.odata2.api.edm.provider.SimpleProperty,TypeAttributeDescriptor> generator)