IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.core
Class RootTransform

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

public class RootTransform
extends Transform

The Root Transform class is a utility class that transformation authors can used as the root of their transformation.

This root transform class is designed to accept one or more source objects that were specified in the UI's current selection. When an instance of this class is created, the initalize method must be called otherwise the instance is unusable. This transform has a predefined structure which has three phases:

The client can add multiple rules or transforms to the initialization phase or the finalization phase. The client can provide a main transform or specify null in which case a default main transform will be created so that multiple transforms can be added to it. The client also has a choice of configuring this root transform so that the main transform can either be executed once with the list of selected objects or be executed for each selected object.


Constructor Summary
RootTransform(ITransformationDescriptor descriptor)
          Constructor.
 
Method Summary
 void addToFinal(AbstractTransformElement transformElement)
          Add a transform element to the finalization phase.
 void addToInit(AbstractTransformElement transformElement)
          Add a transform element to the initialization phase.
 Transform getMainTransform()
          Retrieve the main transform.
 Transform initialize(Transform aTransform, boolean acceptList)
          Initialize the root transform to create the three phase structure.
 
Methods inherited from class com.ibm.xtools.transform.core.Transform
add, add, canAccept, execute, findTransform, getElements, getElements, handle, initializeProgress, registerTransform, remove, toString
 
Methods inherited from class com.ibm.xtools.transform.core.AbstractTransform
createContext, getTransformationDescriptor
 
Methods inherited from class com.ibm.xtools.transform.core.AbstractTransformElement
getAcceptCondition, getDescription, getId, getName, getProgressMonitor, setAcceptCondition, setDescription, setId, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RootTransform

public RootTransform(ITransformationDescriptor descriptor)
Constructor.

Parameters:
descriptor - A transformation descriptor.
Method Detail

addToFinal

public void addToFinal(AbstractTransformElement transformElement)
Add a transform element to the finalization phase.

Parameters:
transformElement - A transform element to execute during the finalization phase.

addToInit

public void addToInit(AbstractTransformElement transformElement)
Add a transform element to the initialization phase.

Parameters:
transformElement - A transform element to execute during the initialization phase.

getMainTransform

public Transform getMainTransform()
Retrieve the main transform.

Returns:
A main transform.

initialize

public Transform initialize(Transform aTransform,
                            boolean acceptList)
Initialize the root transform to create the three phase structure. This method must be called by the client only once otherwise exceptions may be generated later. If the main transform is not specified, a default main transform will be created and will be returned. If the main transform wants to receive the selected objects one at a time, set the "acceptList" parameter to false.

Parameters:
aTransform - The main transform to execute.
acceptList - Indicate whether the main transform wants a list or single elements.
Returns:
Transform - the main transform that does the processing

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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