Search in sources :

Example 1 with JavaFunctionblockFaultGeneratorTask

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

the class JavabeanGenerator method generateForFunctionBlock.

private void generateForFunctionBlock(InformationModel infomodel, FunctionblockModel fbm, IGeneratedWriter outputter) {
    ChainedCodeGeneratorTask<FunctionblockModel> generator = new ChainedCodeGeneratorTask<FunctionblockModel>();
    if (fbm.getFunctionblock().getStatus() != null) {
        generator.addTask(new JavaFunctionblockStatusGeneratorTask(JAVA_FILE_EXTENSION, FB_TARGET_PATH, FB_PACKAGE, JAVA_INTERFACE_PREFIX, STATUS_SUFFIX, ENTITY_PACKAGE));
    }
    if (fbm.getFunctionblock().getConfiguration() != null) {
        generator.addTask(new JavaFunctionblockConfigurationGeneratorTask(JAVA_FILE_EXTENSION, FB_TARGET_PATH, FB_PACKAGE, JAVA_INTERFACE_PREFIX, CONFIG_SUFFIX, ENTITY_PACKAGE));
    }
    if (fbm.getFunctionblock().getFault() != null) {
        generator.addTask(new JavaFunctionblockFaultGeneratorTask(JAVA_FILE_EXTENSION, FB_TARGET_PATH, FB_PACKAGE, JAVA_INTERFACE_PREFIX, FAULT_SUFFIX, ENTITY_PACKAGE));
    }
    generator.addTask(new JavaFunctionblockImplGeneratorTask(JAVA_FILE_EXTENSION, FB_TARGET_PATH, FB_PACKAGE, JAVA_INTERFACE_PREFIX, JAVA_IMPL_SUFFIX, ENTITY_PACKAGE));
    generator.addTask(new JavaFunctionblockInterfaceGeneratorTask(JAVA_FILE_EXTENSION, FB_TARGET_PATH, FB_PACKAGE, JAVA_INTERFACE_PREFIX, ENTITY_PACKAGE));
    generator.generate(fbm, null, outputter);
}
Also used : FunctionblockModel(org.eclipse.vorto.core.api.model.functionblock.FunctionblockModel) ChainedCodeGeneratorTask(org.eclipse.vorto.codegen.api.ChainedCodeGeneratorTask) JavaFunctionblockInterfaceGeneratorTask(org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockInterfaceGeneratorTask) JavaFunctionblockConfigurationGeneratorTask(org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockConfigurationGeneratorTask) JavaFunctionblockStatusGeneratorTask(org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockStatusGeneratorTask) JavaFunctionblockFaultGeneratorTask(org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockFaultGeneratorTask) JavaFunctionblockImplGeneratorTask(org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockImplGeneratorTask)

Aggregations

ChainedCodeGeneratorTask (org.eclipse.vorto.codegen.api.ChainedCodeGeneratorTask)1 JavaFunctionblockConfigurationGeneratorTask (org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockConfigurationGeneratorTask)1 JavaFunctionblockFaultGeneratorTask (org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockFaultGeneratorTask)1 JavaFunctionblockImplGeneratorTask (org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockImplGeneratorTask)1 JavaFunctionblockInterfaceGeneratorTask (org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockInterfaceGeneratorTask)1 JavaFunctionblockStatusGeneratorTask (org.eclipse.vorto.codegen.javabean.tasks.JavaFunctionblockStatusGeneratorTask)1 FunctionblockModel (org.eclipse.vorto.core.api.model.functionblock.FunctionblockModel)1