de.cau.cs.kieler.core.model.xtend.util
Class XtendTransformationUtil

java.lang.Object
  extended by de.cau.cs.kieler.core.model.xtend.util.XtendTransformationUtil

public final class XtendTransformationUtil
extends Object

Utitlity class to conveniently execute Xtend transformations.

Rating proposed yellow
(2010-06-04) proposed by haf

Method Summary
static org.eclipse.xtend.XtendFacade initializeFacade(String extensionFile, String[] basePackages)
          initializes an XtendFacade and returns the instance.
static org.eclipse.xtend.XtendFacade initializeFacade(String extentionFile, String[] basePackages, Map<String,org.eclipse.xtend.expression.Variable> globalVars)
          initializes an XtendFacade and returns the instance.
static XtendStatus model2ModelTransform(KielerProgressMonitor monitor, String xtendFile, String startFunction, URI inputModelURI, URI outputModelURI, EPackage... involvedMetamodels)
          This transformation uses the Xtend transformation language.
static XtendStatus model2ModelTransform(KielerProgressMonitor monitor, String xtendFile, String startFunction, URI inputModelURI, URI outputModelURI, TransformationWorkflowHook workflowHook, EPackage... involvedMetamodels)
          This transformation uses the Xtend transformation language.
static IStatus model2ModelTransform(String xtendFile, String startFunction, URI inputModelURI, URI outputModelURI, EPackage... involvedMetamodels)
          This transformation uses the Xtend transformation language.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

model2ModelTransform

public static XtendStatus model2ModelTransform(KielerProgressMonitor monitor,
                                               String xtendFile,
                                               String startFunction,
                                               URI inputModelURI,
                                               URI outputModelURI,
                                               TransformationWorkflowHook workflowHook,
                                               EPackage... involvedMetamodels)
This transformation uses the Xtend transformation language.

Parameters:
monitor - if true a progress bar is displayed
xtendFile - filename that holds the xtend functions
startFunction - initial transformation function
inputModelURI - EMF URI for input model (may be a local resource URI)
outputModelURI - EMF URI for output model
workflowHook - This component is hooked into the workflow just before the transformed model is written to a file. Can be used to do some last transformation work.
involvedMetamodels - EPackages of metamodels that need to be known to the transformation
Returns:
the Status about success and errors and warnings

model2ModelTransform

public static XtendStatus model2ModelTransform(KielerProgressMonitor monitor,
                                               String xtendFile,
                                               String startFunction,
                                               URI inputModelURI,
                                               URI outputModelURI,
                                               EPackage... involvedMetamodels)
This transformation uses the Xtend transformation language.

Parameters:
monitor - if true a progress bar is displayed
xtendFile - filename that holds the xtend functions
startFunction - initial transformation function
inputModelURI - EMF URI for input model (may be a local resource URI)
outputModelURI - EMF URI for output model
involvedMetamodels - EPackages of metamodels that need to be known to the transformation
Returns:
the Status about success and errors and warnings

model2ModelTransform

public static IStatus model2ModelTransform(String xtendFile,
                                           String startFunction,
                                           URI inputModelURI,
                                           URI outputModelURI,
                                           EPackage... involvedMetamodels)
                                    throws TransformException
This transformation uses the Xtend transformation language. Same as model2ModelTransform but executes the transformation in a MonitoredOperation an automatically pops up a progress bar.

Parameters:
xtendFile - filename that holds the xtend functions
startFunction - initial transformation function
inputModelURI - EMF URI for input model (may be a local resource URI)
outputModelURI - EMF URI for output model
involvedMetamodels - EPackages of metamodels that need to be known to the transformation
Returns:
the Status about success and errors and warnings
Throws:
TransformException - if something fails

initializeFacade

public static org.eclipse.xtend.XtendFacade initializeFacade(String extensionFile,
                                                             String[] basePackages)
initializes an XtendFacade and returns the instance.

Parameters:
extensionFile - file containing the extentions.
basePackages - emf packages needed within the transformation.
Returns:
XtendFacade

initializeFacade

public static org.eclipse.xtend.XtendFacade initializeFacade(String extentionFile,
                                                             String[] basePackages,
                                                             Map<String,org.eclipse.xtend.expression.Variable> globalVars)
initializes an XtendFacade and returns the instance.

Parameters:
extentionFile - file containing the extentions.
basePackages - emf packages needed within the transformation.
globalVars - map with global variables
Returns:
XtendFacade