Code generation templates

 

Overview

To use code generation templates, you must have a valid Objecteering MDA Modeler license. 

 

Generation templates are used to visualize the structure of generated Java source and to easily modify the Java code produced.  The template editors provided are detailed in the Objecteering MDA Modeler user guide.

 

Figure 173. Java generation template

 

 

Each template element is loaded with a file zone to generate.  The roles are summed up in the table below.

 

The ... document template element

is used to generate ...

ClassDoc

the Javadoc type documentation relative to the class.

PackageName

the name of the package in which the class is defined.

Import

the processing of the imported classes and packages.

UtilVector

the import java.util* of the package when an attribute, an association or a method parameter has the Vector, Stack or Hashtable type.

StandardImport

the processing use links between packages translated by a package import used for all the classes of the user package.

ImportWithTaggedValue

the processing of the JavaImport tagged values present on the class or the package to which the class belongs.

HeaderText

the JavaHeader type texts.

ClassHeader

the class header.

ClassModifiers

the abstract, final, visibility.

ClassName

the name of the class.

Extends

the processing of the generalizations.

Standard

the generalization for a generalization link on a model.

ExtendsWithTaggedValue

the translation of the {JavaExtends} tagged values.

Implements

the processing of the interface implementations.

StandardImplements

the implementation for an implementation link on the model.

ImplementsWithTaggedValue

the translation of the {JavaImplements} tagged values.

ImplementsWithEnumerations

the implementations which correspond to the enumerations used in the class.

ClassBody

the class body (see below).

DataTypes

the generation into non-public classes of types defined in the class.

Enumerations

the generation in the form of interfaces of enumerations defined in the class.

NonPublicClasses

the generation of non-public classes.

BottomText

the JavaBottom type texts.

 

 

Detail of the ClassBody item (part 1)

 

Figure 174. Detail of a class body

 

 

The ... item

represents ...

ClassBody

the class body.

StaticField

the static fields.

NonStaticField

the non static fields.

PublicField

the public visibility fields.

ProtectedField

the protected visibility fields.

FriendlyField

the friendly visibility fields.

PrivateField

the private visibility fields.

Attribute

the attributes.

AttributeDoc

the Javadoc text for an attribute.

AttributeDeclaration

the declaration of an attribute.

AttributeAccessors

the accessors and the modifiers on an attribute.

AssociationEnd

the associations.

AssociationDoc

the Javadoc text for an association.

AssociationDeclaration

the declaration of the attribute corresponding to an association.

AssociationAccessors

the accessors and the modifiers on the attribute corresponding to an association.

InnerClasses

the internal classes.

Constructors

the constructors.

Destructor

the finalize method.

PublicMethod

the public methods.

ProtectedMethod

the protected methods.

FriendlyMethod

the friendly methods.

PrivateMethod

the private methods.

MainMethod

The main method.

Invariant

the invariant() method.

MembersText

the JavaMembers notes.

 

 

Detail of the ClassBody item (Part 2)

 

Figure 175. Breakdown of method content

 

 

The ... item

represents ...

Constructors

the constructors.

Constructor

a constructor.

Destructor

the destructor.

DestructorHeader

the declaration of the finalizer.

PublicMethod

a class's public methods.

Method

a method.

MethodDoc

the generation of a javadoc text for a method.

MethodModifiers

the visibility, static, final, abstract, synchronized, native.

NoReturnParameter

the type of return (void).

ReturnParameter

the type of return parameter.

MethodName

the method's name.

NoParameters

the section related to the parameters of a method when it doesn't have any.

Parameters

the section related to the parameters of a method when it  has some.

ListOfParameters

the parameters.

Parameter

a parameter.

Exceptions

the declarations of exception launching.

MethodBody

the method's body.

BodyHeader

the JavaSuper type texts.

PreConditions

the pre-conditions of the Javacode type model.

Body

the method's implementation, generation of a JavaCode type model implementation.

PostConditions

the generation of the post-conditions of the JavaCode type model.

BodyBottom

the generation of a JavaReturned text type.