com.ashridgetech.jamda.transform
Class AbstractModelTransformer

java.lang.Object
  |
  +--com.ashridgetech.jamda.transform.AbstractModelTransformer
All Implemented Interfaces:
ModelTransformer
Direct Known Subclasses:
BasicTransformer, CodeGenTransformer

public abstract class AbstractModelTransformer
extends java.lang.Object
implements ModelTransformer

A base class with common functions for ModelTransformer implementations. Must be configured with the names of the Stereotypes for which the transformation will be applied.

Author:
Paul Boocock version 1.0

Nested Class Summary
static class AbstractModelTransformer.Config
           
 
Nested classes inherited from class com.ashridgetech.jamda.transform.ModelTransformer
ModelTransformer.TransformException
 
Constructor Summary
AbstractModelTransformer()
           
 
Method Summary
 void addStereotypeName(java.lang.String stereotypeName)
          Add the name of a stereotype of one of the sets of source classes to act upon.
 TransformerConfig getConfig()
          Get a configuration object for this transformer.
 java.lang.String getDescription()
          Get a short description of this transformer, including details of its configuration.
 java.util.List getStereotypeNames()
          Get the names of the stereotype of the source classes to act upon.
 java.util.Collection selectElements(Model model)
          Select the elements in a Model which will be processed by this transformer.
 void setStereotypeName(java.lang.String stereotypeName)
          Set the name of the stereotype of the source classes to act upon.
 java.util.Collection standardElementDefs()
          Default implementation that returns an empty set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ashridgetech.jamda.transform.ModelTransformer
transform
 

Constructor Detail

AbstractModelTransformer

public AbstractModelTransformer()
Method Detail

getStereotypeNames

public java.util.List getStereotypeNames()
Get the names of the stereotype of the source classes to act upon.

Returns:
the stereotype name.

setStereotypeName

public void setStereotypeName(java.lang.String stereotypeName)
Set the name of the stereotype of the source classes to act upon. Any previously added stereotype names are removed.

Parameters:
stereotypeName - the name of the stereotype

addStereotypeName

public void addStereotypeName(java.lang.String stereotypeName)
Add the name of a stereotype of one of the sets of source classes to act upon.

Parameters:
stereotypeName - the name of the stereotype

selectElements

public java.util.Collection selectElements(Model model)
                                    throws ModelTransformer.TransformException
Select the elements in a Model which will be processed by this transformer.

Parameters:
model - the Model from which to select
Returns:
the selected ModelElements
ModelTransformer.TransformException

standardElementDefs

public java.util.Collection standardElementDefs()
                                         throws ModelTransformer.TransformException
Default implementation that returns an empty set.

Specified by:
standardElementDefs in interface ModelTransformer
Returns:
${inheritdoc}
ModelTransformer.TransformException

getConfig

public TransformerConfig getConfig()
Get a configuration object for this transformer. This method does not retain a reference to the configuration object as it is of no use. This method should be overridden by subclasses that need a different config object.

Specified by:
getConfig in interface ModelTransformer
Returns:
an instance of the default config

getDescription

public java.lang.String getDescription()
Get a short description of this transformer, including details of its configuration.

Specified by:
getDescription in interface ModelTransformer
Returns:
the description


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.