Java Reference
In-Depth Information
3. The type compliance of all parameters and evaluation of the
when
clause
takes place. If failure occurs,
null
is returned.
4. If the guard succeeds, the trace is consulted to see whether the mapping
has previously been satisfied for the given input. If so, the out parameters
are populated using the previous result and are returned. Otherwise, the
mapping body is entered.
5. The expressions found in the
init
section (if present) are executed in
sequence.
6. Following
init
, the “implicit instantiation” section is entered, where all
output objects are initialized, if still
null
. Collection types are initialized
with empty collections, and trace data is recorded for the mapping.
7. Each expression in the population section is executed in sequence, typi-
cally operating on the
out
or
inout
objects.
8. The
end
section expressions are then executed in sequence.
The execution semantics change when a mapping inherits, merges, or is a dis-
junction of another mapping, as described in Section 13.3.3, “Inheritance,
Merger, and Disjunction.”
return
During execution of a mapping operation or helper, you can control the flow
using explicit
return
statements. If a value is provided, it is assigned to the
result
object of the mapping.
13.3.2 Entry Operation
A special form of mapping, known as the entry operation, is marked with the
main
keyword. There can be only one
main
per transformation—or, in the case
of abstract transformations, no
main
operation at all. If used without
mapping
,
this entry point takes no parameters and has no
init
,
population
, or
end
block. A
main
can be used with the
mapping
keyword and combines the aspects
of the transformation entry point and those of a regular mapping operation.
Following is a
main
that does not declare that it's a mapping operation. The out-
put is assigned the result of the
toRequirementsModel()
mapping. As you can
see, QVTO allows parameters in
main
operations, although it's technically not
allowed in the specification.
Search WWH ::
Custom Search