|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.eugene.Template<I>
org.nuiton.eugene.Transformer<I,O>
I - input model to transformO - output model transformedpublic abstract class Transformer<I extends Model,O extends Model>
Transformer Created: 28 oct. 2009
| Field Summary | |
|---|---|
protected O |
outputModel
Output model. |
protected Properties |
outputProperties
Properties for output generator. |
protected Template<O> |
outputTemplate
Output generator, to generate files from Output model. |
protected Transformer<I,I> |
previousTransformer
Previous transformer to modify input model |
| Fields inherited from class org.nuiton.eugene.Template |
|---|
configuration, excludeTemplates, generatedPackages, model |
| 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 | |
|---|---|
Transformer()
|
|
| Method Summary | |
|---|---|
void |
applyTemplate(I model,
File destDir)
This method apply the current transformation. |
O |
getOutputModel()
|
protected Properties |
getOutputProperties()
Output properties for output generator. |
Template<O> |
getOutputTemplate()
|
protected void |
init(I model)
Initialization of the Transformer : |
protected abstract O |
initOutputModel()
Initialization of the Output model. |
protected abstract Template<O> |
initOutputTemplate()
Initialization of the Output generator. |
protected Transformer<I,I> |
initPreviousTransformer()
|
protected abstract void |
transform()
Method to override for the transformation. |
void |
transform(I model)
Transformation method from an input Model. |
| Methods inherited from class org.nuiton.eugene.Template |
|---|
getClassLoader, getConfiguration, getEncoding, getExcludeTemplates, getGeneratedPackages, getLastModifiedSource, getModel, getOverwrite, getProperties, getProperty, getProperty, getWriterReport, isOverwrite, isVerbose, setConfiguration, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Template<O extends Model> outputTemplate
protected Transformer<I extends Model,I extends Model> previousTransformer
protected O extends Model outputModel
protected Properties outputProperties
| Constructor Detail |
|---|
public Transformer()
| Method Detail |
|---|
protected void init(I model)
- initOutputModel : default, do nothing - initOutputGenerator : must be override to instanciate output Generator - initOutputModel : must be override to instanciate output Model
model - input modelprotected Transformer<I,I> initPreviousTransformer()
protected abstract Template<O> initOutputTemplate()
protected abstract O initOutputModel()
protected Properties getOutputProperties()
public Template<O> getOutputTemplate()
public O getOutputModel()
public void applyTemplate(I model,
File destDir)
throws IOException
initPreviousTransformer() method. In this case, the current
transformation will be apply on the output model of the previous one.
In the simple other case, the current transformation transform the
input model into an output model. You must override
initOutputModel() and initOutputTemplate() methods
to initialize output model and output template to apply (generally a
generator).
applyTemplate in class Template<I extends Model>model - input model to transform and generatedestDir - destination directory to put generated files
IOExceptionpublic void transform(I model)
init(Model) method.
model - input modelprotected abstract void transform()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||