public interface ReferenceManager
When transforming an input model into an output model, the developer needs to create relations between elements part of the output model
corresponding to relations part of the input model. However source and target elements might not yet exist in the output model by the time the
developer identifies the relations to create, depending on the navigation order in the input model. The ReferenceManager
enables to
register references to create and to delay the actual creation by the time source and target elements exist in the output model.
It is the developer responsibility to execute a builder operation to create references in the output model. A build operation is to execute at least once at the end of the transformation. It shall be executed multiple times, at various stages of the transformation, if desired.
This interface is not intended to be implemented by clients.
ObjectMapping.setPrimary(EObject)
,
Mapping.getReferences()
Modifier and Type | Method and Description |
---|---|
void |
add(Collection<? extends EObject> inputs,
Runnable referenceBuilder)
Registers a
Runnable instance to execute when the specified input elements all have corresponding
primary output elements. |
void |
add(EObject source,
Collection<? extends EObject> targets,
EReference outputReference)
Registers references to create in the output model when the specified source and target input elements have corresponding
primary output elements.
|
void |
add(EObject source,
EObject target,
EReference outputReference)
Registers a reference to create in the output model when the specified source and target input elements have corresponding
primary output elements.
|
void |
add(EObject input,
Runnable referenceBuilder)
Registers a
Runnable instance to execute when the specified input element has a corresponding
primary output element. |
Operation |
createBuilder()
Creates a build operation to create references in the output model.
|
void add(EObject source, EObject target, EReference outputReference)
source
- the source element, part of the input model.target
- the target element, part of the input model.outputReference
- the reference to create between corresponding primary source and target elements in the output model, once they exist.ObjectMapping.setPrimary(EObject)
void add(EObject source, Collection<? extends EObject> targets, EReference outputReference)
Note that the builder operation will create references whose source and target elements exist in the output model. References whose source and target elements are not know by the time the operation is executed remain registered in the manager.
source
- the source element, part of the input model.targets
- the target elements, part of the input model.outputReference
- the reference to create between corresponding primary source and target elements in the output model, once they exist.ObjectMapping.setPrimary(EObject)
void add(EObject input, Runnable referenceBuilder)
Runnable
instance to execute when the specified input element has a corresponding
primary output element. This method enables to execute an arbitrary piece of code, for more complex situations where not a simple reference is
to create but potentially a set of objects.input
- an element part of the input model.referenceBuilder
- the block of code to execute once the primary output element corresponding to the specified input element is known.ObjectMapping.setPrimary(EObject)
void add(Collection<? extends EObject> inputs, Runnable referenceBuilder)
Runnable
instance to execute when the specified input elements all have corresponding
primary output elements. This method enables to execute an arbitrary piece of code, for more complex situations where not a simple reference is
to create but potentially a set of objects.inputs
- elements part of the input model.referenceBuilder
- the block of code to execute once all primary output elements corresponding to the specified input elements are known.ObjectMapping.setPrimary(EObject)
Operation createBuilder()