use of org.talend.designer.codegen.config.JetBean in project tdi-studio-se by Talend.
the class CodeGenerator method initializeJetBean.
/**
* Initialize Jet Bean to pass to the Jet Generator.
*
* @param argument the node to convert
* @return the initialized JetBean
*/
private JetBean initializeJetBean(Object argument) {
JetBean jetBean = new JetBean();
if (argument == null) {
jetBean.setJetPluginRepository(CodeGeneratorActivator.PLUGIN_ID);
} else {
if (argument instanceof CodeGeneratorArgument) {
CodeGeneratorArgument codeArgument = (CodeGeneratorArgument) argument;
if (codeArgument.getArgument() instanceof INode) {
String componentsPath = IComponentsFactory.COMPONENTS_LOCATION;
IBrandingService breaningService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
if (breaningService.isPoweredOnlyCamel()) {
componentsPath = IComponentsFactory.CAMEL_COMPONENTS_LOCATION;
}
jetBean.setJetPluginRepository(componentsPath);
} else {
jetBean.setJetPluginRepository(CodeGeneratorActivator.PLUGIN_ID);
}
} else {
jetBean.setJetPluginRepository(CodeGeneratorActivator.PLUGIN_ID);
}
}
jetBean.setArgument(argument);
return jetBean;
}
Aggregations