Search in sources :

Example 1 with EntityClassTemplate

use of org.eclipse.vorto.codegen.ios.templates.EntityClassTemplate in project vorto by eclipse.

the class IOSPlatformGenerator method generate.

@Override
public IGenerationResult generate(InformationModel context, InvocationContext invocationContext, IVortoCodeGenProgressMonitor monitor) throws VortoCodeGeneratorException {
    GenerationResultZip outputter = new GenerationResultZip(context, getServiceKey());
    ChainedCodeGeneratorTask<InformationModel> generator = new ChainedCodeGeneratorTask<InformationModel>();
    generator.addTask(new DatatypeGeneratorTask(new EntityClassTemplate(), new EnumClassTemplate()));
    IMapped<InformationModel> mappedElement = invocationContext.getMappedElement(context, "binding");
    if (mappedElement.hasAttribute("ble")) {
        generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new CoreBluetoothDetectionTemplate()));
        generator.addTask(new GeneratorTaskFromFileTemplate<InformationModel>(new DeviceServiceTemplate()));
    }
    generator.generate(context, invocationContext, outputter);
    return outputter;
}
Also used : EnumClassTemplate(org.eclipse.vorto.codegen.ios.templates.EnumClassTemplate) EntityClassTemplate(org.eclipse.vorto.codegen.ios.templates.EntityClassTemplate) GenerationResultZip(org.eclipse.vorto.codegen.api.GenerationResultZip) DeviceServiceTemplate(org.eclipse.vorto.codegen.ios.templates.DeviceServiceTemplate) InformationModel(org.eclipse.vorto.core.api.model.informationmodel.InformationModel) ChainedCodeGeneratorTask(org.eclipse.vorto.codegen.api.ChainedCodeGeneratorTask) CoreBluetoothDetectionTemplate(org.eclipse.vorto.codegen.ios.templates.CoreBluetoothDetectionTemplate) DatatypeGeneratorTask(org.eclipse.vorto.codegen.api.DatatypeGeneratorTask)

Aggregations

ChainedCodeGeneratorTask (org.eclipse.vorto.codegen.api.ChainedCodeGeneratorTask)1 DatatypeGeneratorTask (org.eclipse.vorto.codegen.api.DatatypeGeneratorTask)1 GenerationResultZip (org.eclipse.vorto.codegen.api.GenerationResultZip)1 CoreBluetoothDetectionTemplate (org.eclipse.vorto.codegen.ios.templates.CoreBluetoothDetectionTemplate)1 DeviceServiceTemplate (org.eclipse.vorto.codegen.ios.templates.DeviceServiceTemplate)1 EntityClassTemplate (org.eclipse.vorto.codegen.ios.templates.EntityClassTemplate)1 EnumClassTemplate (org.eclipse.vorto.codegen.ios.templates.EnumClassTemplate)1 InformationModel (org.eclipse.vorto.core.api.model.informationmodel.InformationModel)1