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 GeneratorFactory


public class GeneratorFactory

This class represents a factory for the basic facilities of the code generation. It holds the configuration and a list of known generation controllers. The GeneratorFactory is a singleton.
See also:
GeneratorController


 Attribute Summary
public static String  CONFIGURATION_PREFIX
Represents . 
arrow_up
 

 Method Summary
public void   addActionListener(ActionListener listener )
Removes a listener from the list of known listeners. 
public boolean   addGeneratorController(String origin , GeneratorController controller )
Adds a generator controller to the collection of known generator controllers. 
public void   addMacroLibrary(String file )
Adds a new velocity macro library to the list of known macro libraries. 
public void   addMacroLibrary(String file , boolean treatAsUnencrypted )
Adds a new velocity macro library to the list of known macro libraries. 
public void   addUnencryptedTemplateOrLibrary(String name )
Adds the macro library or template with the given file name to the list of macros/templates that should be treated as unencrypted. 
public void   fireGenerationDone()
Fires an event indicating that the generation process is finished to all known listeners. 
public String   getCompiledExtension()
Returns the default file extension of compiled files for the currently adjusted target language. 
public Map   getConfiguration()
Returns the current configuration for the code generation. 
public String   getConfigurationEntry(String key )
Returns the value of the configuration entry for the given key. 
public GeneratorController   getGeneratorController()
Returns the generator controller that should be used for code generation. 
public GeneratorController   getGeneratorController(String key )
Returns the generator controller previously registered with hte given name. 
public static GeneratorFactory   getInstance()
Returns the one and only instance of the GeneratorFactory. 
public String   getLanguage()
 
public List   getMacroLibraries()
Returns the list of known macro libraries. 
public String   getSourceExtension()
Returns the default file extension of source files for the currently adjusted target language. 
public List   getSourceExtensionList()
Returns the list of default file extensions of source files for the currently adjusted target language. 
VelocityEngine   getVelocityEngine()
Only used by GeneratorController and CodeTemplate. 
public void   reloadMacros()
Returns the currently adjusted target language for code generation. 
public void   removeActionListener(ActionListener listener )
 
public void   removeAllListeners()
Clears up the list of known listeners. 
public boolean   removeGeneratorController(String origin )
Removes a generator controller from the collection of known generator controllers. 
public void   removeMacroLibrary(String file )
Removes a velocity macro library from the list of known macro libraries. 
public void   removeUnencryptedTemplateOrLibrary(String name )
Removes the macro library or template with the given file name from the list of macros/templates that should be treated as unencrypted. 
public void   setConfigurationEntry(String key , String value )
Does . 
public void   setLanguage(String lang )
Adjusts the target language for code generation. 
public boolean   treatAsUnencrypted(String file )
Tests, if the macro library or template with the given file name should be treated as unencrypted. 
public void   updateConfiguration()
Retrieves the part of the application configuration dealing with code generation. 
arrow_up
 

 

 Attribute Detail

CONFIGURATION_PREFIX

public static String CONFIGURATION_PREFIX

Represents ... 
arrow_up
 

 Method Detail

addActionListener

public void addActionListener(ActionListener listener )

Removes a listener from the list of known listeners.
Parameters:
listener - Listener to be removed.
 
arrow_up
 
 

addGeneratorController

public boolean addGeneratorController(String origin , GeneratorController controller )

Adds a generator controller to the collection of known generator controllers. The object is registered along with a name, that makes it possible to access it later. The name should consist of the target language and the name of the providing plugin separated by a dot. It is possible that a generator controller appears more than once in the collection, if it is able to handle code generation to more than one target language.
Parameters:
origin - The name the generator controller should be registered with.
controller - The generator controller to be added.
Returns:
True, if the generator controller has been added successfully, otherwise false.
 
arrow_up
 
 

addMacroLibrary

public void addMacroLibrary(String file )

Adds a new velocity macro library to the list of known macro libraries. The library will be treated as encrypted.
Parameters:
file - Name of the macro library file to be added.
 
arrow_up
 
 

addMacroLibrary

public void addMacroLibrary(String file , boolean treatAsUnencrypted )

Adds a new velocity macro library to the list of known macro libraries.
Parameters:
file - Name of the macro library file to be added.
treatAsUnencrypted - True, if the macro library should be treated as unencrypted.
 
arrow_up
 
 

addUnencryptedTemplateOrLibrary

public void addUnencryptedTemplateOrLibrary(String name )

Adds the macro library or template with the given file name to the list of macros/templates that should be treated as unencrypted.
Parameters:
name - The name of the macro library or template file to be added.
 
