public abstract class AbstractContentExtractor extends AbstractTransformElement
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 and Description |
---|
AbstractContentExtractor()
The default constructor should only be used internally by the
transformation service.
|
AbstractContentExtractor(java.lang.String id,
AbstractTransform transform)
Constructor to create a ContentExtractor.
|
Modifier and Type | Method and Description |
---|---|
abstract java.util.Collection |
execute(ITransformContext context)
Retrieve the elements related to the source object that will be
processed by the associated transform.
|
org.eclipse.emf.query.conditions.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(org.eclipse.emf.query.conditions.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.
|
java.lang.String |
toString() |
canAccept, getAcceptCondition, getDescription, getId, getName, getProgressMonitor, setAcceptCondition, setDescription, setId, setName
public AbstractContentExtractor()
public AbstractContentExtractor(java.lang.String id, AbstractTransform transform)
id
- A unique id for the extractor.transform
- An associated transform for the extractor.public abstract java.util.Collection execute(ITransformContext context) throws java.lang.Exception
context
- the current context of the transformation executionjava.lang.Exception
public final org.eclipse.emf.query.conditions.Condition getFilterCondition()
public final AbstractTransform getTransform()
public final void setFilterCondition(org.eclipse.emf.query.conditions.Condition condition)
condition
- A filter condition.public final void setTransform(AbstractTransform transform)
transform
- the transform to process extracted objects.public java.lang.String toString()
toString
in class java.lang.Object