de.cau.cs.kieler.core.model.transformation
Interface ITransformationFramework

All Known Implementing Classes:
XtendTransformationFramework

public interface ITransformationFramework

Interface for executing a transformation with a framework. Every transformation framework that is used by the KSBAsE Plug-in has to implement this interface. The XtendTransformationFramework contains an implementation for the Xtend framework.

Rating proposed yellow
(2010-01-08)

Method Summary
 Object executeTransformation()
          Executes a transformation with the parameters set with the initalizeTransformation method.
 String getFileExtension()
          Returns the default file extension for this framework without the leading dot.
 boolean initializeTransformation(String fileName, String operation, String... basePackages)
          Initializes a transformation.
 List<AbstractTransformation> parseInPlaceTransformations(URL fileName)
          Parses a transformation file and returns the existing in-place transformations.
 void setParameters(Object... parameter)
          Sets the transformation parameters.
 boolean setParameters(String... parameter)
          Sets the transformation parameters by matching the current selection with the given list of types.
 

Method Detail

getFileExtension

String getFileExtension()
Returns the default file extension for this framework without the leading dot.

Returns:
A string representing the file extension

executeTransformation

Object executeTransformation()
Executes a transformation with the parameters set with the initalizeTransformation method.

Returns:
A return value from the transformation. May be null

setParameters

boolean setParameters(String... parameter)
Sets the transformation parameters by matching the current selection with the given list of types. The framework may return 'false' if the parameters could not be matched.

Parameters:
parameter - The list of parameter types.
Returns:
True if all parameters could be set.

setParameters

void setParameters(Object... parameter)
Sets the transformation parameters.

Parameters:
parameter - The actual parameters

initializeTransformation

boolean initializeTransformation(String fileName,
                                 String operation,
                                 String... basePackages)
Initializes a transformation. This includes the parameter mapping, if necessary. The parameter 'parameter' is only a string representation of the parameter types of the given operation.

Parameters:
fileName - The transformation file name
operation - The operation to execute
basePackages - The class name of the editors EPackage
Returns:
False if an error occurred.

parseInPlaceTransformations

List<AbstractTransformation> parseInPlaceTransformations(URL fileName)
Parses a transformation file and returns the existing in-place transformations.

Parameters:
fileName - a URL to the transformation file
Returns:
a list of abstract transformations.