Search in sources :

Example 1 with FunctionblockTemplate

use of org.eclipse.vorto.codegen.hono.model.FunctionblockTemplate in project vorto by eclipse.

the class EclipseHonoGenerator method generate.

@Override
public IGenerationResult generate(InformationModel model, InvocationContext context, IVortoCodeGenProgressMonitor monitor) {
    GenerationResultZip output = new GenerationResultZip(model, getServiceKey());
    ChainedCodeGeneratorTask<InformationModel> generator = new ChainedCodeGeneratorTask<InformationModel>();
    generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new PomFileTemplate()));
    generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new Log4jTemplate()));
    generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new CertificateTemplate()));
    generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new AppTemplate()));
    generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new IDataServiceTemplate()));
    generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new HonoDataService()));
    generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new HonoMqttClientTemplate()));
    generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new InformationModelTemplate()));
    generator.generate(model, context, output);
    for (FunctionblockProperty fbProperty : model.getProperties()) {
        new GeneratorTaskFromFileTemplate<>(new FunctionblockTemplate(model)).generate(fbProperty.getType(), context, output);
    }
    return output;
}
Also used : GenerationResultZip(org.eclipse.vorto.codegen.api.GenerationResultZip) InformationModel(org.eclipse.vorto.core.api.model.informationmodel.InformationModel) IDataServiceTemplate(org.eclipse.vorto.codegen.hono.service.IDataServiceTemplate) ChainedCodeGeneratorTask(org.eclipse.vorto.codegen.api.ChainedCodeGeneratorTask) FunctionblockTemplate(org.eclipse.vorto.codegen.hono.model.FunctionblockTemplate) HonoDataService(org.eclipse.vorto.codegen.hono.service.hono.HonoDataService) InformationModelTemplate(org.eclipse.vorto.codegen.hono.model.InformationModelTemplate) HonoMqttClientTemplate(org.eclipse.vorto.codegen.hono.service.hono.HonoMqttClientTemplate) FunctionblockProperty(org.eclipse.vorto.core.api.model.informationmodel.FunctionblockProperty)

Aggregations

ChainedCodeGeneratorTask (org.eclipse.vorto.codegen.api.ChainedCodeGeneratorTask)1 GenerationResultZip (org.eclipse.vorto.codegen.api.GenerationResultZip)1 FunctionblockTemplate (org.eclipse.vorto.codegen.hono.model.FunctionblockTemplate)1 InformationModelTemplate (org.eclipse.vorto.codegen.hono.model.InformationModelTemplate)1 IDataServiceTemplate (org.eclipse.vorto.codegen.hono.service.IDataServiceTemplate)1 HonoDataService (org.eclipse.vorto.codegen.hono.service.hono.HonoDataService)1 HonoMqttClientTemplate (org.eclipse.vorto.codegen.hono.service.hono.HonoMqttClientTemplate)1 FunctionblockProperty (org.eclipse.vorto.core.api.model.informationmodel.FunctionblockProperty)1 InformationModel (org.eclipse.vorto.core.api.model.informationmodel.InformationModel)1