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

com.gentleware.poseidon.generator

Class CoreGeneratorController

com.gentleware.poseidon.generator.CoreGeneratorController
All known Subclassifier:
UMLGeneratorController

All known implemented Interfaces:
GeneratorController


public abstract class CoreGeneratorController


This class gives a first implementation of some of the methods declared in GeneratorController. These implementations can be used for a broad number of code generation domains.
Authors:
Thorsten Sturm
See also:
Generator


 Attribute Summary
protected static String  GENERATION_PROBLEM_ERROR_PREFIX
 
protected static String  GENERATION_PROBLEM_WARNING_PREFIX
 
private static String  PROPERTY_CLASS_RESOURCE_LOADER_CLASS
 
private static String  PROPERTY_CLASS_RESOURCE_LOADER_DESCRIPTION
 
private static String  PROPERTY_DIRECTIVE_FOREACH_COUNTER_INITIAL_VALUE
 
protected static String  PROPERTY_FALSE_VALUE
 
private static String  PROPERTY_FILE_RESOURCE_LOADER_CACHE
 
private static String  PROPERTY_FILE_RESOURCE_LOADER_CLASS
 
private static String  PROPERTY_FILE_RESOURCE_LOADER_DESCRIPTION
 
private static String  PROPERTY_FILE_RESOURCE_LOADER_PATH
 
protected static String  PROPERTY_POSEIDON_CODEGEN_COMPILE
 
private static String  PROPERTY_RESOURCE_LOADER
 
private static String  PROPERTY_RESOURCE_MANAGER_LOGWHENFOUND
 
private static String  PROPERTY_RUNTIME_LOG
 
private static String  PROPERTY_TRUE_VALUE
 
private static String  PROPERTY_VELOCIMACRO_LIBRARY
 
private static String  PROPERTY_VELOCIMACRO_PERMISSIONS_ALLOW_INLINE
 
private static String  PROPERTY_VELOCIMACRO_PERMISSIONS_ALLOW_INLINE_TO_REPLACE_GLOBAL
 
private List  _generatedFiles
 
protected String  _languageForGeneratorController
 
private boolean  _macrosPreloaded
 
private boolean  _usesEncryption
 
private List  _validElementClasses
 
arrow_up
 

 Association Summary
private CompilationStrategy  _compilationStrategy
 
private Generator  _generator
 
private TreeRenderingStrategy  _treeRenderingStrategy
 
arrow_up
 

 Constructor Summary
public   CoreGeneratorController()
Public constructor that initializes instance variables. 
arrow_up
 

 Method Summary
protected void   addGeneratedFile(String file)
 
protected void   addGeneratedFiles(List files)
 
public void   addValidElementClass(Class elementClass)
Adds a new element class to the list of element classes valid for code generation using this generator controller. 
protected String   compile(String[] compilationCommand)
 
protected String   compileGeneratedCode(Collection filesToCompile)
 
protected String   extractGenerationProblems(Collection generatedMessages)
 
public CompilationStrategy   getCompilationStrategy()
Returns the compilation strategy associated with this controller. 
public Collection   getGeneratedFiles()
Returns a Vector of Strings containing the full paths to generated files of the last run. 
public Generator   getGenerator()
Returns the generator instance that this generator controller uses. 
public TreeRenderingStrategy   getTreeRenderingStrategy()
Returns the tree display strategy associated with this controller. 
public boolean   hasMacrosPreloaded()
Tests, if an initial loading of the registered velocity macros has been done. 
public void   initGenerator()
Initializes the corresponding Generator instance. 
protected void   initVelocityRuntime()
Initializes the runtime environment of the Velocity Template Engine  
public boolean   isValidElementClass(Object element)
Tests if the given element is of an instance of a class, valid for code generation using this generator controller. 
public void   reloadMacros()
Default implementation that inits the velocity runtime and re-reads all macro libaries. 
public void   removeValidElementClass(Class elementClass)
Removes an element class from the list of element classes valid for code generation using this generator controller. 
protected void   resetGeneratedFiles()
 
public void   resetMacrosPreloaded()
 
