In Transmorpher, the transformation is the container of all the processes. It often identifies a main process (see ) that will be called when the transformation is called. These transformations are the unit to which the main operations (compiling, running, etc.) are applied.
In the bibliographic example, the transformation declaration is the following:
constructoradd-process run generate-graph compile save load-file set-observer
Export interfaces enable the use of Transmorpher transformations in various contexts. They are defined as the main process in a particular transformation (which is called when the transformation is invoked).
Under the interpretation environment of Transmorpher, all transformations are executed like a standalone transformation.
Usually, Transmorpher descriptions are interpreted at a top-level like in:
$ java -jar transmo.jar process.xmlThis interpreted mode can also be invoked by any Java program or called from the Ant program. However, these transformations can be compiled into a Java program that can be invoked in another context. The form of this Java program will depend on the nature of the main element of the transformation:
The main interface allows for the implementation of a stand-alone Transmorpher transformation.
This interface is compiled as a class, named after the name of the main element implementing "runable". It can be invoked in a command line as:
The transformer interface is defined in the Java API for XML processing (JAXP). Transmorpher can export a transformation implementing the transformer interface. It can be called from a Java program with the JAXP interface.
Next chapter: Generators and serializers