IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.core
Class TransformationServiceUtil

java.lang.Object
  extended bycom.ibm.xtools.transform.core.TransformationServiceUtil

public final class TransformationServiceUtil
extends Object

The class provides access to the Transformation Service. Every transformation is represented by a transformation descriptor that contains transformation properties. An instance of a transformation (a transform) must be created before the transformation can be executed. The configurable data (properties) that a transform uses to execute is maintained in a transform context which can be obtained from the transform.

In addition to the properties defined in the transformation descriptor, the transform context has several special properties that the underlying transformation engine uses. The two key properties are the "source" for the transformation and the "target container" where the transformed source will be created. Before a transform can be executed, its populated transform context should be validated.


Method Summary
static AbstractTransform createTransformation(ITransformationDescriptor descriptor)
          Create a transformation instance for the given transformation descriptor.
static ITransformationDescriptor getTransformationDescriptor(String id)
          Obtain the transformation descriptor for the given identifier.
static ITransformationDescriptor[] listTransformations()
          Return an array of descriptors for the registered 'public' transformations
static IStatus validateContext(ITransformationDescriptor descriptor, ITransformContext context)
          Validate the context for the corresponding transformation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTransformation

public static AbstractTransform createTransformation(ITransformationDescriptor descriptor)
Create a transformation instance for the given transformation descriptor. A new transformation instance is created every time, with the corresponding (enabled) transformation extensions already applied to that instance.

Parameters:
descriptor - the transformation descriptor
Returns:
AbstractTransform - an instance of the transformation

getTransformationDescriptor

public static ITransformationDescriptor getTransformationDescriptor(String id)
Obtain the transformation descriptor for the given identifier.

Parameters:
id - the unique identifier fo the transformation
Returns:
ITransformationDescriptor - the descriptor or null

validateContext

public static IStatus validateContext(ITransformationDescriptor descriptor,
                                      ITransformContext context)
Validate the context for the corresponding transformation.

This method can return either a single status object or multiple status objects depending upon the validation performed. If multiple warnings/errors are to be returned use a MultiStatus object. If one of its child status objects has a severity of ERROR, the multi-status is assumed to be an error.

A valid context should return a single status object with a severity of OK. A "null" return value indicates a major error (e.g., the service could not locate or load the provider).

Parameters:
descriptor - the transformation descriptor
context - the context to be validated
Returns:
IStatus - the status of the validate
See Also:
MultiStatus, Status

listTransformations

public static ITransformationDescriptor[] listTransformations()
Return an array of descriptors for the registered 'public' transformations

Returns:
The array of descriptors for the public transformations

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.