public void   setCompilationStrategy(CompilationStrategy strategy)
Sets the compilation strategy to be associated with this controller. 
public void   setGenerator(Generator generator)
Sets the generator instance that this generator controller will use. 
public void   setLanguage(String language)
Sets language for this GeneratorController  
public void   setTreeRenderingStrategy(TreeRenderingStrategy renderingStrategy)
Sets the tree display strategy to be associated with this controller. 
public void   setUsesEncrypted(boolean value)
Sets the template loading method for the generator controller. 
public boolean   usesEncryptedTemplates()
 
private static int   watchCompilerOutput(Process compileProcess, StringBuffer compilerOutput)
 
arrow_up
 

Tagged Values
static false
 

 Attribute Detail

GENERATION_PROBLEM_ERROR_PREFIX

protected static String GENERATION_PROBLEM_ERROR_PREFIX

arrow_up


GENERATION_PROBLEM_WARNING_PREFIX

protected static String GENERATION_PROBLEM_WARNING_PREFIX

arrow_up


PROPERTY_CLASS_RESOURCE_LOADER_CLASS

private static String PROPERTY_CLASS_RESOURCE_LOADER_CLASS

arrow_up


PROPERTY_CLASS_RESOURCE_LOADER_DESCRIPTION

private static String PROPERTY_CLASS_RESOURCE_LOADER_DESCRIPTION

arrow_up


PROPERTY_DIRECTIVE_FOREACH_COUNTER_INITIAL_VALUE

private static String PROPERTY_DIRECTIVE_FOREACH_COUNTER_INITIAL_VALUE

arrow_up


PROPERTY_FALSE_VALUE

protected static String PROPERTY_FALSE_VALUE

arrow_up


PROPERTY_FILE_RESOURCE_LOADER_CACHE

private static String PROPERTY_FILE_RESOURCE_LOADER_CACHE

arrow_up


PROPERTY_FILE_RESOURCE_LOADER_CLASS

private static String PROPERTY_FILE_RESOURCE_LOADER_CLASS

arrow_up


PROPERTY_FILE_RESOURCE_LOADER_DESCRIPTION

private static String PROPERTY_FILE_RESOURCE_LOADER_DESCRIPTION

arrow_up


PROPERTY_FILE_RESOURCE_LOADER_PATH

private static String PROPERTY_FILE_RESOURCE_LOADER_PATH

arrow_up


PROPERTY_POSEIDON_CODEGEN_COMPILE

protected static String PROPERTY_POSEIDON_CODEGEN_COMPILE

arrow_up


PROPERTY_RESOURCE_LOADER

private static String PROPERTY_RESOURCE_LOADER

arrow_up


PROPERTY_RESOURCE_MANAGER_LOGWHENFOUND

private static String PROPERTY_RESOURCE_MANAGER_LOGWHENFOUND

arrow_up


PROPERTY_RUNTIME_LOG

private static String PROPERTY_RUNTIME_LOG

arrow_up


PROPERTY_TRUE_VALUE

private static String PROPERTY_TRUE_VALUE

arrow_up


PROPERTY_VELOCIMACRO_LIBRARY

private static String PROPERTY_VELOCIMACRO_LIBRARY

arrow_up


PROPERTY_VELOCIMACRO_PERMISSIONS_ALLOW_INLINE

private static String PROPERTY_VELOCIMACRO_PERMISSIONS_ALLOW_INLINE

arrow_up


PROPERTY_VELOCIMACRO_PERMISSIONS_ALLOW_INLINE_TO_REPLACE_GLOBAL

private static String PROPERTY_VELOCIMACRO_PERMISSIONS_ALLOW_INLINE_TO_REPLACE_GLOBAL

arrow_up


_generatedFiles

private List _generatedFiles

arrow_up


_languageForGeneratorController

protected String _languageForGeneratorController

arrow_up


_macrosPreloaded

private boolean _macrosPreloaded

arrow_up


_usesEncryption

private boolean _usesEncryption

arrow_up


_validElementClasses

private List _validElementClasses

arrow_up
 Association Detail

_compilationStrategy

private CompilationStrategy _compilationStrategy

arrow_up


_generator

private Generator _generator

arrow_up


_treeRenderingStrategy

private TreeRenderingStrategy _treeRenderingStrategy

arrow_up
 Constructor Detail

CoreGeneratorController

