use of org.talend.designer.codegen.config.TemplateUtil in project tesb-studio-se by Talend.
the class ContextPartGenerator method generatePart.
public CharSequence generatePart(IContext designerContext) throws CodeGeneratorException {
List<IContextParameter> listParameters = designerContext.getContextParameterList();
if (listParameters == null) {
return "";
}
CodeGeneratorArgument codeGenArgument = argumentBuilder.build();
codeGenArgument.setContextName(designerContext.getName());
List<IContextParameter> listParametersCopy = tranformEncryptedParams(listParameters);
codeGenArgument.setNode(listParametersCopy);
JetBean jetBean = JetUtil.createJetBean(codeGenArgument);
CodeGeneratorInternalTemplatesFactory codegenTemplatesFactory = CodeGeneratorInternalTemplatesFactoryProvider.getInstance();
if (codegenTemplatesFactory.getTemplates() == null) {
codegenTemplatesFactory.init();
}
for (TemplateUtil template : codegenTemplatesFactory.getTemplatesFromType(EInternalTemplate.CONTEXT)) {
jetBean.setJetPluginRepository(template.getJetPluginRepository());
jetBean.setTemplateRelativeUri(template.getTemplateRelativeUri());
}
return JetUtil.jetGenerate(jetBean);
}
Aggregations