VelocityContext context = new VelocityContext();
Template template = getTemplate();
// Put common properties
List<ListenerBean> listeners = config.getListeners();
for (ListenerBean bean : listeners) {
TagBean tagHandler = bean.getTag();
if ( null != tagHandler && tagHandler.isGenerate() && null !=tagHandler.getClassname()) {
context.put("tag", tagHandler);
context.put("listener", bean);
String resultPath = tagHandler.getClassname().replace('.', '/')
+ ".java";
File javaFile = new File(getDestDir(), resultPath);
File javaDir = javaFile.getParentFile();
if (!javaDir.exists()) {
javaDir.mkdirs();