use of org.eclipse.vorto.core.api.model.BuilderUtils.InformationModelBuilder in project vorto by eclipse.
the class ModelContentToEcoreConverter method convertInformationModel.
private InformationModel convertInformationModel(Infomodel model, ModelContent context) {
InformationModelBuilder builder = BuilderUtils.newInformationModel(new ModelId(ModelType.InformationModel, model.getId().getName(), model.getId().getNamespace(), model.getId().getVersion()));
builder.withCategory(model.getCategory());
builder.withDescription(model.getDescription());
builder.withDisplayName(model.getDisplayName());
builder.withVortolang(model.getVortolang());
for (ModelProperty property : model.getFunctionblocks()) {
FunctionblockModel fbModel = (FunctionblockModel) context.getModels().get((org.eclipse.vorto.model.ModelId) property.getType());
org.eclipse.vorto.core.api.model.functionblock.FunctionblockModel convertedFb = (org.eclipse.vorto.core.api.model.functionblock.FunctionblockModel) convertFunctionblock(fbModel, context);
builder.withReference(ModelIdFactory.newInstance(convertedFb));
builder.withFunctionBlock(convertedFb, property.getName(), property.getDescription(), property.isMandatory());
}
return builder.build();
}
Aggregations