Search in sources :

Example 1 with PomFileTemplate

use of org.eclipse.vorto.codegen.javabean.tasks.template.PomFileTemplate in project vorto by eclipse.

the class JavabeanGenerator method generate.

public IGenerationResult generate(InformationModel infomodel, InvocationContext invocationContext, IVortoCodeGenProgressMonitor monitor) throws VortoCodeGeneratorException {
    GenerationResultZip zipOutputter = new GenerationResultZip(infomodel, getServiceKey());
    for (FunctionblockProperty fbp : infomodel.getProperties()) {
        this.generateForFunctionBlock(infomodel, fbp.getType(), zipOutputter);
        FunctionBlock fb = fbp.getType().getFunctionblock();
        for (Entity entity : Utils.getReferencedEntities(fb)) {
            generateForEntity(infomodel, entity, zipOutputter);
        }
        for (Enum en : Utils.getReferencedEnums(fb)) {
            generateForEnum(infomodel, en, zipOutputter);
        }
    }
    new GeneratorTaskFromFileTemplate<InformationModel>(new PomFileTemplate()).generate(infomodel, invocationContext, zipOutputter);
    return zipOutputter;
}
Also used : Enum(org.eclipse.vorto.core.api.model.datatype.Enum) Entity(org.eclipse.vorto.core.api.model.datatype.Entity) PomFileTemplate(org.eclipse.vorto.codegen.javabean.tasks.template.PomFileTemplate) GenerationResultZip(org.eclipse.vorto.codegen.api.GenerationResultZip) InformationModel(org.eclipse.vorto.core.api.model.informationmodel.InformationModel) FunctionblockProperty(org.eclipse.vorto.core.api.model.informationmodel.FunctionblockProperty) FunctionBlock(org.eclipse.vorto.core.api.model.functionblock.FunctionBlock)

Aggregations

GenerationResultZip (org.eclipse.vorto.codegen.api.GenerationResultZip)1 PomFileTemplate (org.eclipse.vorto.codegen.javabean.tasks.template.PomFileTemplate)1 Entity (org.eclipse.vorto.core.api.model.datatype.Entity)1 Enum (org.eclipse.vorto.core.api.model.datatype.Enum)1 FunctionBlock (org.eclipse.vorto.core.api.model.functionblock.FunctionBlock)1 FunctionblockProperty (org.eclipse.vorto.core.api.model.informationmodel.FunctionblockProperty)1 InformationModel (org.eclipse.vorto.core.api.model.informationmodel.InformationModel)1