This sample generates a basic Java source file for each Class of an UML input model. The sample generates:
|
Here is an example of a UML 1.3 based Java generation launch:

| Feature | Example | Location | Reference |
| Calling a text template from a rule | $JavaSource(class) |
JavaGeneration.mqr |
template call |
| Including a text template from another text template | [#include ClassJavadoc(class)] |
JavaSource.tgt |
include |
| Trimming to avoid blank lines | ${class.importsDeclaration}[#rtrim] |
JavaSource.tgt |
trim |
| Filtering a list of instances based on a criterium | self.parameter.reject("kind", RETURN_LITERAL) |
uml13_Operation.mqs |
MDWList |
| Specifying a default value | self.returnType.javaType ? "void" |
uml13_Operation.mqs |
default value |
| Using protected sections to keep user code | [#protectedStartTag] |
uml13_Operation.mqs |
protected tags |