Class TLcdFeaturedDescriptorDataModelBuilder
ILcdFeaturedDescriptor
instances.- Since:
- 10.1
-
Constructor Summary
ConstructorDescriptionConstructs a new instance that only usesTLcdCoreDataTypes.getDataModel()
as dependency.TLcdFeaturedDescriptorDataModelBuilder
(String aName, TLcdDataModel... aDependencies) Constructs a new instance with a number of dependencies. -
Method Summary
Modifier and TypeMethodDescriptionbuildType
(String aTypeName, ILcdFeaturedDescriptor aFeaturedDescriptor) Builds a new data object type with the given name.Creates the data model.static TLcdDataModel
createDataModel
(String aDataModelName, String aTypeName, ILcdFeaturedDescriptor aFeaturedDescriptor) Creates a data model based on aILcdFeaturedDescriptor
.
-
Constructor Details
-
TLcdFeaturedDescriptorDataModelBuilder
Constructs a new instance that only usesTLcdCoreDataTypes.getDataModel()
as dependency.- Parameters:
aName
- the name of the data model that is to be built
-
TLcdFeaturedDescriptorDataModelBuilder
Constructs a new instance with a number of dependencies.- Parameters:
aName
- the name of the data model that is to be builtaDependencies
- the dependencies for this builder- See Also:
-
-
Method Details
-
createDataModel
public static TLcdDataModel createDataModel(String aDataModelName, String aTypeName, ILcdFeaturedDescriptor aFeaturedDescriptor) Creates a data model based on a
ILcdFeaturedDescriptor
. This data model will have one data object type (with the given name). This type will have one property for each feature in the featured descriptor.This method is a convenience method that constructs a
TLcdFeaturedDescriptorDataModelBuilder
, builds one type with the given featured descriptor and finally returns the created data model.- Parameters:
aDataModelName
- the name of the data model that is to be createdaTypeName
- the name of the type that is to be createdaFeaturedDescriptor
- the featured descriptor that defines the properties of the type- Returns:
- a data model with a single data object type that maps on the featured descriptor
-
buildType
Builds a new data object type with the given name. This type gets one property for each feature in the featured descriptor. The name of the property is equal to the name of the feature. If one of this builder's dependencies declares a type with as instance class the feature class of the feature the this type is used as the type of the property. Otherwise, a new primitive type is declared in the data model that is being built.
Characters in the feature name that are invalid for property names are replaced by underscores. In such a case, the display name of the property is set to the original feature name. The same is done for the given type name.
- Parameters:
aTypeName
- the name of the type that is builtaFeaturedDescriptor
- the featured descriptor that is used to add the properties to the type- Returns:
- the data type builder with properties according to the given featured descriptor
-
createDataModel
Creates the data model. After this method has been called, no more types can be built with this object.- Returns:
- the data model that this builder created
-