de.cau.cs.kieler.kiml.export
Class ExportUtil

java.lang.Object
  extended by de.cau.cs.kieler.kiml.export.ExportUtil

public final class ExportUtil
extends Object

A utility class for graph export.

Rating red

Method Summary
static OutputStream createOutputStream(String path, boolean isWorkspacePath)
          Creates an output stream to a file that is located in the workspace or in the file system.
static void transformKGraph2Model(String xtendFile, String extension, List<Object> parameters, KNode node, OutputStream outputStream, Resource.Factory resourceFactory, IKielerProgressMonitor monitor, String... involvedMetamodels)
          Transforms a kgraph into another model using a given Xtend transformation file, and writes the model to the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createOutputStream

public static OutputStream createOutputStream(String path,
                                              boolean isWorkspacePath)
                                       throws IOException
Creates an output stream to a file that is located in the workspace or in the file system.

Parameters:
path - the file path
isWorkspacePath - true if the file path is relative to the workspace
Returns:
the output stream
Throws:
IOException - thrown when the stream could not be opened

transformKGraph2Model

public static void transformKGraph2Model(String xtendFile,
                                         String extension,
                                         List<Object> parameters,
                                         KNode node,
                                         OutputStream outputStream,
                                         Resource.Factory resourceFactory,
                                         IKielerProgressMonitor monitor,
                                         String... involvedMetamodels)
                                  throws IOException,
                                         TransformException
Transforms a kgraph into another model using a given Xtend transformation file, and writes the model to the output stream.

Parameters:
xtendFile - the xtend file containing the transformation
extension - the name of the extension that starts the transformation inside the xtend file
parameters - a list of additional parameters for the transformation or null if no additional parameters are required
node - the kgraph parent node
outputStream - the output stream the target model instance will be serialized to
resourceFactory - the resource factory used to serialize the model
monitor - the progress monitor
involvedMetamodels - the metamodels involved in the transformation
Throws:
IOException - thrown when the the xtend file could not be found or opened
TransformException - thrown when the execution of the xtend transformation failed