Class TransformationExecutor


  • public final class TransformationExecutor
    extends Object
    A utility class that enables to execute existing transformation in the specified execution context.
    Since:
    2.0
    • Constructor Detail

      • TransformationExecutor

        public TransformationExecutor​(URI uri)
        Constructs the executor for the given transformation URI.

        No attempt to resolve and load the transformation is done at this step

        Parameters:
        uri - the URI of an existing transformation
      • TransformationExecutor

        public TransformationExecutor​(URI uri,
                                      EPackage.Registry registry)
        Constructs the executor for the given transformation URI.

        No attempt to resolve and load the transformation is done at this step

        Parameters:
        uri - the URI of an existing transformation
        registry - a package registry of meta-models to be referenced by the executed transformation
        Since:
        3.0
    • Method Detail

      • loadTransformation

        public Diagnostic loadTransformation()
        Attempts to load the transformation referred by this executor and checks if it is valid for execution.

        Remark:
        Only the first performs the actual transformation loading, subsequent calls to this method will return the existing diagnostic.

        Returns:
        the diagnostic indicating possible problems of the load action
      • loadTransformation

        public Diagnostic loadTransformation​(org.eclipse.core.runtime.IProgressMonitor monitor)
        Attempts to load the transformation referred by this executor and checks if it is valid for execution.

        Remark:
        Only the first performs the actual transformation loading, subsequent calls to this method will return the existing diagnostic.

        Parameters:
        the - monitor indicating load progress and cancellation
        Returns:
        the diagnostic indicating possible problems of the load action
        Since:
        3.4
      • execute

        public ExecutionDiagnostic execute​(ExecutionContext executionContext,
                                           ModelExtent... modelParameters)
        Executes the transformation referred by this executor using the given model parameters and execution context.
        Parameters:
        executionContext - the context object keeping the execution environment details
        modelParameters - the actual model arguments to the transformation
        Returns:
        the diagnostic object indicating the execution result status, also keeping the details of possible problems
        Throws:
        IllegalArgumentException - if the context or any of the model parameters is null
      • cleanup

        public void cleanup()
        Clean all resources associated with the executor.
        Since:
        3.5