//
// baseclass = baseclass.getSuperclass();
// } while (baseclass != null);
// }
TemplateCompiler templateCompiler = new TemplateCompiler();
InputStream templateStream = new FileInputStream(template);
templateCompiler.processing(templateStream, rendererBean);
renderer.setClassname(rendererBean.getFullClassName());
String resultPath = rendererBean.getComponentFileName();
if (null == getPackage()) {
resultPath = resultPath.replace('.', '/');
} else {
resultPath = getPackage().replace('.', '/') + "/"
+ resultPath;
}
File javaFile = new File(getDestDir(), resultPath + ".java");
File javaDir = javaFile.getParentFile();
if (!javaDir.exists()) {
javaDir.mkdirs();
}
if (javaFile.exists()) {
if (renderer.isOverride()) {
javaFile.delete();
} else {
return;
}
}
Writer out = new BufferedWriter(new FileWriter(javaFile));
templateCompiler.generateCode(rendererBean, out);
out.flush();
out.close();
} catch (Exception e) {
throw new GeneratorException(
"Error create Renderer Java file ", e);