IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.core
Class AbstractTransformElement

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

public abstract class AbstractTransformElement
extends Object
implements ITransformationItem

The Abstract Transform Element class is the base class for all transformation objects (elements). There are three types of transformation elements: a transform, an extractor and a rule.

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.

All transformation elements have a unique id, a localized name and a localized description of the object's purpose. Depending upon the type of transformation element, some of these properties may be optional.

As part of the default transformation engine, all transformation elements have the ability to accept or reject the execution context before the element is executed. This acceptance is defined by an acceptance condition, If the condition class is derieved from the query framework's Condition class, then the acceptance decision is based upon the source object (from the context). If the condition is derived from TransformCondition, then the acceptance decision can be based upon all of the data stored in the context.

See Also:
Condition, TransformCondition

Method Summary
 boolean canAccept(ITransformContext context)
          Using the context, determine if this transformation element should be executed.
 Condition getAcceptCondition()
          Retrieve the condition that will be used by the canAccept method to determine if the context is acceptable.
 String getDescription()
          Retrieve the localized description of the transformation item.
 String getId()
          Retrieve the unique id of the transformation item.
 String getName()
          Retrieve the localized name of the transformation item.
protected  IProgressMonitor getProgressMonitor(ITransformContext context)
          Return the progress monitor for this transformation execution.
 void setAcceptCondition(Condition condition)
          Set a condition that will be used by the canAccept method to determine if the context is acceptable.
 void setDescription(String theDescription)
          Set the description for this transformation element.
 void setId(String elementId)
          Set the unique id of this transformation element.
 void setName(String string)
          Set the name of this transformation element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

canAccept

public boolean canAccept(ITransformContext context)
Using the context, determine if this transformation element should be executed.

The default implementation will make use of the condition if one is defined. Subclasses may override this method to provide more specialized acceptance criteria.

Parameters:
context - the current context of the transformation execution
Returns:
boolean - true if the transform element will execute with the context

getAcceptCondition

public final Condition getAcceptCondition()
Retrieve the condition that will be used by the canAccept method to determine if the context is acceptable.

Returns:
Condition - the condition associated with this element

getDescription

public final String getDescription()
Description copied from interface: ITransformationItem
Retrieve the localized description of the transformation item.

Specified by:
getDescription in interface ITransformationItem
Returns:
String - the localized description for the transformation item.
See Also:
ITransformationItem.getDescription()

getId

public final String getId()
Description copied from interface: ITransformationItem
Retrieve the unique id of the transformation item.

Specified by:
getId in interface ITransformationItem
Returns:
String - the unique identifier for the transformation item
See Also:
ITransformationItem.getId()

getName

public final String getName()
Description copied from interface: ITransformationItem
Retrieve the localized name of the transformation item.

Specified by:
getName in interface ITransformationItem
Returns:
String - the localized name for the transformation item.
See Also:
ITransformationItem.getName()

setAcceptCondition

public final void setAcceptCondition(Condition condition)
Set a condition that will be used by the canAccept method to determine if the context is acceptable.

Parameters:
condition - The acceptance condition.

setDescription

public final void setDescription(String theDescription)
Set the description for this transformation element.

Parameters:
theDescription - A string describing this transformation element.

setId

public final void setId(String elementId)
Set the unique id of this transformation element.

Parameters:
elementId - A string representing a unique id for this transformation element.

setName

public final void setName(String string)
Set the name of this transformation element.

Parameters:
string - A string representing a name for this transformation element.

getProgressMonitor

protected IProgressMonitor getProgressMonitor(ITransformContext context)
Return the progress monitor for this transformation execution.

Parameters:
context - the current context of the transformation execution
Returns:
IProgressMonitor - progress monitor for transformation

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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