Poseidon for UMLTM
  UMLdoc
 PREV      NEXT       FRAMES    NO FRAMES      

com.gentleware.poseidon.generator

Interface Generator

com.gentleware.poseidon.generator.Generator

public interface Generator


The Generator handles the preparation of code relevant information and the generation of the code to a given target. For preparation, the Generator uses a corresponding ElementPreparator.
Authors:
Thorsten Sturm
See also:
ElementPreparator


 Association Summary
public CoreGeneratorController  coreGeneratorController
 
arrow_up
 

 Method Summary
public void   addExternalLibraries(String origin, List libraries)
Adds a list of paths to externally known macro libraries and maps them to origin of knowledge. 
public void   addExternalLibraries(String origin, List libraries, boolean treatAsUnencrypted)
Adds a list of paths to externally known macro libraries and maps them to origin of knowledge. 
public boolean   addMacroLibrary(String path)
Adds the path to a new macro library to the list of needed libraries. 
public boolean   addMacroLibrary(String path, boolean treatAsUnencrypted)
Adds the path to a new macro library to the list of needed libraries. 
public void   generatePost(String path)
Contains actions, that should be done after the generation itself. 
public void   generatePre(String path)
Contains actions, that should be done prior to the generation itself. 
public String   generateTarget(Object element, Object predicate, int templateIndex)
Generates the code for the given element. 
public List   generateTargets(Object element, String targetLocation, Object predicate)
Generates the code for the given element at the desired target location. 
public Map   getFilenamesForElement(Object element, String targetLocation)
The list of filenames where the element's contents end up, or null if the element has no own file. 
public List   getMacroLibraries()
Returns the velocity macro libraries that need to be added to the macro pool in order to make the code generation work. 
public String   getPlainFilenameForElement(Object element, String targetLocation)
Returns the plain filename for the given element. 
public ElementPreparator   getPreparator()
Returns the corresponding ElementPreparator instance. 
public CodeTemplateManager   getTemplateManager()
Returns the CodeTemplateManager currently registered for this generator. 
public void   init()
Intializes the Generator  
public void   initInternal()
 
public void   initInternalJava()
 
public boolean   isInitialized()
 
public void   prepareFromRootElement(CheckNode root)
Starts preparing the element information, starting with the given root element and moving recursively down the tree. 
public void   preparePost(Object element, String path, Object caller)
Contains actions, that should be done after the preparation process itself. 
public void   preparePre(Object element, String path, Object caller)
Contains actions, that should be done prior to the preparation process itself. 
public void   removeExternalLibraries(String origin)
Removes the list of paths to macro libraries known from the given origin. 
public boolean   removeMacroLibrary(String path)
Removes the macro library at the given path from the list of needed libraries. 
public void   setExternalLibraryStrategy(ExternalEntryStrategy strategy)
Set the strategy used to decide how to handle external libraries. 
public void   setTemplateManager(CodeTemplateManager templateManager)
Sets the CodeTemplateManager to be used by this generator to a new instance. 
public void   setTemplateStrategy(TemplateStrategy strategy)
Set the strategy used to handle templates for special element classes. 
public boolean   usesPredicates()
Tests, if the generator controller should use the predicate-based generation framework. 
arrow_up
 

Tagged Values
static false
 

 Association Detail

coreGeneratorController

public CoreGeneratorController coreGeneratorController

arrow_up
 Method Detail

addExternalLibraries

public void addExternalLibraries(String origin, List libraries)


Adds a list of paths to externally known macro libraries and maps them to origin of knowledge. All contained libraries will be treated as unencrypted.  
Parameters:
origin - Place where the knowledge about the libraries comes from (e.g. a plugin).
libraries - List of paths to the externally known macro libraries.
arrow_up


addExternalLibraries

public void addExternalLibraries(String origin, List libraries, boolean treatAsUnencrypted)


Adds a list of paths to externally known macro libraries and maps them to origin of knowledge.  
Parameters:
origin - Place where the knowledge about the libraries comes from (e.g. a plugin).
libraries - List of paths to the externally known macro libraries.
treatAsUnencrypted - True, if the libraries should be treated as unencrypted.
arrow_up


addMacroLibrary

public boolean addMacroLibrary(String path)


Adds the path to a new macro library to the list of needed libraries. The library will be treated as unencrypted.  
Parameters:
path - Path to the new macro library.
Returns:
True, if adding was successful, otherwise false.
arrow_up


addMacroLibrary

public boolean addMacroLibrary(String path, boolean treatAsUnencrypted)


Adds the path to a new macro library to the list of needed libraries.  
Parameters:
path - Path to the new macro library.
treatAsUnencrypted - True, if the template should be treated as unencrypted.
Returns:
True, if adding was successful, otherwise false.
arrow_up


generatePost

public void generatePost(String path)


Contains actions, that should be done after the generation itself.  
Parameters:
path - Path to the target of the code generation.
arrow_up


