Home > XMI Editor

Java metamodel element

You can change, add or delete metamodel elements using the XMI 2.1 Editor view, the property view, the Package Explorer or the UML Editor.
In order to understand the metamodel concept you should consider two kind of elements (e.g. Java and non Java element).

  • If you use the Package Explorer or the UML Editor menu, then all created elements in the class diagram will be Java elements.
  • If you use the XMI 2.1 Editor, then all new created elements will only be UML elements (e.g. no Java code)

1.Java elements

  1. Change
  2. Add UML inside Java Class
  3. Delete

In this example we have a Java Class (e.g. Class1) which is displayed in:

  1.  the Package Explorer
  2. the UML Editor
  3. the property view
  4. the model editor
    If you update the Class information in one of the view, then all views will be updated.

    1. Change Java Element

In this example we are going to change attribute visibility directly in the Property View.
    Note that the Java code is updated as well as Package Explorer, UML Editor, Property View and XMI 2.1 Editor.
    If the change the visibility of the the following attribute from Private to Public:


    By just changing the Visibility in the Properties view we immediately get the following:

    2. Add UML element to a Java Class, Interface or Enumeration

    For example we are going to extend a Java Class by adding a UML property.
    Select the class in the XMI 2.1 Editor > New Child > Owned Attribute > Property

    The new UML property will be added in your XMI 2.1 Editor and in your UML Editor.
    The Package Explorer will not be updated because not java code has been created.
    Note that you can add a name using the Properties View Name Field

    3. Delete a Java element

    If you delete a Java element from:
  • the XMI 2.1 Editor, then only the metamodel will be changed and not the Java Code.
  • the Java Code, then the metamodel will also be updated