de.cau.cs.kieler.core.model.transformation.xtend
Class XtendTransformationFramework

java.lang.Object
  extended by de.cau.cs.kieler.core.model.transformation.xtend.XtendTransformationFramework
All Implemented Interfaces:
ITransformationFramework

public class XtendTransformationFramework
extends Object
implements ITransformationFramework

An implementation of the ITransformationFramework interface for the use with the Xtend framework.

Rating proposed yellow
(2010-01-08)

Constructor Summary
XtendTransformationFramework()
          Creates a new Xtend component.
 
Method Summary
 Object executeTransformation()
          Executes a transformation.
 String getFileExtension()
          The default file extension for Xtend is 'ext'.
 boolean initializeTransformation(String fileName, String operation, String... basePackages)
          Initializes a transformation using the XtendFacade.
 List<AbstractTransformation> parseInPlaceTransformations(URL fileName)
          Parses in-place transformations from an Xtend file.
 void setParameters(Object... parameter)
          Sets the actual parameters.
 boolean setParameters(String... parameter)
          Sets the transformation parameters by matching the current selection with the given list of types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XtendTransformationFramework

public XtendTransformationFramework()
Creates a new Xtend component.

Method Detail

setParameters

public void setParameters(Object... parameter)
Sets the actual parameters.

Specified by:
setParameters in interface ITransformationFramework
Parameters:
parameter - The parameters.

setParameters

public boolean setParameters(String... parameter)
Sets the transformation parameters by matching the current selection with the given list of types.

Specified by:
setParameters in interface ITransformationFramework
Parameters:
parameter - The list of parameter types.
Returns:
True if all parameters could be matched

initializeTransformation

public boolean initializeTransformation(String fileName,
                                        String operation,
                                        String... basePackages)
Initializes a transformation using the XtendFacade.

Specified by:
initializeTransformation in interface ITransformationFramework
Parameters:
fileName - The extension file name
operation - The extension to execute
basePackages - The class name of the editors EPackage
Returns:
False if an error occurred.

executeTransformation

public Object executeTransformation()
Executes a transformation.

Specified by:
executeTransformation in interface ITransformationFramework
Returns:
The return value from XtendFacade.call()

parseInPlaceTransformations

public List<AbstractTransformation> parseInPlaceTransformations(URL fileName)
Parses in-place transformations from an Xtend file.

Specified by:
parseInPlaceTransformations in interface ITransformationFramework
Parameters:
fileName - a URL to the transformation file
Returns:
A list of AbstractTransformations

getFileExtension

public String getFileExtension()
The default file extension for Xtend is 'ext'.

Specified by:
getFileExtension in interface ITransformationFramework
Returns:
'ext'