generatePre

public void generatePre(String path)


Contains actions, that should be done prior to the generation itself.  
Parameters:
path - Path to the target of the code generation.
arrow_up


generateTarget

public String generateTarget(Object element, Object predicate, int templateIndex)


Generates the code for the given element. The template to be used for the generation process is identified by the given predicate and its index in the identified template set.  
Parameters:
element - The element code should generated for.
predicate - The predicate used to find out the right template set. May be null.
templateIndex - The index of the template in the template set identified through the predicate.
Returns:
The generated code.
Since:
1.6
arrow_up


generateTargets

public List generateTargets(Object element, String targetLocation, Object predicate)


Generates the code for the given element at the desired target location. The target location usually describes the path to a file, but can also be something different (e.g. a table in a relational database). If the targetLocation is set to null, the generation assumes a display as target. Multiple files can be created for reflecting different parts of the code.  
Parameters:
element - The element code should generated for.
targetLocation - A String describing the location of the target or null.
predicate - The predicate used to determine the right set of code template to use.
Returns:
The paths to the target location or the generated code when no target is specified.
Since:
1.6
arrow_up


getFilenamesForElement

public Map getFilenamesForElement(Object element, String targetLocation)


The list of filenames where the element's contents end up, or null if the element has no own file.  
Parameters:
element - The element to calculate the filenames for.
targetLocation - The directory where the generated files should be created in.
Returns:
A map holding the calculated filename for each registered suffix associated to the suffix.
Since:
1.6
arrow_up


getMacroLibraries

public List getMacroLibraries()


Returns the velocity macro libraries that need to be added to the macro pool in order to make the code generation work.  
Returns:
List of paths to the needed macro libraries. Each entry is a String.
arrow_up


getPlainFilenameForElement

public String getPlainFilenameForElement(Object element, String targetLocation)


Returns the plain filename for the given element. No extensions are used to calculate the name.  
Parameters:
element - The element to calculate the name for.
targetLocation - The directory where the generated files should be created in.
Returns:
A string representing the calculated plain name.
Since:
1.6
arrow_up


getPreparator

public ElementPreparator getPreparator()


Returns the corresponding ElementPreparator instance.  
Returns:
The corresponding instance of ElementPreparator.
arrow_up


getTemplateManager

public CodeTemplateManager getTemplateManager()


Returns the CodeTemplateManager currently registered for this generator.  
Returns:
The currently registered CodeTemplateManager.
Since:
1.6
arrow_up


init

public void init()


Intializes the Generator  
arrow_up


initInternal

public void initInternal()

arrow_up


initInternalJava

public void initInternalJava()

arrow_up


isInitialized

public boolean isInitialized()

Returns:
arrow_up


prepareFromRootElement

public void prepareFromRootElement(CheckNode root)


Starts preparing the element information, starting with the given root element and moving recursively down the tree.  
Parameters:
root - Root node of the element tree used for retrieving the element information.
arrow_up


preparePost

public void preparePost(Object element, String path, Object caller)


Contains actions, that should be done after the preparation process itself.  
Parameters:
element - The element that has just been prepared.
path - Path to the target of the code generation.
caller - Object that is calling this operation.
arrow_up


preparePre

public void preparePre(Object element, String path, Object caller)


Contains actions, that should be done prior to the preparation process itself.  
Parameters:
element - The element that is going to be prepared.
path - Path to the target of the code generation.
caller - Object that is calling this operation.
arrow_up


removeExternalLibraries

public void removeExternalLibraries(String origin)


Removes the list of paths to macro libraries known from the given origin.  
Parameters:
origin - Place where the knowledge about the libraries comes from (e.g. a plugin).
arrow_up


removeMacroLibrary

public boolean removeMacroLibrary(String path)


Removes the macro library at the given path from the list of needed libraries.  
Parameters:
path - Path to the macro library.
Returns:
True, if removing was successful, otherwise false.
arrow_up


setExternalLibraryStrategy

public void setExternalLibraryStrategy(ExternalEntryStrategy strategy)


Set the strategy used to decide how to handle external libraries.  
Parameters:
strategy - The strategy containing the decision implementation.
arrow_up


setTemplateManager

public void setTemplateManager(CodeTemplateManager templateManager)


Sets the CodeTemplateManager to be used by this generator to a new instance.  
Parameters:
templateManager - The new instance of CodeTemplateManager.
Since:
1.6
arrow_up


setTemplateStrategy

public void setTemplateStrategy(TemplateStrategy strategy)


Set the strategy used to handle templates for special element classes.  
Parameters:
strategy - The strategy containing the handling implementation.
arrow_up


usesPredicates

public boolean usesPredicates()


Tests, if the generator controller should use the predicate-based generation framework.  
Returns:
True, if the predicate-based generation framework should be used, otherwise false.
Since:
1.6
arrow_up
Created  2004 - 10 - 21

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.