|
IBM Rational Software Modeler Release 6.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The Transform Context is the interface for setting and getting property values during the execution of a transformation.
The hierarchical nature of source models and the recursive nature of the transformation hierarchy require that the context in which the transforms, extractors and rules are executed must be kept in a stack-like fashion. ITransformContext is responsible for maintaining this execution contextual information, which includes the current source, target and target container objects. It also includes a local property table that enables rules to define data that can be accessed by sibling rules or by rules in nested transforms.
A new execution context object is created each time a transform is executed. All rules and extractors associated with the transform use the same context instance so if one rule defines a property, a sibling rule can access or modify that property. When a nested transform is executed, a new execution context created that is linked to its parent context. Therefore, rules within the nested transforms have access to the properties defined in the parent context(s), in addition to the properties defined in their own context. However, the properties in the parent context(s) are read-only.
An execute context has its own local property table and its associated transform may have a transformation descriptor with properties. Setting a value for a property defined in the descriptor results in an entry in the local property table, if the descriptor property is read-write. The default property values in the actual descriptor cannot be changed via the execute context. Properties may also be defined in a parent context but again, setting a new value will not change the value in the parent context. The property is simply added to the local table which temporarily overrides the value in the parent context.
Field Summary | |
static String |
CURRENT_ELEMENT
The current transform element being executed. |
static String |
PROGRESS_MONITOR
The progress monitor to be used for this transformation execution. |
static String |
SOURCE
The source object property id. |
static String |
TARGET
The target object corresponding to the source object property id. |
static String |
TARGET_CONTAINER
The target container object property id. |
Method Summary | |
ITransformContext |
getParentContext()
Get the parent execution context. |
String[] |
getPropertyIds()
Retrieve a list of property identifiers in this context. |
Object |
getPropertyValue(String propertyId)
Get the value of a property that is defined within the context of the transformation being executed. |
Object |
getSource()
Get the source object that the transformation element is to process |
Object |
getTarget()
Get the target object that the transformation element is to use |
Object |
getTargetContainer()
Get the target container object that the transformation element is to use |
AbstractTransform |
getTransform()
Get the transform associated with this context. |
boolean |
setPropertyValue(String propertyId,
Object data)
Set a property value in the transformation execution context. |
Field Detail |
public static final String SOURCE
public static final String TARGET_CONTAINER
public static final String TARGET
public static final String PROGRESS_MONITOR
public static final String CURRENT_ELEMENT
Method Detail |
public ITransformContext getParentContext()
If the parent context is null, context is the root of the transformation.
public String[] getPropertyIds()
public Object getPropertyValue(String propertyId)
This method checks the property table in the current execution context and if the property does not exist, the property table in the parent context is checked recursively. If the context for the root transform does not contain the property, the transformation descriptors associated with the transforms are then checked.
propertyId
- the ID of the property
public Object getSource()
public Object getTarget()
public Object getTargetContainer()
public AbstractTransform getTransform()
A transformation may have several nested transforms. When each transform is executed, a new execution context is created and is linked into the existing context execution stack.
public boolean setPropertyValue(String propertyId, Object data)
propertyId
- the ID of the property being setdata
- the data object for the property value
|
IBM Rational Software Modeler Release 6.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2004. All rights reserved.