public CoreGeneratorController CoreGeneratorController()


Public constructor that initializes instance variables.  
Returns:
arrow_up
 Method Detail

addGeneratedFile

protected void addGeneratedFile(String file)

Parameters:
file -
arrow_up


addGeneratedFiles

protected void addGeneratedFiles(List files)

Parameters:
files -
arrow_up


addValidElementClass

public void addValidElementClass(Class elementClass)


Adds a new element class to the list of element classes valid for code generation using this generator controller.  
Parameters:
elementClass - Class of elements to be added.
arrow_up


compile

protected String compile(String[] compilationCommand)

Parameters:
compilationCommand -
Returns:
arrow_up


compileGeneratedCode

protected String compileGeneratedCode(Collection filesToCompile)

Parameters:
filesToCompile -
Returns:
arrow_up


extractGenerationProblems

protected String extractGenerationProblems(Collection generatedMessages)

Parameters:
generatedMessages -
Returns:
arrow_up


getCompilationStrategy

public CompilationStrategy getCompilationStrategy()


Returns the compilation strategy associated with this controller.  
Returns:
The compilation strategy.
arrow_up


getGeneratedFiles

public Collection getGeneratedFiles()


Returns a Vector of Strings containing the full paths to generated files of the last run.  
Returns:
Collection of the files generated by the last run of the code generation.
arrow_up


getGenerator

public Generator getGenerator()


Returns the generator instance that this generator controller uses.  
Returns:
The generator instance used by this generator controller.
arrow_up


getTreeRenderingStrategy

public TreeRenderingStrategy getTreeRenderingStrategy()


Returns the tree display strategy associated with this controller.  
Returns:
The tree display strategy.
arrow_up


hasMacrosPreloaded

public boolean hasMacrosPreloaded()


Tests, if an initial loading of the registered velocity macros has been done.  
Returns:
True, if the macros have already been preloaded, otherwise false.
Since:
1.6
arrow_up


initGenerator

public void initGenerator()


Initializes the corresponding Generator instance.  
arrow_up


initVelocityRuntime

protected void initVelocityRuntime()


Initializes the runtime environment of the Velocity Template Engine  
arrow_up


isValidElementClass

public boolean isValidElementClass(Object element)


Tests if the given element is of an instance of a class, valid for code generation using this generator controller.  
Parameters:
element - Element instance to be tested.
Returns:
True, if element is instance of valid class, otherwise false.
arrow_up


reloadMacros

public void reloadMacros()


Default implementation that inits the velocity runtime and re-reads all macro libaries.  
arrow_up


removeValidElementClass

public void removeValidElementClass(Class elementClass)


Removes an element class from the list of element classes valid for code generation using this generator controller.  
Parameters:
elementClass - Class of elements to be removed.
arrow_up


resetGeneratedFiles

protected void resetGeneratedFiles()

arrow_up


resetMacrosPreloaded

public void resetMacrosPreloaded()

arrow_up


setCompilationStrategy

public void setCompilationStrategy(CompilationStrategy strategy)


Sets the compilation strategy to be associated with this controller.  
Parameters:
strategy - The compilation strategy to be set.
arrow_up


setGenerator

public void setGenerator(Generator generator)


Sets the generator instance that this generator controller will use.  
Parameters:
generator - The generator instance to used by this generator controller.
arrow_up


setLanguage

public void setLanguage(String language)


Sets language for this GeneratorController  
Parameters:
language -
arrow_up


setTreeRenderingStrategy

public void setTreeRenderingStrategy(TreeRenderingStrategy renderingStrategy)


Sets the tree display strategy to be associated with this controller.  
Parameters:
renderingStrategy - The tree display strategy to be set.
arrow_up


setUsesEncrypted

public void setUsesEncrypted(boolean value)


Sets the template loading method for the generator controller. A generator controller can either load encrypted templates or not.  
Parameters:
value - True if the generator controller should load encrypted templates, otherwise false.
arrow_up


usesEncryptedTemplates

public boolean usesEncryptedTemplates()

Returns:
arrow_up


watchCompilerOutput

private static int watchCompilerOutput(Process compileProcess, StringBuffer compilerOutput)

Parameters:
compileProcess -
compilerOutput -
Returns:
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.