public abstract class AbstractTransformElement extends java.lang.Object implements ITransformationItem
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.
Condition
,
TransformCondition
Modifier and Type | Method and Description |
---|---|
boolean |
canAccept(ITransformContext context)
Using the context, determine if this transformation element should be executed.
|
org.eclipse.emf.query.conditions.Condition |
getAcceptCondition()
Retrieve the condition that will be used by the canAccept method
to determine if the context is acceptable.
|
java.lang.String |
getDescription()
Retrieve the localized description of the transformation item.
|
java.lang.String |
getId()
Retrieve the unique id of the transformation item.
|
java.lang.String |
getName()
Retrieve the localized name of the transformation item.
|
protected org.eclipse.core.runtime.IProgressMonitor |
getProgressMonitor(ITransformContext context)
Return the progress monitor for this transformation execution.
|
void |
setAcceptCondition(org.eclipse.emf.query.conditions.Condition condition)
Set a condition that will be used by the canAccept method
to determine if the context is acceptable.
|
void |
setDescription(java.lang.String theDescription)
Set the description for this transformation element.
|
void |
setId(java.lang.String elementId)
Set the unique id of this transformation element.
|
void |
setName(java.lang.String string)
Set the name of this transformation element.
|
public boolean canAccept(ITransformContext context)
The default implementation will make use of the condition if one is defined. Subclasses may override this method to provide more specialized acceptance criteria.
context
- the current context of the transformation executionpublic final org.eclipse.emf.query.conditions.Condition getAcceptCondition()
public final java.lang.String getDescription()
ITransformationItem
getDescription
in interface ITransformationItem
ITransformationItem.getDescription()
public final java.lang.String getId()
ITransformationItem
getId
in interface ITransformationItem
ITransformationItem.getId()
public final java.lang.String getName()
ITransformationItem
getName
in interface ITransformationItem
ITransformationItem.getName()
public final void setAcceptCondition(org.eclipse.emf.query.conditions.Condition condition)
condition
- The acceptance condition.public final void setDescription(java.lang.String theDescription)
theDescription
- A string describing this transformation element.public final void setId(java.lang.String elementId)
elementId
- A string representing a unique id for this transformation element.public final void setName(java.lang.String string)
string
- A string representing a name for this transformation element.protected org.eclipse.core.runtime.IProgressMonitor getProgressMonitor(ITransformContext context)
context
- the current context of the transformation execution