IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.core
Class AbstractTransform

java.lang.Object
  extended bycom.ibm.xtools.transform.core.AbstractTransformElement
      extended bycom.ibm.xtools.transform.core.AbstractTransform
All Implemented Interfaces:
ITransformationItem
Direct Known Subclasses:
Transform

public abstract class AbstractTransform
extends AbstractTransformElement

The Abstract Transform class defines the contract between the transformation service and the implementation of a specific transformation.

In the default transformation engine, transforms are containers that traverse the transformation element hierarchy, executing extractors, rules and nested transforms. Extractors effectively walk the source model and rules create or update the target model.

There are two types of transforms within the transformation element hierarchy: a root transform and internal transforms. For any given transformation, there is one root transform for every instance of that transformation. A new instance of a root transform should be returned by the transformation provider when requested. (@see AbstractTransformationProvider.createTransformation(ITransformationDescriptor descriptor))

Internal transforms are used within the transformation implementation to contain rules, content extractors and other transforms. If a transformation author does not want to use the default transformation engine, he only needs to create a root transform.

Root transforms always have an associated transformation descriptor, which enables the rules and extractors at execution time to have access to the formal properties defined by the transformation author (in the descriptor).

Typcially internal transforms do not have an associated descriptor, unless one transformation contains another transformation (i.e. a composite transformation).


Constructor Summary
AbstractTransform()
          The default constructor should only be used internally by the transformation service.
AbstractTransform(ITransformationDescriptor descriptor)
          The constructor to be used when creating a root transform.
AbstractTransform(String id)
          This constructor should be used when creating a transform that is internal within a transformation hierarchy.
 
Method Summary
 ITransformContext createContext(ITransformContext parentContext)
          Create an execution context associated with this transform.
abstract  void execute(ITransformContext context)
          Execute the transform with the given context.
 ITransformationDescriptor getTransformationDescriptor()
          Retrieve the associated transformation descriptor.
 
Methods inherited from class com.ibm.xtools.transform.core.AbstractTransformElement
canAccept, getAcceptCondition, getDescription, getId, getName, getProgressMonitor, setAcceptCondition, setDescription, setId, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTransform

public AbstractTransform()
The default constructor should only be used internally by the transformation service.


AbstractTransform

public AbstractTransform(String id)
This constructor should be used when creating a transform that is internal within a transformation hierarchy. This constructor must not be used when creating a root transform.

Parameters:
id - the unique identifier of this transform

AbstractTransform

public AbstractTransform(ITransformationDescriptor descriptor)
The constructor to be used when creating a root transform.

Parameters:
descriptor - the associated transformation descriptor
Method Detail

createContext

public ITransformContext createContext(ITransformContext parentContext)
Create an execution context associated with this transform. A transform context can be child of another transform context. For a root transform, the transform context should not have a parent context.

Parameters:
parentContext - the current context of the transformation execution
Returns:
ITransformContext - A nested context of the transformation execution

execute

public abstract void execute(ITransformContext context)
                      throws Exception
Execute the transform with the given context. The context contains various properties that define the source object and the target container where that source object is to be transformed.

Parameters:
context - the current context of the transformation execution
Throws:
Exception

getTransformationDescriptor

public final ITransformationDescriptor getTransformationDescriptor()
Retrieve the associated transformation descriptor.

Returns:
ITransformationDescriptor - the associated static descriptor.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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