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 CoreCodeTemplateManager

com.gentleware.poseidon.generator.CoreCodeTemplateManager
All known Subclassifier:
UMLCodeTemplateManager

All known implemented Interfaces:
CodeTemplateManager


public class CoreCodeTemplateManager


This class is used to handle complex sets of code templates assigned to just one type of model element. The template sets themselves are handled by the class GenerationSet, which allows for combining a number of templates using a predicate object to group them. No single code template will be returned, but a list of templates associated to the given type of model element with the given predicate.

Created : sturm, Jan 16, 2003, 7:13:38 PM

Authors:
sturm
Since:
1.6
See also:
GenerationSet


 Attribute Summary
private Map  generationSetMap
 
arrow_up
 

 Constructor Summary
public   CoreCodeTemplateManager()
 
arrow_up
 

 Method Summary
public void   addCodeTemplate(Class elementClass, CodeTemplate template)
Adds a CodeTemplate instance to the set of known CodeTemplates. 
public void   addCodeTemplate(Class elementClass, CodeTemplate template, boolean treatAsUnencrypted)
Adds a CodeTemplate instance to the set of known CodeTemplates. 
public final void   addCodeTemplate(Class elementClass, CodeTemplate template, Object predicate, boolean treatAsUnencrypted, boolean replace)
Adds a CodeTemplate instance to the set of known CodeTemplates. 
public List   getCodeTemplates(Object element)
Returns the CodeTemplate instance to be used for generating the code files. 
protected List   getCodeTemplatesForClass(Class elementClass, Object predicate)
 
public List   getCodeTemplatesForPredicate(Object element, Object predicate)
Returns the list of CodeTemplate instances to be used for generating the code files based on the given predicate. 
protected GenerationSet   getGenerationSet(Class elementClass, Object predicate)
 
protected Map   getGenerationSetMap()
 
protected List   getRegisteredGenerationSets(Class elementClass)
 
protected Class   getSearchableClassForElement(Object element)
Returns the class object of the given element. 
protected boolean   hasRegisteredGenerationSet(Class elementClass)
 
public final void   removeAllCodeTemplates(Class elementClass)
Removes all registered CodeTemplates for the given class of elements. 
public void   removeCodeTemplate(Class elementClass, CodeTemplate template)
Removes the given CodeTemplate from the list of registered templates for the given class of elements. 
public final void   removeCodeTemplate(Class elementClass, CodeTemplate template, Object predicate)
Removes the given CodeTemplate from the generation set associated with the given predicate. 
public final void   removeCodeTemplatesForPredicate(Class elementClass, Object predicate)
Removes the set of CodeTemplates registered for the given class of elements and predicate. 
arrow_up
 

Tagged Values
static false
 

 Attribute Detail

generationSetMap

private Map generationSetMap

arrow_up
 Constructor Detail

CoreCodeTemplateManager

public CoreCodeTemplateManager CoreCodeTemplateManager()

Returns:
arrow_up
 Method Detail

addCodeTemplate

public void addCodeTemplate(Class elementClass, CodeTemplate template)


Adds a CodeTemplate instance to the set of known CodeTemplates. Each of the CodeTemplate instances is mapped to a class of elements. For each class elements only one CodeTemplate instance can be defined, while the CodeTemplate instances can be mapped to more than one element class. The template will be treated as encrypted.  
Parameters:
elementClass - Class of elements this CodeTemplate instance is used for.
template - The CodeTemplate instance to be added.
arrow_up


addCodeTemplate

public void addCodeTemplate(Class elementClass, CodeTemplate template, boolean treatAsUnencrypted)


Adds a CodeTemplate instance to the set of known CodeTemplates. Each of the CodeTemplate instances is mapped to a class of elements. For each class elements only one CodeTemplate instance can be defined, while the CodeTemplate instances can be mapped to more than one element class.  
Parameters:
elementClass - Class of elements this CodeTemplate instance is used for.
template - The CodeTemplate instance to be added.
treatAsUnencrypted - True, if the template should be treated as unencrypted.
arrow_up