arrow_up
 
 

fireGenerationDone

public void fireGenerationDone()

Fires an event indicating that the generation process is finished to all known listeners. 
arrow_up
 
 

getCompiledExtension

public String getCompiledExtension()

Returns the default file extension of compiled files for the currently adjusted target language.
Returns:
The default file extension without separators.
 
arrow_up
 
 

getConfiguration

public Map getConfiguration()

Returns the current configuration for the code generation.
Returns:
All configuration entries dealing with code generation.
 
arrow_up
 
 

getConfigurationEntry

public String getConfigurationEntry(String key )

Returns the value of the configuration entry for the given key. The entry is searched in the code generation configuration only.
Parameters:
key - The key to looked after.
Returns:
The value of the entry or "" if the key is unknown.
 
arrow_up
 
 

getGeneratorController

public GeneratorController getGeneratorController()

Returns the generator controller that should be used for code generation. The decision, what generator controller to use, is based on the current configuration of the code generation. This method retrieves the current target language and the enabled plugin. Only one plugin should be enabled. Otherwise, an error is displayed and null is returned.
Returns:
The generator controller to be used or null if more than one or no plugin is enabled for code generation.
 
arrow_up
 
 

getGeneratorController

public GeneratorController getGeneratorController(String key )

Returns the generator controller previously registered with hte given name.
Parameters:
key - The name, the generator controller has been registrered under.
Returns:
GeneratorController object registered under the name key or null if key is not known.
 
arrow_up
 
 

getInstance

public static GeneratorFactory getInstance()

Returns the one and only instance of the GeneratorFactory.
Returns:
The only GeneratorFactory instance.
 
arrow_up
 
 

getLanguage

public String getLanguage()

 
arrow_up
 
 

getMacroLibraries

public List getMacroLibraries()

Returns the list of known macro libraries. (not implemented yet)
Returns:
null.
 
arrow_up
 
 

getSourceExtension

public String getSourceExtension()

Returns the default file extension of source files for the currently adjusted target language.
Returns:
The default file extension without separators.
 
arrow_up
 
 

getSourceExtensionList

public List getSourceExtensionList()

Returns the list of default file extensions of source files for the currently adjusted target language.
Returns:
The list of default file extensions.
 
arrow_up
 
 

getVelocityEngine

VelocityEngine getVelocityEngine()

Only used by GeneratorController and CodeTemplate. 
arrow_up
 
 

reloadMacros

public void reloadMacros()

Returns the currently adjusted target language for code generation.
Returns:
Adjusted target language.
 
arrow_up
 
 

removeActionListener

public void removeActionListener(ActionListener listener )

 
arrow_up
 
 

removeAllListeners

public void removeAllListeners()

Clears up the list of known listeners. No more listeners will be known after call of this method. 
arrow_up
 
 

removeGeneratorController

public boolean removeGeneratorController(String origin )

Removes a generator controller from the collection of known generator controllers. The generator controller will be identified by the name it has been registered with. Trying to remove a generator controller with an unknown name returns true.
Parameters:
origin - Registrationname of the generator controller to be removed.
Returns:
True, if removing the generator controller has been successful, otherwise false.
 
arrow_up
 
 

removeMacroLibrary

public void removeMacroLibrary(String file )

Removes a velocity macro library from the list of known macro libraries. (not implemented yet)
Parameters:
file - Name of macro library file to be removed.
 
arrow_up
 
 

removeUnencryptedTemplateOrLibrary

public void removeUnencryptedTemplateOrLibrary(String name )

Removes the macro library or template with the given file name from the list of macros/templates that should be treated as unencrypted.
Parameters:
name - The name of the macro library or template file to be removed.
 
arrow_up
 
 

setConfigurationEntry

public void setConfigurationEntry(String key , String value )

Does ...
Parameters:
key - ...
value - ...
 
arrow_up
 
 

setLanguage

public void setLanguage(String lang )

Adjusts the target language for code generation.
Parameters:
lang - New target language.
 
arrow_up
 
 

treatAsUnencrypted

public boolean treatAsUnencrypted(String file )

Tests, if the macro library or template with the given file name should be treated as unencrypted.
Parameters:
file - The name of the macro library or template file to be tested.
Returns:
True, if the macro library or template should be treated as unencrytped, otherwise false.
 
arrow_up
 
 

updateConfiguration

public void updateConfiguration()

Retrieves the part of the application configuration dealing with code generation. 
arrow_up
 

Created  2003 - 3 - 4

    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 2001 Gentleware AG, Vogt-Kölln-Str.30, 22527 Hamburg, Germany. All Rights Reserved.

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