IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.core
Class ListContentExtractor

java.lang.Object
  extended bycom.ibm.xtools.transform.core.AbstractTransformElement
      extended bycom.ibm.xtools.transform.core.AbstractContentExtractor
          extended bycom.ibm.xtools.transform.core.ListContentExtractor
All Implemented Interfaces:
ITransformationItem

public class ListContentExtractor
extends AbstractContentExtractor

The List Content Extractor extracts the contained source objects when the "SOURCE" proerty in the execution context is a List object.

When a transformation is executed via the UI, the source objects for the transformation are defined by the current selection. Since multiple objects can be selected, the relavant objects for the transformation are kept in a List object and the list is passed to the transformation when it is executed. This extractor simply returns the object in that list so that they can be processed by the associated transform.

Typcially a ListContentExtractor instance will only occur in the root transform of a transformation. If the RootTransform class is used, it automatically creates an instance of this list extractor.


Constructor Summary
ListContentExtractor()
          The default constructor should only be used internally by the transformation service.
ListContentExtractor(String id, AbstractTransform transform)
          Extractor constructor.
 
Method Summary
 boolean canAccept(ITransformContext context)
          Using the context, determine if this transformation element should be executed.
 Collection execute(ITransformContext context)
          Retrieve the elements related to the source object that will be processed by the associated transform.
 
Methods inherited from class com.ibm.xtools.transform.core.AbstractContentExtractor
getFilterCondition, getTransform, setFilterCondition, setTransform, toString
 
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

ListContentExtractor

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


ListContentExtractor

public ListContentExtractor(String id,
                            AbstractTransform transform)
Extractor constructor.

Parameters:
id - the identifer for this extractor
transform - the transform for processing the list's objects
Method Detail

canAccept

public boolean canAccept(ITransformContext context)
Description copied from class: AbstractTransformElement
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.

Overrides:
canAccept in class AbstractTransformElement
Parameters:
context - the current context of the transformation execution
Returns:
boolean - true if the transform element will execute with the context

execute

public Collection execute(ITransformContext context)
Description copied from class: AbstractContentExtractor
Retrieve the elements related to the source object that will be processed by the associated transform.

Specified by:
execute in class AbstractContentExtractor
Parameters:
context - the current context of the transformation execution
Returns:
Collection - the collection of related source model objects

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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