IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.transform.core
Class AbstractContentExtractor

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

public abstract class AbstractContentExtractor
extends AbstractTransformElement

The Abstract Content Extractor is the base class for all content extractors used within the default transformation engine.

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.

A content extractor is responsible for extracting the relevant associated objects for the given source object in the context. For example, if the source object is a UML class, the relevant objects returned might include all contained attributes and operations. This base class defines the common methods for specifying and obtaining a condition that can be used to filter the relevant objects that will be returned. For example, the filter condition could be used to ignore relationships defined on the UML class.

A content extractor always has an associated transform that is responsible for processing the related source objects that are extracted.


Constructor Summary
AbstractContentExtractor()
          The default constructor should only be used internally by the transformation service.
AbstractContentExtractor(String id, AbstractTransform transform)
          Constructor to create a ContentExtractor.
 
Method Summary
abstract  Collection execute(ITransformContext context)
          Retrieve the elements related to the source object that will be processed by the associated transform.
 Condition getFilterCondition()
          Retrieve a condition that the extractor will use to filter the contents of the elements that it will return.
 AbstractTransform getTransform()
          Retrieve the associated transform that will be applied to the contents returned by this extractor.
 void setFilterCondition(Condition condition)
          Set a condition that the extractor will use to filter the contents of the elements that it will extract.
 void setTransform(AbstractTransform transform)
          Set the associated transform for this extractor.
 String toString()
           
 
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, wait, wait, wait
 

Constructor Detail

AbstractContentExtractor

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


AbstractContentExtractor

public AbstractContentExtractor(String id,
                                AbstractTransform transform)
Constructor to create a ContentExtractor.

Parameters:
id - A unique id for the extractor.
transform - An associated transform for the extractor.
Method Detail

execute

public abstract Collection execute(ITransformContext context)
                            throws Exception
Retrieve the elements related to the source object that will be processed by the associated transform.

Parameters:
context - the current context of the transformation execution
Returns:
Collection - the collection of related source model objects
Throws:
Exception

getFilterCondition

public final Condition getFilterCondition()
Retrieve a condition that the extractor will use to filter the contents of the elements that it will return.

Returns:
Condition - the filtering condition

getTransform

public final AbstractTransform getTransform()
Retrieve the associated transform that will be applied to the contents returned by this extractor.

Returns:
AbstractTransform - the transformation to process the extracted objects.

setFilterCondition

public final void setFilterCondition(Condition condition)
Set a condition that the extractor will use to filter the contents of the elements that it will extract.

Parameters:
condition - A filter condition.

setTransform

public final void setTransform(AbstractTransform transform)
Set the associated transform for this extractor. All source model objects extracted during the execute() method will be processed by this transform.

Parameters:
transform - the transform to process extracted objects.

toString

public String toString()

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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