Class ComposedEntityTypeElementGenerator
java.lang.Object
de.hybris.platform.odata2services.odata.schema.entity.SingleEntityTypeElementGenerator
de.hybris.platform.odata2services.odata.schema.entity.ComposedEntityTypeElementGenerator
- All Implemented Interfaces:
SchemaElementGenerator<Set<org.apache.olingo.odata2.api.edm.provider.EntityType>,TypeDescriptor>
Generates
EntityTypes based off the provided TypeDescriptor.-
Constructor Summary
ConstructorsConstructorDescriptionComposedEntityTypeElementGenerator(@NotNull KeyGenerator keyGenerator, @NotNull SchemaElementGenerator<List<org.apache.olingo.odata2.api.edm.provider.Property>, TypeDescriptor> propertiesGenerator, @NotNull NavigationPropertyListGeneratorRegistry registry) Instantiates a new single entity type generator. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.olingo.odata2.api.edm.provider.EntityTypegenerateEntityType(TypeDescriptor typeDescriptor) Generates a single entity type for the specified item delegating the entity parts creation to:SingleEntityTypeElementGenerator.generateEntityTypeName(TypeDescriptor)for the entity type name generationSingleEntityTypeElementGenerator.propertiesGeneratorfor the entity type properties generationSingleEntityTypeElementGenerator.keyGeneratorfor the entity type key generation.protected StringgenerateEntityTypeName(TypeDescriptor typeDescriptor) Generates name for the entity type being generated.protected booleanisApplicable(TypeDescriptor typeDescriptor) Determines whether this generator is applicable to the specified item and can generate at least a single EDMX entity type.Methods inherited from class de.hybris.platform.odata2services.odata.schema.entity.SingleEntityTypeElementGenerator
generate, generateKey
-
Constructor Details
-
Method Details
-
generateEntityType
protected org.apache.olingo.odata2.api.edm.provider.EntityType generateEntityType(TypeDescriptor typeDescriptor) Description copied from class:SingleEntityTypeElementGeneratorGenerates a single entity type for the specified item delegating the entity parts creation to:SingleEntityTypeElementGenerator.generateEntityTypeName(TypeDescriptor) for the entity type name generation
SingleEntityTypeElementGenerator.propertiesGenerator for the entity type properties generation
SingleEntityTypeElementGenerator.keyGenerator for the entity type key generation. If the key is not generated, i.e.
!Optional<Key>.isPresent(), anIllegalStateExceptionis thrown.- Overrides:
generateEntityTypein classSingleEntityTypeElementGenerator- Parameters:
typeDescriptor- an item type descriptor to generate the EDMX entity type for.- Returns:
- the generated entity type.
Subclasses make sure never returnnullfrom this method. If item cannot be generated, thenSingleEntityTypeElementGenerator.isApplicable(TypeDescriptor)should returnfalseinstead.
-
isApplicable
Determines whether this generator is applicable to the specified item and can generate at least a single EDMX entity type.- Specified by:
isApplicablein classSingleEntityTypeElementGenerator- Parameters:
typeDescriptor- an item type descriptor, based on which the decision has to be made.- Returns:
truefor all descriptors
-
generateEntityTypeName
Description copied from class:SingleEntityTypeElementGeneratorGenerates name for the entity type being generated.- Specified by:
generateEntityTypeNamein classSingleEntityTypeElementGenerator- Parameters:
typeDescriptor- an item type descriptor, for which entity type is being generated.- Returns:
- a valid EDMX entity type name.
-