Common to All Languages


Exclude model elements from the code generation targets

Apply to the model elements that do not generate code, such as "std" package defining the types.

  • Using TaggedValue

  1. Click a model element. The following model elements can be selected.

    • Package

    • Class

    • Attribute

    • Operation

    • Association

    • Generalization

    • Realization

    • Dependency

  2. Select the TaggedValue tab.

  3. Enter "generate" in the Name, and "false" in the Value.

  • Using Stereotype

  1. Click a model element. The following model elements can be selected.

    • Package

    • Class

    • Attribute

    • Operation

    • Association

    • Generalization

    • Realization

    • Dependency

  2. Select the Stereotype tab.

  3. Enter "generate=false" in the Name.


Specify the root package for code generation

Apply to the root package of code generation. The Include Guard Macros, Include Directives and Import Statements use the paths below the specified root package.

  1. Click a package element.

  2. Select the Stereotype tab.

  3. Enter "code_generation_root" in the Name.


Set the external classes to the base classes

Apply when you want to set the external classes that are not model elements to the base classes.

  • Using TaggedValue

  1. Click a class element.

  2. Select the TaggedValue tab.

  3. Enter "base_class" in the Name, and the base class names in the Value.

NOTE: For C++, enter base class names with the visibility.

Ruby Example Code

#!/usr/bin/env ruby

# -*- coding: utf-8 -*-

# ˅


# ˄


class Foo < MiniTest::Unit::TestCase

# ˅

# ˄


# ˅

# ˄

end


# ˅


# ˄


  • Using Stereotype

  1. Click a class element.

  2. Select the Stereotype tab.

  3. Enter "base_class=(base class names)" in the Name.

NOTE: For C++, enter base class names with the visibility.

Ruby Example Code

#!/usr/bin/env ruby

# -*- coding: utf-8 -*-

# ˅


# ˄


class Foo < MiniTest::Unit::TestCase

# ˅

# ˄


# ˅

# ˄

end


# ˅


# ˄



Write comments describing the model elements

  1. Click a model element.

  2. Select the Base tab.

  3. Enter comments in the Definition.

Ruby Example Code

#!/usr/bin/env ruby

# -*- coding: utf-8 -*-

# ˅


# ˄


# First line comment.

# Second line comment.

class Foo

# ˅

# ˄


# ˅

# ˄

end


# ˅


# ˄