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

java.lang.Object
  extended by de.cau.cs.kieler.kiml.service.TransformationService
Direct Known Subclasses:
EclipseTransformationService

public abstract class TransformationService
extends Object

Service class for graph transformations.

Rating red

Field Summary
static String ATTRIBUTE_CLASS
          name of the 'class' attribute in the extension points.
static String ATTRIBUTE_DESCRIPTION
          name of the 'description' attribute in the extension points.
static String ATTRIBUTE_EXTENSIONS
          name of the 'extensions' attribute in the extension points.
static String ATTRIBUTE_ID
          name of the 'id' attribute in the extension points.
static String ATTRIBUTE_NAME
          name of the 'name' attribute in the extension points.
static String ELEMENT_HANDLER
          name of the 'handler' element in the 'graph transformer' extension point.
static String EXTP_ID_GRAPH_TRANS
          identifier of the extension point for layout info.
 
Constructor Summary
protected TransformationService()
          Protected constructor to enforce instantiation in subclasses.
 
Method Summary
 Collection<GraphFormatData> getFormatData()
          Returns all registered graph format data.
 GraphFormatData getFormatData(String id)
          Returns the graph format data for the given identifier.
 GraphFormatData getFormatDataBySuffix(String suffix)
          Returns a graph format data that has the given suffix in its identifier.
static TransformationService getInstance()
          Returns the singleton instance of the transformation service.
protected  void loadGraphTransExtensions()
          Loads and registers all graph transformer extensions from the extension point.
protected abstract  void reportError(CoreException exception)
          Report an error that occurred while reading extensions.
protected abstract  void reportError(String extensionPoint, IConfigurationElement element, String attribute, Throwable exception)
          Report an error that occurred while reading extensions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTP_ID_GRAPH_TRANS

public static final String EXTP_ID_GRAPH_TRANS
identifier of the extension point for layout info.

See Also:
Constant Field Values

ELEMENT_HANDLER

public static final String ELEMENT_HANDLER
name of the 'handler' element in the 'graph transformer' extension point.

See Also:
Constant Field Values

ATTRIBUTE_CLASS

public static final String ATTRIBUTE_CLASS
name of the 'class' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_DESCRIPTION

public static final String ATTRIBUTE_DESCRIPTION
name of the 'description' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_EXTENSIONS

public static final String ATTRIBUTE_EXTENSIONS
name of the 'extensions' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_ID

public static final String ATTRIBUTE_ID
name of the 'id' attribute in the extension points.

See Also:
Constant Field Values

ATTRIBUTE_NAME

public static final String ATTRIBUTE_NAME
name of the 'name' attribute in the extension points.

See Also:
Constant Field Values
Constructor Detail

TransformationService

protected TransformationService()
Protected constructor to enforce instantiation in subclasses.

Method Detail

getInstance

public static TransformationService getInstance()
Returns the singleton instance of the transformation service.

Returns:
the singleton instance

reportError

protected abstract void reportError(String extensionPoint,
                                    IConfigurationElement element,
                                    String attribute,
                                    Throwable exception)
Report an error that occurred while reading extensions.

Parameters:
extensionPoint - the identifier of the extension point
element - the configuration element
attribute - the attribute that contains an invalid entry
exception - an optional exception that was caused by the invalid entry

reportError

protected abstract void reportError(CoreException exception)
Report an error that occurred while reading extensions.

Parameters:
exception - a core exception holding a status with further information

loadGraphTransExtensions

protected final void loadGraphTransExtensions()
Loads and registers all graph transformer extensions from the extension point.


getFormatData

public GraphFormatData getFormatData(String id)
Returns the graph format data for the given identifier.

Parameters:
id - a graph format identifier
Returns:
the corresponding identifier

getFormatData

public Collection<GraphFormatData> getFormatData()
Returns all registered graph format data.

Returns:
a collection of graph format data

getFormatDataBySuffix

public final GraphFormatData getFormatDataBySuffix(String suffix)
Returns a graph format data that has the given suffix in its identifier.

Parameters:
suffix - a graph format identifier suffix
Returns:
the first graph format data that has the given suffix