org.eclipse.mtl.engine.generation
Class MTLGenericEngine

java.lang.Object
  extended by org.eclipse.mtl.engine.generation.MTLGenericEngine
All Implemented Interfaces:
IMTLEngine

public class MTLGenericEngine
extends java.lang.Object
implements IMTLEngine

This class can be used to launch the generation of an MTL template.


Constructor Summary
MTLGenericEngine()
           
 
Method Summary
 void addListener(MTLTextGenerationListener listener)
          Registers a listener to be notified for any text generation that will take place in this engine evaluation process.
 void evaluate(Template template, java.util.List<? extends java.lang.Object> arguments, java.io.File generationRoot)
          Evaluates the given MTL Template with the given arguments.
 void removeListener(MTLTextGenerationListener listener)
          Removes a listener from the notification loops.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MTLGenericEngine

public MTLGenericEngine()
Method Detail

addListener

public void addListener(MTLTextGenerationListener listener)
Registers a listener to be notified for any text generation that will take place in this engine evaluation process.

Specified by:
addListener in interface IMTLEngine
Parameters:
listener - The new listener that is to be registered for notification.
See Also:
IMTLEngine.addListener(org.eclipse.mtl.engine.event.MTLTextGenerationListener)

evaluate

public void evaluate(Template template,
                     java.util.List<? extends java.lang.Object> arguments,
                     java.io.File generationRoot)
Evaluates the given MTL Template with the given arguments.

generationRoot will be used as the root of all generated files. For example, a template such as

 [template generate(c:EClass)]
 [file(log.log, true)]processing class [c.name/][/file]
 [/template]
 
evaluated with file:\\c:\ as generationRoot would create the file c:\log.log and generate a line "processing class <className>" for the argument.

Specified by:
evaluate in interface IMTLEngine
Parameters:
template - The MTL template which is to be evaluated.
arguments - List of the template's arguments.
generationRoot - This will be used as the root for the generated files.
See Also:
IMTLEngine.evaluate(org.eclipse.mtl.Template, java.util.List, java.io.File)

removeListener

public void removeListener(MTLTextGenerationListener listener)
Removes a listener from the notification loops.

Specified by:
removeListener in interface IMTLEngine
Parameters:
listener - The listener that is to be removed from this engine's notification loops.
See Also:
IMTLEngine.removeListener(org.eclipse.mtl.engine.event.MTLTextGenerationListener)

Copyright 2008 Obeo
All Rights Reserved.