1 23 24 package org.objectweb.jorm.generator.lib; 25 26 import org.apache.velocity.Template; 27 import org.apache.velocity.app.VelocityEngine; 28 import org.objectweb.jorm.util.api.Loggable; 29 import org.objectweb.util.monolog.api.Logger; 30 import org.objectweb.util.monolog.api.LoggerFactory; 31 32 36 public abstract class CommonGenerator extends CommonHelper implements Loggable { 37 40 public static final String MAPPER_TEMPLATE_DIR = 41 "org/objectweb/jorm/mapper/"; 42 public static final String GEN_TEMPLATE_DIR = 43 "org/objectweb/jorm/generator/lib/"; 44 45 48 protected Logger logger = null; 49 50 53 protected LoggerFactory loggerFactory = null; 54 55 protected VelocityEngine velocityEngine = null; 56 57 60 protected Template template = null; 61 62 64 public void setLoggerFactory(LoggerFactory lf) { 65 if (logger == null && lf != null) 66 logger = lf.getLogger(getClass().getName()); 67 loggerFactory = lf; 68 } 69 70 public void setLogger(Logger l) { 71 logger = l; 72 } 73 74 public Logger getLogger() { 75 return logger; 76 } 77 78 public LoggerFactory getLoggerFactory() { 79 return loggerFactory; 80 } 81 82 84 public void setVelocityEngine(VelocityEngine ve) { 85 velocityEngine = ve; 86 } 87 88 public String [][] getTemplateLibraries() { 89 return new String [0][]; 90 } 91 } 92 | Popular Tags |