de.cau.cs.kieler.kiml.service
Class KGraphHandler

java.lang.Object
  extended by de.cau.cs.kieler.kiml.service.formats.AbstractEmfHandler<KNode>
      extended by de.cau.cs.kieler.kiml.service.KGraphHandler
All Implemented Interfaces:
ITransformationHandler<KNode>

public class KGraphHandler
extends AbstractEmfHandler<KNode>

Transformer for the KGraph model and XMI serialization.

Rating red

Field Summary
static String FORMAT
          the KGraph format identifier.
 
Constructor Summary
KGraphHandler()
           
 
Method Summary
protected  ResourceSet createResourceSet()
          Create an appropriate resource set for the supported type of graphs.
 void deserialize(String serializedGraph, TransformationData<KNode,KNode> transData)
          Create a graph instance from serial representation.
 IGraphTransformer<KNode,KNode> getExporter()
          Return a graph transformer for exporting graphs from the KGraph format.
 IGraphTransformer<KNode,KNode> getImporter()
          Return a graph transformer for importing graphs into the KGraph format.
 String serialize(KNode graph)
          Serialize the given graph instance in the format supported by this transformer.
 
Methods inherited from class de.cau.cs.kieler.kiml.service.formats.AbstractEmfHandler
deserializeBinary, getFileExtension, serializeBinary, setFileExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT

public static final String FORMAT
the KGraph format identifier.

See Also:
Constant Field Values
Constructor Detail

KGraphHandler

public KGraphHandler()
Method Detail

serialize

public String serialize(KNode graph)
Serialize the given graph instance in the format supported by this transformer.

Specified by:
serialize in interface ITransformationHandler<KNode>
Overrides:
serialize in class AbstractEmfHandler<KNode>
Parameters:
graph - the graph instance
Returns:
serialization of the given graph

deserialize

public void deserialize(String serializedGraph,
                        TransformationData<KNode,KNode> transData)
Create a graph instance from serial representation. The created object, which is stored as source graph in the given transformation data instance, may actually contain multiple graphs.

Specified by:
deserialize in interface ITransformationHandler<KNode>
Overrides:
deserialize in class AbstractEmfHandler<KNode>
Parameters:
serializedGraph - the serialized graph
transData - transformation data for graph import

createResourceSet

protected ResourceSet createResourceSet()
Create an appropriate resource set for the supported type of graphs.

Specified by:
createResourceSet in class AbstractEmfHandler<KNode>
Returns:
a resource set

getImporter

public IGraphTransformer<KNode,KNode> getImporter()
Return a graph transformer for importing graphs into the KGraph format.

Returns:
a KGraph importer

getExporter

public IGraphTransformer<KNode,KNode> getExporter()
Return a graph transformer for exporting graphs from the KGraph format.

Returns:
a KGraph exporter