org.eclipse.mtl.engine.generation
Interface IMTLEngine

All Known Implementing Classes:
MTLGenericEngine

public interface IMTLEngine

Base interface for all implementation of an MTL evaluation engine.


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.
 

Method Detail

addListener

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

Parameters:
listener - The new listener that is to be registered for notification.

evaluate

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.

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.

removeListener

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

Parameters:
listener - The listener that is to be removed from this engine's notification loops.

Copyright 2008 Obeo
All Rights Reserved.