Package org.nuiton.eugene
Class Template<M extends Model>
- java.lang.Object
-
- org.nuiton.eugene.Template<M>
-
- Type Parameters:
M- Model associated to the generator (input model)
- All Implemented Interfaces:
TemplateConfiguration
- Direct Known Subclasses:
AbstractGenerator,Transformer
public abstract class Template<M extends Model> extends Object implements TemplateConfiguration
Template. TODO javadoc Created: 5 août 2004- Author:
- Cédric Pineau - pineau@codelutin.com
-
-
Field Summary
Fields Modifier and Type Field Description protected TemplateConfigurationconfigurationprotected List<String>excludeTemplatesprotected List<String>generatedPackagesList of package to allow generation.protected MmodelModelprotected ResourcesHelperresourcesHelper-
Fields inherited from interface org.nuiton.eugene.TemplateConfiguration
PROP_CLASS_LOADER, PROP_DEFAULT_PACKAGE, PROP_ENCODING, PROP_EXCLUDE_TEMPLATES, PROP_GENERATED_PACKAGES, PROP_I18N_GETTER_FILE, PROP_LAST_MODIFIED_SOURCE, PROP_OUTPUT_DIRECTORY, PROP_OVERWRITE, PROP_RESOURCE_DIRECTORY, PROP_VERBOSE, PROP_WRITER_REPORT
-
-
Constructor Summary
Constructors Constructor Description Template()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract voidapplyTemplate(M model, File destDir)ClassLoadergetClassLoader()TemplateConfigurationgetConfiguration()StringgetEncoding()List<String>getExcludeTemplates()protected List<String>getGeneratedPackages()longgetLastModifiedSource()protected LogProxygetLog()MgetModel()booleangetOverwrite()Deprecated.since 2.0.2, prefer use theisOverwrite()methodPropertiesgetProperties()StringgetProperty(String key)<V> VgetProperty(String key, Class<V> type)protected ResourcesHelpergetResourcesHelper()WriterReportgetWriterReport()booleanisOverwrite()booleanisVerbose()voidsetConfiguration(TemplateConfiguration configuration)voidsetLog(LogProxy log)voidsetProperty(String key, Object value)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuiton.eugene.TemplateConfiguration
getI18nGetterFile, setI18nGetterFile
-
-
-
-
Field Detail
-
configuration
protected TemplateConfiguration configuration
-
generatedPackages
protected List<String> generatedPackages
List of package to allow generation. Ifnullor empty, generate all packages.
-
resourcesHelper
protected ResourcesHelper resourcesHelper
-
-
Method Detail
-
getLog
protected LogProxy getLog()
-
setLog
public void setLog(LogProxy log)
-
applyTemplate
public abstract void applyTemplate(M model, File destDir) throws IOException
- Throws:
IOException
-
getConfiguration
public TemplateConfiguration getConfiguration()
-
setConfiguration
public void setConfiguration(TemplateConfiguration configuration)
-
getOverwrite
@Deprecated public boolean getOverwrite()
Deprecated.since 2.0.2, prefer use theisOverwrite()method- Returns:
trueif must overwrite ouput
-
isOverwrite
public boolean isOverwrite()
- Specified by:
isOverwritein interfaceTemplateConfiguration- Returns:
trueif must regenerate files even if they are up to date
-
isVerbose
public boolean isVerbose()
- Specified by:
isVerbosein interfaceTemplateConfiguration- Returns:
trueif build is verbose.
-
getEncoding
public String getEncoding()
- Specified by:
getEncodingin interfaceTemplateConfiguration- Returns:
- encoding to use to read and write files
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoaderin interfaceTemplateConfiguration- Returns:
- the classloader to use to seek for resources
-
getLastModifiedSource
public long getLastModifiedSource()
- Specified by:
getLastModifiedSourcein interfaceTemplateConfiguration
-
getProperties
public Properties getProperties()
- Specified by:
getPropertiesin interfaceTemplateConfiguration
-
getProperty
public <V> V getProperty(String key, Class<V> type)
- Specified by:
getPropertyin interfaceTemplateConfiguration
-
getProperty
public String getProperty(String key)
- Specified by:
getPropertyin interfaceTemplateConfiguration
-
getWriterReport
public WriterReport getWriterReport()
- Specified by:
getWriterReportin interfaceTemplateConfiguration
-
setProperty
public void setProperty(String key, Object value)
- Specified by:
setPropertyin interfaceTemplateConfiguration
-
getModel
public M getModel()
-
getResourcesHelper
protected ResourcesHelper getResourcesHelper()
-
-