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 TemplateConfiguration
configuration
protected List<String>
excludeTemplates
protected List<String>
generatedPackages
List of package to allow generation.protected M
model
Modelprotected ResourcesHelper
resourcesHelper
-
Fields inherited from interface org.nuiton.eugene.TemplateConfiguration
PROP_CLASS_LOADER, PROP_DEFAULT_PACKAGE, PROP_ENCODING, PROP_EXCLUDE_TEMPLATES, PROP_GENERATED_PACKAGES, PROP_LAST_MODIFIED_SOURCE, PROP_OVERWRITE, 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 void
applyTemplate(M model, File destDir)
ClassLoader
getClassLoader()
TemplateConfiguration
getConfiguration()
String
getEncoding()
List<String>
getExcludeTemplates()
protected List<String>
getGeneratedPackages()
long
getLastModifiedSource()
M
getModel()
boolean
getOverwrite()
Deprecated.since 2.0.2, prefer use theisOverwrite()
methodProperties
getProperties()
String
getProperty(String key)
<V> V
getProperty(String key, Class<V> type)
protected ResourcesHelper
getResourcesHelper()
WriterReport
getWriterReport()
boolean
isOverwrite()
boolean
isVerbose()
void
setConfiguration(TemplateConfiguration configuration)
void
setProperty(String key, Object value)
-
-
-
Field Detail
-
configuration
protected TemplateConfiguration configuration
-
generatedPackages
protected List<String> generatedPackages
List of package to allow generation. Ifnull
or empty, generate all packages.
-
resourcesHelper
protected ResourcesHelper resourcesHelper
-
-
Method Detail
-
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:
true
if must overwrite ouput
-
isOverwrite
public boolean isOverwrite()
- Specified by:
isOverwrite
in interfaceTemplateConfiguration
- Returns:
true
if must regenerate files even if they are up to date
-
isVerbose
public boolean isVerbose()
- Specified by:
isVerbose
in interfaceTemplateConfiguration
- Returns:
true
if build is verbose.
-
getEncoding
public String getEncoding()
- Specified by:
getEncoding
in interfaceTemplateConfiguration
- Returns:
- encoding to use to read and write files
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfaceTemplateConfiguration
- Returns:
- the classloader to use to seek for resources
-
getLastModifiedSource
public long getLastModifiedSource()
- Specified by:
getLastModifiedSource
in interfaceTemplateConfiguration
-
getProperties
public Properties getProperties()
- Specified by:
getProperties
in interfaceTemplateConfiguration
-
getProperty
public <V> V getProperty(String key, Class<V> type)
- Specified by:
getProperty
in interfaceTemplateConfiguration
-
getProperty
public String getProperty(String key)
- Specified by:
getProperty
in interfaceTemplateConfiguration
-
getWriterReport
public WriterReport getWriterReport()
- Specified by:
getWriterReport
in interfaceTemplateConfiguration
-
setProperty
public void setProperty(String key, Object value)
- Specified by:
setProperty
in interfaceTemplateConfiguration
-
getModel
public M getModel()
-
getResourcesHelper
protected ResourcesHelper getResourcesHelper()
-
-