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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.olingo.odata2.api.edm.provider.Property>generate(IntegrationObjectItemModel itemModel) Generates the schema element whose type is defined by T.List<org.apache.olingo.odata2.api.edm.provider.Property>generate(TypeDescriptor typeDescriptor) Generates simple properties for simple (not navigation) attributes declared in the type descriptorprotected DescriptorFactoryprotected SchemaElementGenerator<org.apache.olingo.odata2.api.edm.provider.SimpleProperty,TypeAttributeDescriptor> protected abstract booleanisApplicable(TypeAttributeDescriptor descriptor) Allows subclasses to have a hook into the decision of whether an attribute should be presented as a simple property.voidsetDescriptorFactory(DescriptorFactory factory) voidsetSimplePropertyGenerator(SchemaElementGenerator<org.apache.olingo.odata2.api.edm.provider.SimpleProperty, TypeAttributeDescriptor> generator)
-
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
itemModeto aTypeDescriptorand then delegates togenerate(TypeDescriptor)- Specified by:
generatein interfaceSchemaElementGenerator<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
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 returnstrue.
-
getDescriptorFactory
-
setDescriptorFactory
-
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)
-