addCodeTemplate

public final void addCodeTemplate(Class elementClass, CodeTemplate template, Object predicate, boolean treatAsUnencrypted, boolean replace)


Adds a CodeTemplate instance to the set of known CodeTemplates. Each of the CodeTemplate instances is mapped to a class of elements. For each class elements any number CodeTemplate instances can be defined, while the CodeTemplate instances can be mapped to more than one element class. A CodeTemplate can also be declared as the replacement for any previously defined CodeTemplate for the given class of elements.  
Parameters:
elementClass - Class of elements this CodeTemplate instance is used for.
template - The CodeTemplate instance to be added.
predicate -
treatAsUnencrypted - True, if the template should be treated as unencrypted.
replace - True, if the template should replace any previously registered template.
arrow_up


getCodeTemplates

public List getCodeTemplates(Object element)


Returns the CodeTemplate instance to be used for generating the code files. Because no predicate is given, the default generation set is used to retrieve the templates.  
Parameters:
element - Element the CodeTemplate instance should be retrieved for.
Returns:
The CodeTemplate instance to be used for the given element.
arrow_up


getCodeTemplatesForClass

protected List getCodeTemplatesForClass(Class elementClass, Object predicate)

Parameters:
elementClass -
predicate -
Returns:
arrow_up


getCodeTemplatesForPredicate

public List getCodeTemplatesForPredicate(Object element, Object predicate)


Returns the list of CodeTemplate instances to be used for generating the code files based on the given predicate.  
Parameters:
element - Element the CodeTemplates instance should be retrieved for.
predicate -
Returns:
The CodeTemplate instances to be used for the given element and predicate.
arrow_up


getGenerationSet

protected GenerationSet getGenerationSet(Class elementClass, Object predicate)

Parameters:
elementClass -
predicate -
Returns:
arrow_up


getGenerationSetMap

protected Map getGenerationSetMap()

Returns:
arrow_up


getRegisteredGenerationSets

protected List getRegisteredGenerationSets(Class elementClass)

Parameters:
elementClass -
Returns:
arrow_up


getSearchableClassForElement

protected Class getSearchableClassForElement(Object element)


Returns the class object of the given element. Subclasses of CoreCodeTemplateManager can overwrite this operation to achieve a different behavior.  
Parameters:
element - The object to get the class for.
Returns:
The class object representing the class of the given object.
arrow_up


hasRegisteredGenerationSet

protected boolean hasRegisteredGenerationSet(Class elementClass)

Parameters:
elementClass -
Returns:
arrow_up


removeAllCodeTemplates

public final void removeAllCodeTemplates(Class elementClass)


Removes all registered CodeTemplates for the given class of elements. The entry for the class of elements is removed as well.  
Parameters:
elementClass - The class of elements to delete the templates for.
arrow_up


removeCodeTemplate

public void removeCodeTemplate(Class elementClass, CodeTemplate template)


Removes the given CodeTemplate from the list of registered templates for the given class of elements.  
Parameters:
elementClass - The class of elements the template should be removed for.
template - The template to be removed.
arrow_up


removeCodeTemplate

public final void removeCodeTemplate(Class elementClass, CodeTemplate template, Object predicate)


Removes the given CodeTemplate from the generation set associated with the given predicate.  
Parameters:
elementClass - The class of elements the template should be removed for.
template - The template to be removed.
predicate - The predicate to find the generation set the template should be removed from.
arrow_up


removeCodeTemplatesForPredicate

public final void removeCodeTemplatesForPredicate(Class elementClass, Object predicate)


Removes the set of CodeTemplates registered for the given class of elements and predicate.  
Parameters:
elementClass - The class of elements to delete the templates for.
predicate - The predicate object used to determine which set of templates to remove.
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.