Java code and modeling correspondance

Introduction

Listed below are the usual concepts for Java development, together with the way in which they can be expressed in Modelio.

Notions on a class

Java notionUML model mapping
abstract class"Abstract" field of a class
final class"Can be inherited" field of a class
generalizationClass generalization, or [{JavaExtends} tagged value][2]
interface implementationImplementation link, or [{JavaImplements} tagged value][2]
imports classesUse and reference links of its package, or [{JavaImport} tagged value][2] on the class and its package
class invariantConstraint on class, [stereotyped JavaInvariant][3]
inner classContained class
non public class[JavaBottom note type][4], or import link stereotyped [JavaFileGroup][5]

Notions on an operation

Java notionUML model mapping
public visibilityPublic value in the Visibility field on an operation.
protected visibilityProtected value in the Visibility field on an operation.
private visibilityPrivate value in the Visibility field on an operation.
friendly visibilityNo value in the Visibility field on an operation.
constructorcreate stereotype on an operation.
finalize() methoddestroy stereotype on an operation.
abstract"Abstract" operation field.
static"Class" operation field.
final"Cannot be specialized" operation field.
synchronized[{JavaSynchronized} tagged value][2].
native[{JavaNative} tagged value][2].
exceptions generated by an operation[{JavaThrownException} tagged value][2]. You can model the throwing of exceptions through a dependency link towards a class which derives from java.lang.Exception or towards a signal stereotyped Exception.

Notions on an attribute

Java notionUML model mapping
visibilitySame mapping process as for operations.
staticClass field of an attribute.
final[{JavaFinal} tagged value][2].